OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BASE_WEBUI_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_WEBUI_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_WEBUI_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_WEBUI_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 OobeScreen GetCurrentScreen() const; | 218 OobeScreen GetCurrentScreen() const; |
219 | 219 |
220 // Whether page is ready. | 220 // Whether page is ready. |
221 bool page_is_ready() const { return page_is_ready_; } | 221 bool page_is_ready() const { return page_is_ready_; } |
222 | 222 |
223 // Returns the window which shows us. | 223 // Returns the window which shows us. |
224 virtual gfx::NativeWindow GetNativeWindow(); | 224 virtual gfx::NativeWindow GetNativeWindow(); |
225 | 225 |
226 void SetBaseScreen(BaseScreen* base_screen); | 226 void SetBaseScreen(BaseScreen* base_screen); |
227 | 227 |
228 // Returns true if JS side has sent a screenStateInitialize event. | |
229 // TODO(jdufault): Remove after resolving crbug.com/699798 | |
230 bool is_js_initialized_and_ready() const { | |
231 return js_calls_container_->is_initialized(); | |
232 } | |
233 | |
234 private: | 228 private: |
235 // Calls Javascript method. | 229 // Calls Javascript method. |
236 // | 230 // |
237 // Note that the Args template parameter pack should consist of types | 231 // Note that the Args template parameter pack should consist of types |
238 // convertible to base::Value. | 232 // convertible to base::Value. |
239 template <typename... Args> | 233 template <typename... Args> |
240 void ExecuteDeferredJSCall(const std::string& function_name, | 234 void ExecuteDeferredJSCall(const std::string& function_name, |
241 std::unique_ptr<Args>... args) { | 235 std::unique_ptr<Args>... args) { |
242 CallJS(function_name, *args...); | 236 CallJS(function_name, *args...); |
243 } | 237 } |
(...skipping 27 matching lines...) Expand all Loading... |
271 base::DictionaryValue pending_context_changes_; | 265 base::DictionaryValue pending_context_changes_; |
272 | 266 |
273 JSCallsContainer* js_calls_container_ = nullptr; // non-owning pointers. | 267 JSCallsContainer* js_calls_container_ = nullptr; // non-owning pointers. |
274 | 268 |
275 DISALLOW_COPY_AND_ASSIGN(BaseWebUIHandler); | 269 DISALLOW_COPY_AND_ASSIGN(BaseWebUIHandler); |
276 }; | 270 }; |
277 | 271 |
278 } // namespace chromeos | 272 } // namespace chromeos |
279 | 273 |
280 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_WEBUI_HANDLER_H_ | 274 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_WEBUI_HANDLER_H_ |
OLD | NEW |