Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / chromeos / first_run / first_run_controller.h
blob16226d135e485da0d84fca1908f539e4f9396a04
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_FIRST_RUN_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_FIRST_RUN_FIRST_RUN_CONTROLLER_H_
8 #include <string>
9 #include <vector>
11 #include "ash/first_run/first_run_helper.h"
12 #include "base/basictypes.h"
13 #include "base/callback.h"
14 #include "base/compiler_specific.h"
15 #include "base/memory/linked_ptr.h"
16 #include "base/memory/scoped_ptr.h"
17 #include "base/time/time.h"
18 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h"
20 class Profile;
22 namespace content {
23 class WebContents;
26 namespace chromeos {
28 class FirstRunUIBrowserTest;
30 namespace first_run {
31 class Step;
34 // FirstRunController creates and manages first-run tutorial.
35 // Object manages its lifetime and deletes itself after completion of the
36 // tutorial.
37 class FirstRunController : public FirstRunActor::Delegate,
38 public ash::FirstRunHelper::Observer {
39 typedef std::vector<linked_ptr<first_run::Step> > Steps;
41 public:
42 ~FirstRunController() override;
44 // Creates first-run UI and starts tutorial.
45 static void Start();
47 // Finalizes first-run tutorial and destroys UI.
48 static void Stop();
50 private:
51 friend class FirstRunUIBrowserTest;
53 FirstRunController();
54 void Init();
55 void Finalize();
57 static FirstRunController* GetInstanceForTest();
59 // Overriden from FirstRunActor::Delegate.
60 void OnActorInitialized() override;
61 void OnNextButtonClicked(const std::string& step_name) override;
62 void OnHelpButtonClicked() override;
63 void OnStepShown(const std::string& step_name) override;
64 void OnStepHidden(const std::string& step_name) override;
65 void OnActorFinalized() override;
66 void OnActorDestroyed() override;
68 // Overriden from ash::FirstRunHelper::Observer.
69 void OnCancelled() override;
71 void RegisterSteps();
72 void ShowNextStep();
73 void AdvanceStep();
74 first_run::Step* GetCurrentStep() const;
76 // The object providing interface to UI layer. It's not directly owned by
77 // FirstRunController.
78 FirstRunActor* actor_;
80 // Helper for manipulating and retreiving information from Shell.
81 scoped_ptr<ash::FirstRunHelper> shell_helper_;
83 // List of all tutorial steps.
84 Steps steps_;
86 // Index of step that is currently shown.
87 size_t current_step_index_;
89 // Profile used for webui and help app.
90 Profile* user_profile_;
92 // The work that should be made after actor has been finalized.
93 base::Closure on_actor_finalized_;
95 // Web contents of WebUI.
96 content::WebContents* web_contents_for_tests_;
98 // Time when tutorial was started.
99 base::Time start_time_;
101 DISALLOW_COPY_AND_ASSIGN(FirstRunController);
104 } // namespace chromeos
106 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_FIRST_RUN_CONTROLLER_H_