Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/browser/chromeos/first_run/step.h

Issue 131023003: Added UMA metrics for ChromeOS first-run UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/first_run/metrics.h ('k') | chrome/browser/chromeos/first_run/step.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_
6 #define CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_ 6 #define CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/time/time.h"
11 12
12 namespace ash { 13 namespace ash {
13 class FirstRunHelper; 14 class FirstRunHelper;
14 } 15 }
15 16
16 namespace gfx { 17 namespace gfx {
17 class Size; 18 class Size;
18 } 19 }
19 20
20 namespace chromeos { 21 namespace chromeos {
21 22
22 class FirstRunActor; 23 class FirstRunActor;
23 24
24 namespace first_run { 25 namespace first_run {
25 26
26 class Step { 27 class Step {
27 public: 28 public:
28 Step(const std::string& name, 29 Step(const std::string& name,
29 ash::FirstRunHelper* shell_helper, 30 ash::FirstRunHelper* shell_helper,
30 FirstRunActor* actor); 31 FirstRunActor* actor);
31 virtual ~Step(); 32 virtual ~Step();
32 33
33 // Step shows its content. 34 // Step shows its content.
34 virtual void Show() = 0; 35 void Show();
35 36
36 // Called before hiding step. Default implementation removes holes from 37 // Called before hiding step.
37 // background. 38 void OnBeforeHide();
38 virtual void OnBeforeHide();
39 39
40 // Called after step has been hidden. 40 // Called after step has been hidden.
41 virtual void OnAfterHide(); 41 void OnAfterHide();
42
43 // Returns size of overlay window.
44 gfx::Size GetOverlaySize() const;
45 42
46 const std::string& name() const { return name_; } 43 const std::string& name() const { return name_; }
47 44
48 protected: 45 protected:
49 ash::FirstRunHelper* shell_helper() const { return shell_helper_; } 46 ash::FirstRunHelper* shell_helper() const { return shell_helper_; }
50 FirstRunActor* actor() const { return actor_; } 47 FirstRunActor* actor() const { return actor_; }
48 gfx::Size GetOverlaySize() const;
49
50 // Called from Show method.
51 virtual void DoShow() = 0;
52
53 // Called from OnBeforeHide. Step implementation could override this method to
54 // react on corresponding event.
55 virtual void DoOnBeforeHide() {}
56
57 // Called from OnAfterHide. Step implementation could override this method to
58 // react on event.
59 virtual void DoOnAfterHide() {}
51 60
52 private: 61 private:
62 // Records time spent on step to UMA.
63 void RecordCompletion();
64
53 std::string name_; 65 std::string name_;
54 ash::FirstRunHelper* shell_helper_; 66 ash::FirstRunHelper* shell_helper_;
55 FirstRunActor* actor_; 67 FirstRunActor* actor_;
68 base::Time show_time_;
56 69
57 DISALLOW_COPY_AND_ASSIGN(Step); 70 DISALLOW_COPY_AND_ASSIGN(Step);
58 }; 71 };
59 72
60 } // namespace first_run 73 } // namespace first_run
61 } // namespace chromeos 74 } // namespace chromeos
62 75
63 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_ 76 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_STEP_H_
64 77
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/first_run/metrics.h ('k') | chrome/browser/chromeos/first_run/step.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698