Implemented UI for new first-run tutorial.
[chromium-blink-merge.git] / chrome / browser / chromeos / first_run / first_run_controller.h
blobbde71e27f8e6837c4b5ba6f9b7c633ecccf30183
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 "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/linked_ptr.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h"
17 namespace ash {
18 class FirstRunHelper;
21 namespace chromeos {
23 namespace first_run {
24 class Step;
27 // FirstRunController creates and manages first-run tutorial.
28 // Object manages its lifetime and deletes itself after completion of the
29 // tutorial.
30 class FirstRunController : public FirstRunActor::Delegate {
31 typedef std::vector<linked_ptr<first_run::Step> > Steps;
33 public:
34 FirstRunController();
35 virtual ~FirstRunController();
37 // Creates first-run UI and starts tutorial.
38 void Start();
40 // Finalizes first-run tutorial and destroys UI.
41 void Stop();
43 private:
44 // Overriden from FirstRunActor::Delegate.
45 virtual void OnActorInitialized() OVERRIDE;
46 virtual void OnNextButtonClicked(const std::string& step_name) OVERRIDE;
47 virtual void OnActorDestroyed() OVERRIDE;
49 void RegisterSteps();
50 void ShowNextStep();
51 void AdvanceStep();
52 first_run::Step* GetCurrentStep() const;
54 // The object providing interface to UI layer. It's not directly owned by
55 // FirstRunController.
56 FirstRunActor* actor_;
58 // Helper for manipulating and retreiving information from Shell.
59 scoped_ptr<ash::FirstRunHelper> shell_helper_;
61 // List of all tutorial steps.
62 Steps steps_;
64 // Index of step that is currently shown.
65 size_t current_step_index_;
67 DISALLOW_COPY_AND_ASSIGN(FirstRunController);
70 } // namespace chromeos
72 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_FIRST_RUN_CONTROLLER_H_