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_DROPDOWN_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/chromeos/status/network_menu.h" | 9 #include "chrome/browser/chromeos/status/network_menu.h" |
10 #include "chrome/browser/chromeos/status/network_menu_icon.h" | 10 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
11 #include "chrome/browser/chromeos/cros/network_library.h" | 11 #include "chrome/browser/chromeos/cros/network_library.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "chrome/browser/chromeos/login/login_html_dialog.h" | 13 #include "chrome/browser/chromeos/login/login_html_dialog.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 class NetworkMenuWebUI; | 17 class NetworkMenuWebUI; |
18 | 18 |
19 // Class which implements network dropdown menu using WebUI. | 19 // Class which implements network dropdown menu using WebUI. |
20 class NetworkDropdown : public NetworkMenu::Delegate, | 20 class NetworkDropdown : public NetworkMenu::Delegate, |
21 public NetworkMenuIcon::Delegate, | 21 public NetworkMenuIcon::Delegate, |
22 NetworkLibrary::NetworkManagerObserver, | 22 NetworkLibrary::NetworkManagerObserver, |
23 public LoginHtmlDialog::Delegate { | 23 public LoginHtmlDialog::Delegate { |
24 public: | 24 public: |
25 NetworkDropdown(WebUI* web_ui, gfx::NativeWindow parent_window, bool oobe); | 25 NetworkDropdown(WebUI* web_ui, bool oobe); |
26 virtual ~NetworkDropdown(); | 26 virtual ~NetworkDropdown(); |
27 | 27 |
28 // Sets last active network type. Used to show correct disconnected icon. | 28 // Sets last active network type. Used to show correct disconnected icon. |
29 void SetLastNetworkType(ConnectionType last_network_type); | 29 void SetLastNetworkType(ConnectionType last_network_type); |
30 | 30 |
31 // This method should be called, when item with the given id is chosen. | 31 // This method should be called, when item with the given id is chosen. |
32 void OnItemChosen(int id); | 32 void OnItemChosen(int id); |
33 | 33 |
34 // NetworkMenu::Delegate implementation: | 34 // NetworkMenu::Delegate implementation: |
35 virtual views::MenuButton* GetMenuButton() OVERRIDE; | 35 virtual views::MenuButton* GetMenuButton() OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
48 // Should be called on language change. | 48 // Should be called on language change. |
49 void Refresh(); | 49 void Refresh(); |
50 | 50 |
51 protected: | 51 protected: |
52 // LoginHtmlDialog::Delegate implementation: | 52 // LoginHtmlDialog::Delegate implementation: |
53 virtual void OnDialogClosed() OVERRIDE; | 53 virtual void OnDialogClosed() OVERRIDE; |
54 | 54 |
55 private: | 55 private: |
56 void SetNetworkIconAndText(); | 56 void SetNetworkIconAndText(); |
57 | 57 |
58 gfx::NativeWindow parent_window_; | |
59 | |
60 // The Network menu. | 58 // The Network menu. |
61 scoped_ptr<NetworkMenuWebUI> network_menu_; | 59 scoped_ptr<NetworkMenuWebUI> network_menu_; |
62 // The Network menu icon. | 60 // The Network menu icon. |
63 scoped_ptr<NetworkMenuIcon> network_icon_; | 61 scoped_ptr<NetworkMenuIcon> network_icon_; |
64 // Proxy settings dialog that can be invoked from network menu. | 62 // Proxy settings dialog that can be invoked from network menu. |
65 scoped_ptr<LoginHtmlDialog> proxy_settings_dialog_; | 63 scoped_ptr<LoginHtmlDialog> proxy_settings_dialog_; |
66 | 64 |
67 WebUI* web_ui_; | 65 WebUI* web_ui_; |
68 | 66 |
69 // Is the dropdown shown on one of the OOBE screens. | 67 // Is the dropdown shown on one of the OOBE screens. |
70 bool oobe_; | 68 bool oobe_; |
71 | 69 |
72 DISALLOW_COPY_AND_ASSIGN(NetworkDropdown); | 70 DISALLOW_COPY_AND_ASSIGN(NetworkDropdown); |
73 }; | 71 }; |
74 | 72 |
75 } // namespace chromeos | 73 } // namespace chromeos |
76 | 74 |
77 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ | 75 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ |
OLD | NEW |