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_BASE_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_SCREEN_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_SCREEN_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 virtual ~BaseScreenHandler(); | 87 virtual ~BaseScreenHandler(); |
88 | 88 |
89 // Gets localized strings to be used on the page. | 89 // Gets localized strings to be used on the page. |
90 void GetLocalizedStrings( | 90 void GetLocalizedStrings( |
91 base::DictionaryValue* localized_strings); | 91 base::DictionaryValue* localized_strings); |
92 | 92 |
93 // This method is called when page is ready. It propagates to inherited class | 93 // This method is called when page is ready. It propagates to inherited class |
94 // via virtual Initialize() method (see below). | 94 // via virtual Initialize() method (see below). |
95 void InitializeBase(); | 95 void InitializeBase(); |
96 | 96 |
| 97 void set_async_assets_load_id(const std::string& async_assets_load_id) { |
| 98 async_assets_load_id_ = async_assets_load_id; |
| 99 } |
| 100 const std::string& async_assets_load_id() const { |
| 101 return async_assets_load_id_; |
| 102 } |
| 103 |
97 protected: | 104 protected: |
98 // All subclasses should implement this method to provide localized values. | 105 // All subclasses should implement this method to provide localized values. |
99 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) = 0; | 106 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) = 0; |
100 | 107 |
101 // Subclasses can override these methods to pass additional parameters | 108 // Subclasses can override these methods to pass additional parameters |
102 // to loadTimeData. Generally, it is a bad approach, and it should be replaced | 109 // to loadTimeData. Generally, it is a bad approach, and it should be replaced |
103 // with Context at some point. | 110 // with Context at some point. |
104 virtual void GetAdditionalParameters(base::DictionaryValue* parameters); | 111 virtual void GetAdditionalParameters(base::DictionaryValue* parameters); |
105 | 112 |
106 // Shortcut for calling JS methods on WebUI side. | 113 // Shortcut for calling JS methods on WebUI side. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Keeps whether page is ready. | 221 // Keeps whether page is ready. |
215 bool page_is_ready_; | 222 bool page_is_ready_; |
216 | 223 |
217 base::DictionaryValue* localized_values_; | 224 base::DictionaryValue* localized_values_; |
218 | 225 |
219 // Full name of the corresponding JS screen object. Can be empty, if | 226 // Full name of the corresponding JS screen object. Can be empty, if |
220 // there are no corresponding screen object or several different | 227 // there are no corresponding screen object or several different |
221 // objects. | 228 // objects. |
222 std::string js_screen_path_prefix_; | 229 std::string js_screen_path_prefix_; |
223 | 230 |
| 231 // The string id used in the async asset load in JS. If it is set to a |
| 232 // non empty value, the Initialize will be deferred until the underlying load |
| 233 // is finished. |
| 234 std::string async_assets_load_id_; |
| 235 |
224 DISALLOW_COPY_AND_ASSIGN(BaseScreenHandler); | 236 DISALLOW_COPY_AND_ASSIGN(BaseScreenHandler); |
225 }; | 237 }; |
226 | 238 |
227 } // namespace chromeos | 239 } // namespace chromeos |
228 | 240 |
229 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_SCREEN_HANDLER_H_ | 241 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_BASE_SCREEN_HANDLER_H_ |
OLD | NEW |