| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" | 10 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace chromeos { | 21 namespace chromeos { |
| 22 | 22 |
| 23 class NetworkMenuWebUI; | 23 class NetworkMenuWebUI; |
| 24 class NetworkState; | 24 class NetworkState; |
| 25 | 25 |
| 26 // Class which implements network dropdown menu using WebUI. | 26 // Class which implements network dropdown menu using WebUI. |
| 27 class NetworkDropdown : public NetworkMenu::Delegate, | 27 class NetworkDropdown : public NetworkMenu::Delegate, |
| 28 public NetworkStateHandlerObserver, | 28 public NetworkStateHandlerObserver, |
| 29 public ash::network_icon::AnimationObserver { | 29 public ash::network_icon::AnimationObserver { |
| 30 public: | 30 public: |
| 31 class Actor { | 31 class View { |
| 32 public: | 32 public: |
| 33 virtual ~Actor() {} | 33 virtual ~View() {} |
| 34 virtual void OnConnectToNetworkRequested() = 0; | 34 virtual void OnConnectToNetworkRequested() = 0; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 NetworkDropdown(Actor* actor, content::WebUI* web_ui, bool oobe); | 37 NetworkDropdown(View* view, content::WebUI* web_ui, bool oobe); |
| 38 ~NetworkDropdown() override; | 38 ~NetworkDropdown() override; |
| 39 | 39 |
| 40 // This method should be called, when item with the given id is chosen. | 40 // This method should be called, when item with the given id is chosen. |
| 41 void OnItemChosen(int id); | 41 void OnItemChosen(int id); |
| 42 | 42 |
| 43 // NetworkMenu::Delegate | 43 // NetworkMenu::Delegate |
| 44 gfx::NativeWindow GetNativeWindow() const override; | 44 gfx::NativeWindow GetNativeWindow() const override; |
| 45 void OpenButtonOptions() override; | 45 void OpenButtonOptions() override; |
| 46 bool ShouldOpenButtonOptions() const override; | 46 bool ShouldOpenButtonOptions() const override; |
| 47 void OnConnectToNetworkRequested() override; | 47 void OnConnectToNetworkRequested() override; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 62 private: | 62 private: |
| 63 void SetNetworkIconAndText(); | 63 void SetNetworkIconAndText(); |
| 64 | 64 |
| 65 // Request a network scan and refreshes control state. Should be called | 65 // Request a network scan and refreshes control state. Should be called |
| 66 // by |network_scan_timer_| only. | 66 // by |network_scan_timer_| only. |
| 67 void RequestNetworkScan(); | 67 void RequestNetworkScan(); |
| 68 | 68 |
| 69 // The Network menu. | 69 // The Network menu. |
| 70 std::unique_ptr<NetworkMenuWebUI> network_menu_; | 70 std::unique_ptr<NetworkMenuWebUI> network_menu_; |
| 71 | 71 |
| 72 Actor* actor_; | 72 View* view_; |
| 73 | 73 |
| 74 content::WebUI* web_ui_; | 74 content::WebUI* web_ui_; |
| 75 | 75 |
| 76 // Is the dropdown shown on one of the OOBE screens. | 76 // Is the dropdown shown on one of the OOBE screens. |
| 77 bool oobe_; | 77 bool oobe_; |
| 78 | 78 |
| 79 // Timer used to periodically force network scan. | 79 // Timer used to periodically force network scan. |
| 80 base::RepeatingTimer network_scan_timer_; | 80 base::RepeatingTimer network_scan_timer_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(NetworkDropdown); | 82 DISALLOW_COPY_AND_ASSIGN(NetworkDropdown); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace chromeos | 85 } // namespace chromeos |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ | 87 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_H_ |
| OLD | NEW |