Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / first_run / step.h
blob7f72cab33f2690bb840fb1159c7ad266b093a1ae
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_
6 #define CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/time/time.h"
13 namespace ash {
14 class FirstRunHelper;
17 namespace gfx {
18 class Size;
21 namespace chromeos {
23 class FirstRunActor;
25 namespace first_run {
27 class Step {
28 public:
29 Step(const std::string& name,
30 ash::FirstRunHelper* shell_helper,
31 FirstRunActor* actor);
32 virtual ~Step();
34 // Step shows its content.
35 void Show();
37 // Called before hiding step.
38 void OnBeforeHide();
40 // Called after step has been hidden.
41 void OnAfterHide();
43 const std::string& name() const { return name_; }
45 protected:
46 ash::FirstRunHelper* shell_helper() const { return shell_helper_; }
47 FirstRunActor* actor() const { return actor_; }
48 gfx::Size GetOverlaySize() const;
50 // Called from Show method.
51 virtual void DoShow() = 0;
53 // Called from OnBeforeHide. Step implementation could override this method to
54 // react on corresponding event.
55 virtual void DoOnBeforeHide() {}
57 // Called from OnAfterHide. Step implementation could override this method to
58 // react on event.
59 virtual void DoOnAfterHide() {}
61 private:
62 // Records time spent on step to UMA.
63 void RecordCompletion();
65 std::string name_;
66 ash::FirstRunHelper* shell_helper_;
67 FirstRunActor* actor_;
68 base::Time show_time_;
70 DISALLOW_COPY_AND_ASSIGN(Step);
73 } // namespace first_run
74 } // namespace chromeos
76 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_