| 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_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/timer.h" | 12 #include "base/timer.h" |
| 13 #include "chrome/browser/chromeos/cros/network_library.h" | 13 #include "chrome/browser/chromeos/cros/network_library.h" |
| 14 #include "chrome/browser/chromeos/login/message_bubble.h" | 14 #include "chrome/browser/chromeos/login/message_bubble.h" |
| 15 #include "chrome/browser/chromeos/mobile_config.h" | 15 #include "chrome/browser/chromeos/mobile_config.h" |
| 16 #include "chrome/browser/chromeos/status/network_menu.h" | 16 #include "chrome/browser/chromeos/status/network_menu.h" |
| 17 #include "chrome/browser/chromeos/status/network_menu_icon.h" | 17 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
| 18 #include "chrome/browser/chromeos/status/status_area_button.h" | 18 #include "chrome/browser/chromeos/status/status_area_button.h" |
| 19 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" |
| 19 | 20 |
| 20 class PrefService; | 21 class PrefService; |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| 23 class Canvas; | 24 class Canvas; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace chromeos { | 27 namespace chromeos { |
| 27 | 28 |
| 28 class StatusAreaHost; | |
| 29 | |
| 30 // The network menu button in the status area. | 29 // The network menu button in the status area. |
| 31 // This class will handle getting the wifi networks and populating the menu. | 30 // This class will handle getting the wifi networks and populating the menu. |
| 32 // It will also handle the status icon changing and connecting to another | 31 // It will also handle the status icon changing and connecting to another |
| 33 // wifi/cellular network. | 32 // wifi/cellular network. |
| 34 // | 33 // |
| 35 // The network menu looks like this: | 34 // The network menu looks like this: |
| 36 // | 35 // |
| 37 // <icon> Ethernet | 36 // <icon> Ethernet |
| 38 // <icon> Wifi Network A | 37 // <icon> Wifi Network A |
| 39 // <icon> Wifi Network B | 38 // <icon> Wifi Network B |
| (...skipping 14 matching lines...) Expand all Loading... |
| 54 class NetworkMenuButton : public StatusAreaButton, | 53 class NetworkMenuButton : public StatusAreaButton, |
| 55 public views::ViewMenuDelegate, | 54 public views::ViewMenuDelegate, |
| 56 public NetworkMenu::Delegate, | 55 public NetworkMenu::Delegate, |
| 57 public NetworkMenuIcon::Delegate, | 56 public NetworkMenuIcon::Delegate, |
| 58 public NetworkLibrary::NetworkDeviceObserver, | 57 public NetworkLibrary::NetworkDeviceObserver, |
| 59 public NetworkLibrary::NetworkManagerObserver, | 58 public NetworkLibrary::NetworkManagerObserver, |
| 60 public NetworkLibrary::NetworkObserver, | 59 public NetworkLibrary::NetworkObserver, |
| 61 public NetworkLibrary::CellularDataPlanObserver, | 60 public NetworkLibrary::CellularDataPlanObserver, |
| 62 public MessageBubbleDelegate { | 61 public MessageBubbleDelegate { |
| 63 public: | 62 public: |
| 64 explicit NetworkMenuButton(StatusAreaHost* host); | 63 explicit NetworkMenuButton(StatusAreaButton::Delegate* delegate, |
| 64 StatusAreaViewChromeos::ScreenMode screen_mode); |
| 65 virtual ~NetworkMenuButton(); | 65 virtual ~NetworkMenuButton(); |
| 66 | 66 |
| 67 static void RegisterPrefs(PrefService* local_state); | 67 static void RegisterPrefs(PrefService* local_state); |
| 68 | 68 |
| 69 // NetworkLibrary::NetworkDeviceObserver implementation. | 69 // NetworkLibrary::NetworkDeviceObserver implementation. |
| 70 virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, | 70 virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, |
| 71 const NetworkDevice* device) OVERRIDE; | 71 const NetworkDevice* device) OVERRIDE; |
| 72 | 72 |
| 73 // NetworkLibrary::NetworkManagerObserver implementation. | 73 // NetworkLibrary::NetworkManagerObserver implementation. |
| 74 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; | 74 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 // Factory for delaying showing promo notification. | 162 // Factory for delaying showing promo notification. |
| 163 base::WeakPtrFactory<NetworkMenuButton> weak_ptr_factory_; | 163 base::WeakPtrFactory<NetworkMenuButton> weak_ptr_factory_; |
| 164 | 164 |
| 165 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); | 165 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace chromeos | 168 } // namespace chromeos |
| 169 | 169 |
| 170 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 170 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
| OLD | NEW |