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 "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chromeos/login/network_screen_actor.h" | 10 #include "chrome/browser/chromeos/login/network_screen_actor.h" |
10 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 11 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
11 #include "content/browser/webui/web_ui.h" | 12 #include "content/browser/webui/web_ui.h" |
12 #include "ui/gfx/point.h" | 13 #include "ui/gfx/point.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class ListValue; | 16 class ListValue; |
16 } | 17 } |
17 | 18 |
18 namespace views { | 19 namespace views { |
19 class Widget; | 20 class Widget; |
20 } | 21 } |
21 | 22 |
22 namespace chromeos { | 23 namespace chromeos { |
23 | 24 |
| 25 class NetworkDropdown; |
| 26 |
24 // WebUI implementation of NetworkScreenActor. It is used to interact with | 27 // WebUI implementation of NetworkScreenActor. It is used to interact with |
25 // the welcome screen (part of the page) of the OOBE. | 28 // the welcome screen (part of the page) of the OOBE. |
26 class NetworkScreenHandler : public NetworkScreenActor, | 29 class NetworkScreenHandler : public NetworkScreenActor, |
27 public BaseScreenHandler { | 30 public BaseScreenHandler { |
28 public: | 31 public: |
29 NetworkScreenHandler(); | 32 NetworkScreenHandler(); |
30 virtual ~NetworkScreenHandler(); | 33 virtual ~NetworkScreenHandler(); |
31 | 34 |
32 // NetworkScreenActor implementation: | 35 // NetworkScreenActor implementation: |
33 virtual void SetDelegate(NetworkScreenActor::Delegate* screen); | 36 virtual void SetDelegate(NetworkScreenActor::Delegate* screen); |
(...skipping 19 matching lines...) Expand all Loading... |
53 | 56 |
54 // Handles moving off the screen. | 57 // Handles moving off the screen. |
55 void HandleOnExit(const base::ListValue* args); | 58 void HandleOnExit(const base::ListValue* args); |
56 | 59 |
57 // Handles change of the language. | 60 // Handles change of the language. |
58 void HandleOnLanguageChanged(const base::ListValue* args); | 61 void HandleOnLanguageChanged(const base::ListValue* args); |
59 | 62 |
60 // Handles change of the input method. | 63 // Handles change of the input method. |
61 void HandleOnInputMethodChanged(const base::ListValue* args); | 64 void HandleOnInputMethodChanged(const base::ListValue* args); |
62 | 65 |
| 66 // Handle choosing of the network menu item. |
| 67 void HandleNetworkItemChosen(const base::ListValue* args); |
| 68 |
63 // Returns available languages. Caller gets the ownership. Note, it does | 69 // Returns available languages. Caller gets the ownership. Note, it does |
64 // depend on the current locale. | 70 // depend on the current locale. |
65 static base::ListValue* GetLanguageList(); | 71 static base::ListValue* GetLanguageList(); |
66 | 72 |
67 // Returns available input methods. Caller gets the ownership. Note, it does | 73 // Returns available input methods. Caller gets the ownership. Note, it does |
68 // depend on the current locale. | 74 // depend on the current locale. |
69 static base::ListValue* GetInputMethods(); | 75 static base::ListValue* GetInputMethods(); |
70 | 76 |
71 // Creates network window or updates it's bounds. | 77 scoped_ptr<NetworkDropdown> dropdown_; |
72 void CreateOrUpdateNetworkWindow(); | |
73 | |
74 // Closes network window. | |
75 void CloseNetworkWindow(); | |
76 | |
77 // Window that contains network dropdown button. | |
78 // TODO(nkostylev): Temporary solution till we have | |
79 // RenderWidgetHostViewViews working. | |
80 views::Widget* network_window_; | |
81 | 78 |
82 NetworkScreenActor::Delegate* screen_; | 79 NetworkScreenActor::Delegate* screen_; |
83 | 80 |
84 bool is_continue_enabled_; | 81 bool is_continue_enabled_; |
85 | 82 |
86 // Keeps whether screen should be shown right after initialization. | 83 // Keeps whether screen should be shown right after initialization. |
87 bool show_on_init_; | 84 bool show_on_init_; |
88 | 85 |
89 // Position of the network control. | 86 // Position of the network control. |
90 gfx::Point network_control_pos_; | 87 gfx::Point network_control_pos_; |
91 | 88 |
92 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); | 89 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); |
93 }; | 90 }; |
94 | 91 |
95 } // namespace chromeos | 92 } // namespace chromeos |
96 | 93 |
97 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 94 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
OLD | NEW |