OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LOGIN_SCREENS_BASE_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_BASE_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_BASE_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_BASE_SCREEN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/chromeos/login/oobe_screen.h" |
12 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 13 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
13 #include "components/login/base_screen_handler_utils.h" | 14 #include "components/login/base_screen_handler_utils.h" |
14 #include "components/login/screens/screen_context.h" | 15 #include "components/login/screens/screen_context.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class DictionaryValue; | 18 class DictionaryValue; |
18 } | 19 } |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 | 22 |
22 class ModelViewChannel; | 23 class ModelViewChannel; |
23 | 24 |
24 // Base class for the all OOBE/login/before-session screens. | 25 // Base class for the all OOBE/login/before-session screens. |
25 // Screens are identified by ID, screen and it's JS counterpart must have same | 26 // Screens are identified by ID, screen and it's JS counterpart must have same |
26 // id. | 27 // id. |
27 // Most of the screens will be re-created for each appearance with Initialize() | 28 // Most of the screens will be re-created for each appearance with Initialize() |
28 // method called just once. | 29 // method called just once. |
29 class BaseScreen { | 30 class BaseScreen { |
30 public: | 31 public: |
31 explicit BaseScreen(BaseScreenDelegate* base_screen_delegate, | 32 explicit BaseScreen(BaseScreenDelegate* base_screen_delegate, |
32 const std::string& screen_id); | 33 OobeScreen screen_id); |
33 virtual ~BaseScreen(); | 34 virtual ~BaseScreen(); |
34 | 35 |
35 // ---- Old implementation ---- | 36 // ---- Old implementation ---- |
36 | 37 |
37 // Makes wizard screen visible. | 38 // Makes wizard screen visible. |
38 virtual void Show() = 0; | 39 virtual void Show() = 0; |
39 | 40 |
40 // Makes wizard screen invisible. | 41 // Makes wizard screen invisible. |
41 virtual void Hide() = 0; | 42 virtual void Hide() = 0; |
42 | 43 |
(...skipping 13 matching lines...) Expand all Loading... |
56 // Called when we navigate from screen so that we will never return to it. | 57 // Called when we navigate from screen so that we will never return to it. |
57 // This is a last chance to call JS counterpart, this object will be deleted | 58 // This is a last chance to call JS counterpart, this object will be deleted |
58 // soon. | 59 // soon. |
59 virtual void OnClose(); | 60 virtual void OnClose(); |
60 | 61 |
61 // Indicates whether status area should be displayed while this screen is | 62 // Indicates whether status area should be displayed while this screen is |
62 // displayed. | 63 // displayed. |
63 virtual bool IsStatusAreaDisplayed(); | 64 virtual bool IsStatusAreaDisplayed(); |
64 | 65 |
65 // Returns the identifier of the screen. | 66 // Returns the identifier of the screen. |
66 const std::string& screen_id() const { return screen_id_; } | 67 OobeScreen screen_id() const { return screen_id_; } |
67 | 68 |
68 // Called when user action event with |event_id| | 69 // Called when user action event with |event_id| |
69 // happened. Notification about this event comes from the JS | 70 // happened. Notification about this event comes from the JS |
70 // counterpart. | 71 // counterpart. |
71 virtual void OnUserAction(const std::string& action_id); | 72 virtual void OnUserAction(const std::string& action_id); |
72 | 73 |
73 void set_model_view_channel(ModelViewChannel* channel) { channel_ = channel; } | 74 void set_model_view_channel(ModelViewChannel* channel) { channel_ = channel; } |
74 | 75 |
75 protected: | 76 protected: |
76 // Scoped context editor, which automatically commits all pending | 77 // Scoped context editor, which automatically commits all pending |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 145 |
145 // Called when context for the current screen was | 146 // Called when context for the current screen was |
146 // changed. Notification about this event comes from the JS | 147 // changed. Notification about this event comes from the JS |
147 // counterpart. | 148 // counterpart. |
148 void OnContextChanged(const base::DictionaryValue& diff); | 149 void OnContextChanged(const base::DictionaryValue& diff); |
149 | 150 |
150 ModelViewChannel* channel_ = nullptr; | 151 ModelViewChannel* channel_ = nullptr; |
151 | 152 |
152 BaseScreenDelegate* base_screen_delegate_ = nullptr; | 153 BaseScreenDelegate* base_screen_delegate_ = nullptr; |
153 | 154 |
154 const std::string screen_id_; | 155 const OobeScreen screen_id_; |
155 | 156 |
156 DISALLOW_COPY_AND_ASSIGN(BaseScreen); | 157 DISALLOW_COPY_AND_ASSIGN(BaseScreen); |
157 }; | 158 }; |
158 | 159 |
159 } // namespace chromeos | 160 } // namespace chromeos |
160 | 161 |
161 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_BASE_SCREEN_H_ | 162 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_BASE_SCREEN_H_ |
OLD | NEW |