| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/login/network_screen_actor.h" | 9 #include "chrome/browser/chromeos/login/network_screen_actor.h" |
| 10 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 10 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 11 #include "content/browser/webui/web_ui.h" | 11 #include "content/browser/webui/web_ui.h" |
| 12 #include "ui/gfx/point.h" | 12 #include "ui/gfx/point.h" |
| 13 | 13 |
| 14 namespace base { |
| 14 class ListValue; | 15 class ListValue; |
| 16 } |
| 15 | 17 |
| 16 namespace views { | 18 namespace views { |
| 17 class Widget; | 19 class Widget; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace chromeos { | 22 namespace chromeos { |
| 21 | 23 |
| 22 // WebUI implementation of NetworkScreenActor. It is used to interact with | 24 // WebUI implementation of NetworkScreenActor. It is used to interact with |
| 23 // the welcome screen (part of the page) of the OOBE. | 25 // the welcome screen (part of the page) of the OOBE. |
| 24 class NetworkScreenHandler : public NetworkScreenActor, | 26 class NetworkScreenHandler : public NetworkScreenActor, |
| 25 public OobeMessageHandler { | 27 public OobeMessageHandler { |
| 26 public: | 28 public: |
| 27 NetworkScreenHandler(); | 29 NetworkScreenHandler(); |
| 28 virtual ~NetworkScreenHandler(); | 30 virtual ~NetworkScreenHandler(); |
| 29 | 31 |
| 30 // NetworkScreenActor implementation: | 32 // NetworkScreenActor implementation: |
| 31 virtual void SetDelegate(NetworkScreenActor::Delegate* screen); | 33 virtual void SetDelegate(NetworkScreenActor::Delegate* screen); |
| 32 virtual void PrepareToShow(); | 34 virtual void PrepareToShow(); |
| 33 virtual void Show(); | 35 virtual void Show(); |
| 34 virtual void Hide(); | 36 virtual void Hide(); |
| 35 virtual void ShowError(const string16& message); | 37 virtual void ShowError(const string16& message); |
| 36 virtual void ClearErrors(); | 38 virtual void ClearErrors(); |
| 37 virtual void ShowConnectingStatus(bool connecting, | 39 virtual void ShowConnectingStatus(bool connecting, |
| 38 const string16& network_id); | 40 const string16& network_id); |
| 39 virtual void EnableContinue(bool enabled); | 41 virtual void EnableContinue(bool enabled); |
| 40 | 42 |
| 41 // OobeMessageHandler implementation: | 43 // OobeMessageHandler implementation: |
| 42 virtual void GetLocalizedStrings(DictionaryValue* localized_strings); | 44 virtual void GetLocalizedStrings(base::DictionaryValue* localized_strings); |
| 43 virtual void Initialize(); | 45 virtual void Initialize(); |
| 44 | 46 |
| 45 // WebUIMessageHandler implementation: | 47 // WebUIMessageHandler implementation: |
| 46 virtual void RegisterMessages(); | 48 virtual void RegisterMessages(); |
| 47 | 49 |
| 48 private: | 50 private: |
| 49 // Handles change of the network control position. | 51 // Handles change of the network control position. |
| 50 void HandleNetworkControlPosition(const ListValue* args); | 52 void HandleNetworkControlPosition(const base::ListValue* args); |
| 51 | 53 |
| 52 // Handles moving off the screen. | 54 // Handles moving off the screen. |
| 53 void HandleOnExit(const ListValue* args); | 55 void HandleOnExit(const base::ListValue* args); |
| 54 | 56 |
| 55 // Handles change of the language. | 57 // Handles change of the language. |
| 56 void HandleOnLanguageChanged(const ListValue* args); | 58 void HandleOnLanguageChanged(const base::ListValue* args); |
| 57 | 59 |
| 58 // Handles change of the input method. | 60 // Handles change of the input method. |
| 59 void HandleOnInputMethodChanged(const ListValue* args); | 61 void HandleOnInputMethodChanged(const base::ListValue* args); |
| 60 | 62 |
| 61 // Returns available languages. Caller gets the ownership. Note, it does | 63 // Returns available languages. Caller gets the ownership. Note, it does |
| 62 // depend on the current locale. | 64 // depend on the current locale. |
| 63 static ListValue* GetLanguageList(); | 65 static base::ListValue* GetLanguageList(); |
| 64 | 66 |
| 65 // Returns available input methods. Caller gets the ownership. Note, it does | 67 // Returns available input methods. Caller gets the ownership. Note, it does |
| 66 // depend on the current locale. | 68 // depend on the current locale. |
| 67 static ListValue* GetInputMethods(); | 69 static base::ListValue* GetInputMethods(); |
| 68 | 70 |
| 69 // Creates network window or updates it's bounds. | 71 // Creates network window or updates it's bounds. |
| 70 void CreateOrUpdateNetworkWindow(); | 72 void CreateOrUpdateNetworkWindow(); |
| 71 | 73 |
| 72 // Closes network window. | 74 // Closes network window. |
| 73 void CloseNetworkWindow(); | 75 void CloseNetworkWindow(); |
| 74 | 76 |
| 75 // Window that contains network dropdown button. | 77 // Window that contains network dropdown button. |
| 76 // TODO(nkostylev): Temporary solution till we have | 78 // TODO(nkostylev): Temporary solution till we have |
| 77 // RenderWidgetHostViewViews working. | 79 // RenderWidgetHostViewViews working. |
| 78 views::Widget* network_window_; | 80 views::Widget* network_window_; |
| 79 | 81 |
| 80 NetworkScreenActor::Delegate* screen_; | 82 NetworkScreenActor::Delegate* screen_; |
| 81 | 83 |
| 82 bool is_continue_enabled_; | 84 bool is_continue_enabled_; |
| 83 | 85 |
| 84 // Keeps whether screen should be shown right after initialization. | 86 // Keeps whether screen should be shown right after initialization. |
| 85 bool show_on_init_; | 87 bool show_on_init_; |
| 86 | 88 |
| 87 // Position of the network control. | 89 // Position of the network control. |
| 88 gfx::Point network_control_pos_; | 90 gfx::Point network_control_pos_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); | 92 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace chromeos | 95 } // namespace chromeos |
| 94 | 96 |
| 95 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 97 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| OLD | NEW |