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_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 "base/timer.h" |
| 10 #include "chrome/browser/chromeos/cros/network_library.h" |
9 #include "chrome/browser/chromeos/status/network_menu.h" | 11 #include "chrome/browser/chromeos/status/network_menu.h" |
10 #include "chrome/browser/chromeos/status/network_menu_icon.h" | 12 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
11 #include "chrome/browser/chromeos/cros/network_library.h" | |
12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 class WebUI; | 16 class WebUI; |
16 } | 17 } |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 | 20 |
20 class NetworkMenuWebUI; | 21 class NetworkMenuWebUI; |
21 | 22 |
(...skipping 24 matching lines...) Expand all Loading... |
46 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; | 47 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; |
47 | 48 |
48 // Refreshes control state. Usually there's no need to do it manually | 49 // Refreshes control state. Usually there's no need to do it manually |
49 // as control refreshes itself on network state change. | 50 // as control refreshes itself on network state change. |
50 // Should be called on language change. | 51 // Should be called on language change. |
51 void Refresh(); | 52 void Refresh(); |
52 | 53 |
53 private: | 54 private: |
54 void SetNetworkIconAndText(); | 55 void SetNetworkIconAndText(); |
55 | 56 |
| 57 // Forces network scan and refreshes control state. Should be called |
| 58 // by |network_scan_timer_| only. |
| 59 void ForceNetworkScan(); |
| 60 |
56 // The Network menu. | 61 // The Network menu. |
57 scoped_ptr<NetworkMenuWebUI> network_menu_; | 62 scoped_ptr<NetworkMenuWebUI> network_menu_; |
58 // The Network menu icon. | 63 // The Network menu icon. |
59 scoped_ptr<NetworkMenuIcon> network_icon_; | 64 scoped_ptr<NetworkMenuIcon> network_icon_; |
60 | 65 |
61 content::WebUI* web_ui_; | 66 content::WebUI* web_ui_; |
62 | 67 |
63 // Is the dropdown shown on one of the OOBE screens. | 68 // Is the dropdown shown on one of the OOBE screens. |
64 bool oobe_; | 69 bool oobe_; |
65 | 70 |
| 71 // Timer used to periodically force network scan. |
| 72 base::RepeatingTimer<NetworkDropdown> network_scan_timer_; |
| 73 |
66 DISALLOW_COPY_AND_ASSIGN(NetworkDropdown); | 74 DISALLOW_COPY_AND_ASSIGN(NetworkDropdown); |
67 }; | 75 }; |
68 | 76 |
69 } // namespace chromeos | 77 } // namespace chromeos |
70 | 78 |
71 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ | 79 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ |
OLD | NEW |