blob: 989bb76eb7d9bfe3da4eb30a83732232806486da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_FIRST_RUN_CONTROLLER_H_
#define CHROME_BROWSER_CHROMEOS_FIRST_RUN_FIRST_RUN_CONTROLLER_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h"
class Profile;
namespace ash {
class FirstRunHelper;
}
namespace chromeos {
namespace first_run {
class Step;
}
// FirstRunController creates and manages first-run tutorial.
// Object manages its lifetime and deletes itself after completion of the
// tutorial.
class FirstRunController : public FirstRunActor::Delegate {
typedef std::vector<linked_ptr<first_run::Step> > Steps;
public:
virtual ~FirstRunController();
// Creates first-run UI and starts tutorial.
static void Start();
// Finalizes first-run tutorial and destroys UI.
static void Stop();
private:
FirstRunController();
void Init();
void Finalize();
// Overriden from FirstRunActor::Delegate.
virtual void OnActorInitialized() OVERRIDE;
virtual void OnNextButtonClicked(const std::string& step_name) OVERRIDE;
virtual void OnHelpButtonClicked() OVERRIDE;
virtual void OnCloseButtonClicked() OVERRIDE;
virtual void OnActorDestroyed() OVERRIDE;
void RegisterSteps();
void ShowNextStep();
void AdvanceStep();
first_run::Step* GetCurrentStep() const;
// The object providing interface to UI layer. It's not directly owned by
// FirstRunController.
FirstRunActor* actor_;
// Helper for manipulating and retreiving information from Shell.
scoped_ptr<ash::FirstRunHelper> shell_helper_;
// List of all tutorial steps.
Steps steps_;
// Index of step that is currently shown.
size_t current_step_index_;
// Profile used for webui and help app.
Profile* user_profile_;
DISALLOW_COPY_AND_ASSIGN(FirstRunController);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_FIRST_RUN_CONTROLLER_H_
|