| 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_NETWORK_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/chromeos/login/screens/network_screen_actor.h" | 12 #include "chrome/browser/chromeos/login/screens/network_screen_actor.h" |
| 13 #include "chrome/browser/chromeos/settings/cros_settings.h" | 13 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 14 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 14 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 15 #include "chromeos/ime/component_extension_ime_manager.h" | 15 #include "chromeos/ime/component_extension_ime_manager.h" |
| 16 #include "chromeos/ime/input_method_manager.h" | 16 #include "chromeos/ime/input_method_manager.h" |
| 17 #include "ui/gfx/point.h" | 17 #include "ui/gfx/point.h" |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 class CoreOobeActor; | 21 class CoreOobeActor; |
| 22 class IdleDetector; | 22 class IdleDetector; |
| 23 | 23 |
| 24 struct NetworkScreenHandlerOnLanguageChangedCallbackData; | 24 struct NetworkScreenHandlerOnLanguageChangedCallbackData; |
| 25 | 25 |
| 26 // WebUI implementation of NetworkScreenActor. It is used to interact with | 26 // WebUI implementation of NetworkScreenActor. It is used to interact with |
| 27 // the welcome screen (part of the page) of the OOBE. | 27 // the welcome screen (part of the page) of the OOBE. |
| 28 class NetworkScreenHandler : public NetworkScreenActor, | 28 class NetworkScreenHandler : public NetworkScreenActor, |
| 29 public BaseScreenHandler, | 29 public BaseScreenHandler, |
| 30 public ComponentExtensionIMEManager::Observer, | |
| 31 public input_method::InputMethodManager::Observer { | 30 public input_method::InputMethodManager::Observer { |
| 32 public: | 31 public: |
| 33 explicit NetworkScreenHandler(CoreOobeActor* core_oobe_actor); | 32 explicit NetworkScreenHandler(CoreOobeActor* core_oobe_actor); |
| 34 virtual ~NetworkScreenHandler(); | 33 virtual ~NetworkScreenHandler(); |
| 35 | 34 |
| 36 // NetworkScreenActor implementation: | 35 // NetworkScreenActor implementation: |
| 37 virtual void SetDelegate(NetworkScreenActor::Delegate* screen) OVERRIDE; | 36 virtual void SetDelegate(NetworkScreenActor::Delegate* screen) OVERRIDE; |
| 38 virtual void PrepareToShow() OVERRIDE; | 37 virtual void PrepareToShow() OVERRIDE; |
| 39 virtual void Show() OVERRIDE; | 38 virtual void Show() OVERRIDE; |
| 40 virtual void Hide() OVERRIDE; | 39 virtual void Hide() OVERRIDE; |
| 41 virtual void ShowError(const base::string16& message) OVERRIDE; | 40 virtual void ShowError(const base::string16& message) OVERRIDE; |
| 42 virtual void ClearErrors() OVERRIDE; | 41 virtual void ClearErrors() OVERRIDE; |
| 43 virtual void ShowConnectingStatus(bool connecting, | 42 virtual void ShowConnectingStatus(bool connecting, |
| 44 const base::string16& network_id) OVERRIDE; | 43 const base::string16& network_id) OVERRIDE; |
| 45 virtual void EnableContinue(bool enabled) OVERRIDE; | 44 virtual void EnableContinue(bool enabled) OVERRIDE; |
| 46 | 45 |
| 47 // BaseScreenHandler implementation: | 46 // BaseScreenHandler implementation: |
| 48 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; | 47 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; |
| 49 virtual void GetAdditionalParameters(base::DictionaryValue* dict) OVERRIDE; | 48 virtual void GetAdditionalParameters(base::DictionaryValue* dict) OVERRIDE; |
| 50 virtual void Initialize() OVERRIDE; | 49 virtual void Initialize() OVERRIDE; |
| 51 | 50 |
| 52 // WebUIMessageHandler implementation: | 51 // WebUIMessageHandler implementation: |
| 53 virtual void RegisterMessages() OVERRIDE; | 52 virtual void RegisterMessages() OVERRIDE; |
| 54 | 53 |
| 55 // ComponentExtensionIMEManager::Observer implementation: | |
| 56 virtual void OnImeComponentExtensionInitialized() OVERRIDE; | |
| 57 | |
| 58 // InputMethodManager::Observer implementation: | 54 // InputMethodManager::Observer implementation: |
| 59 virtual void InputMethodChanged(input_method::InputMethodManager* manager, | 55 virtual void InputMethodChanged(input_method::InputMethodManager* manager, |
| 60 bool show_message) OVERRIDE; | 56 bool show_message) OVERRIDE; |
| 61 | 57 |
| 62 // Reloads localized contents. | 58 // Reloads localized contents. |
| 63 void ReloadLocalizedContent(); | 59 void ReloadLocalizedContent(); |
| 64 | 60 |
| 65 private: | 61 private: |
| 66 // Handles moving off the screen. | 62 // Handles moving off the screen. |
| 67 void HandleOnExit(); | 63 void HandleOnExit(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 bool is_continue_enabled_; | 98 bool is_continue_enabled_; |
| 103 | 99 |
| 104 // Keeps whether screen should be shown right after initialization. | 100 // Keeps whether screen should be shown right after initialization. |
| 105 bool show_on_init_; | 101 bool show_on_init_; |
| 106 | 102 |
| 107 // Position of the network control. | 103 // Position of the network control. |
| 108 gfx::Point network_control_pos_; | 104 gfx::Point network_control_pos_; |
| 109 | 105 |
| 110 scoped_ptr<CrosSettings::ObserverSubscription> timezone_subscription_; | 106 scoped_ptr<CrosSettings::ObserverSubscription> timezone_subscription_; |
| 111 | 107 |
| 112 // True if should reinitialize language and keyboard list once the page | |
| 113 // is ready. | |
| 114 bool should_reinitialize_language_keyboard_list_; | |
| 115 | |
| 116 // The exact language code selected by user in the menu. | 108 // The exact language code selected by user in the menu. |
| 117 std::string selected_language_code_; | 109 std::string selected_language_code_; |
| 118 | 110 |
| 119 base::WeakPtrFactory<NetworkScreenHandler> weak_ptr_factory_; | 111 base::WeakPtrFactory<NetworkScreenHandler> weak_ptr_factory_; |
| 120 | 112 |
| 121 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); | 113 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); |
| 122 }; | 114 }; |
| 123 | 115 |
| 124 } // namespace chromeos | 116 } // namespace chromeos |
| 125 | 117 |
| 126 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 118 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| OLD | NEW |