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_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool show_oobe_ui() const { | 73 bool show_oobe_ui() const { |
74 return show_oobe_ui_; | 74 return show_oobe_ui_; |
75 } | 75 } |
76 | 76 |
77 // If |reboot_on_shutdown| is true, the reboot button becomes visible | 77 // If |reboot_on_shutdown| is true, the reboot button becomes visible |
78 // and the shutdown button is hidden. Vice versa if |reboot_on_shutdown| is | 78 // and the shutdown button is hidden. Vice versa if |reboot_on_shutdown| is |
79 // false. | 79 // false. |
80 void UpdateShutdownAndRebootVisibility(bool reboot_on_shutdown); | 80 void UpdateShutdownAndRebootVisibility(bool reboot_on_shutdown); |
81 | 81 |
82 private: | 82 private: |
83 // Calls javascript method. | |
84 // | |
85 // Note that the Args template parameter pack should consist of types | |
86 // convertible to base::Value. | |
87 template <typename... Args> | |
88 void ExecuteDeferredJSCall(const std::string& function_name, | |
89 std::unique_ptr<Args>... args); | |
90 | |
91 // Calls javascript method if the instance is already initialized, or defers | |
92 // the call until it gets initialized. | |
93 template <typename... Args> | |
94 void CallJSOrDefer(const std::string& function_name, const Args&... args); | |
95 | |
96 // Executes javascript calls that were deferred while the instance was not | |
97 // initialized yet. | |
98 void ExecuteDeferredJSCalls(); | |
99 | |
100 // CoreOobeActor implementation: | 83 // CoreOobeActor implementation: |
101 void ShowSignInError(int login_attempts, | 84 void ShowSignInError(int login_attempts, |
102 const std::string& error_text, | 85 const std::string& error_text, |
103 const std::string& help_link_text, | 86 const std::string& help_link_text, |
104 HelpAppLauncher::HelpTopic help_topic_id) override; | 87 HelpAppLauncher::HelpTopic help_topic_id) override; |
105 void ShowTpmError() override; | 88 void ShowTpmError() override; |
106 void ShowSignInUI(const std::string& email) override; | 89 void ShowSignInUI(const std::string& email) override; |
107 void ResetSignInUI(bool force_online) override; | 90 void ResetSignInUI(bool force_online) override; |
108 void ClearUserPodPassword() override; | 91 void ClearUserPodPassword() override; |
109 void RefocusCurrentPod() override; | 92 void RefocusCurrentPod() override; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Updates the device requisition string on the UI side. | 144 // Updates the device requisition string on the UI side. |
162 void UpdateDeviceRequisition(); | 145 void UpdateDeviceRequisition(); |
163 | 146 |
164 // Updates client area size based on the primary screen size. | 147 // Updates client area size based on the primary screen size. |
165 void UpdateClientAreaSize(); | 148 void UpdateClientAreaSize(); |
166 | 149 |
167 // Notification of a change in the accessibility settings. | 150 // Notification of a change in the accessibility settings. |
168 void OnAccessibilityStatusChanged( | 151 void OnAccessibilityStatusChanged( |
169 const AccessibilityStatusEventDetails& details); | 152 const AccessibilityStatusEventDetails& details); |
170 | 153 |
171 // Whether the instance is initialized. | |
172 // | |
173 // The instance becomes initialized after the corresponding message is | |
174 // received from javascript side. | |
175 bool is_initialized_ = false; | |
176 | |
177 // Javascript calls that have been deferred while the instance was not | |
178 // initialized yet. | |
179 std::vector<base::Closure> deferred_js_calls_; | |
180 | |
181 // Owner of this handler. | 154 // Owner of this handler. |
182 OobeUI* oobe_ui_ = nullptr; | 155 OobeUI* oobe_ui_ = nullptr; |
183 | 156 |
184 // True if we should show OOBE instead of login. | 157 // True if we should show OOBE instead of login. |
185 bool show_oobe_ui_ = false; | 158 bool show_oobe_ui_ = false; |
186 | 159 |
187 // Updates when version info is changed. | 160 // Updates when version info is changed. |
188 VersionInfoUpdater version_info_updater_; | 161 VersionInfoUpdater version_info_updater_; |
189 | 162 |
190 // Help application used for help dialogs. | 163 // Help application used for help dialogs. |
191 scoped_refptr<HelpAppLauncher> help_app_; | 164 scoped_refptr<HelpAppLauncher> help_app_; |
192 | 165 |
193 Delegate* delegate_ = nullptr; | 166 Delegate* delegate_ = nullptr; |
194 | 167 |
195 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; | 168 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; |
196 | 169 |
197 DemoModeDetector demo_mode_detector_; | 170 DemoModeDetector demo_mode_detector_; |
198 | 171 |
199 keyboard::ScopedKeyboardDisabler scoped_keyboard_disabler_; | 172 keyboard::ScopedKeyboardDisabler scoped_keyboard_disabler_; |
200 | 173 |
201 DISALLOW_COPY_AND_ASSIGN(CoreOobeHandler); | 174 DISALLOW_COPY_AND_ASSIGN(CoreOobeHandler); |
202 }; | 175 }; |
203 | 176 |
204 } // namespace chromeos | 177 } // namespace chromeos |
205 | 178 |
206 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_ | 179 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_ |
OLD | NEW |