| 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 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // <icon> will show the strength of the wifi/cellular networks. | 47 // <icon> will show the strength of the wifi/cellular networks. |
| 48 // The label will be BOLD if the network is currently connected. | 48 // The label will be BOLD if the network is currently connected. |
| 49 class NetworkMenuButton : public StatusAreaButton, | 49 class NetworkMenuButton : public StatusAreaButton, |
| 50 public views::ViewMenuDelegate, | 50 public views::ViewMenuDelegate, |
| 51 public NetworkMenu::Delegate, | 51 public NetworkMenu::Delegate, |
| 52 public NetworkMenuIcon::Delegate, | 52 public NetworkMenuIcon::Delegate, |
| 53 public NetworkLibrary::NetworkDeviceObserver, | 53 public NetworkLibrary::NetworkDeviceObserver, |
| 54 public NetworkLibrary::NetworkManagerObserver, | 54 public NetworkLibrary::NetworkManagerObserver, |
| 55 public NetworkLibrary::NetworkObserver, | 55 public NetworkLibrary::NetworkObserver, |
| 56 public NetworkLibrary::CellularDataPlanObserver, | 56 public NetworkLibrary::CellularDataPlanObserver, |
| 57 public MessageBubbleDelegate { | 57 public views::Widget::Observer, |
| 58 public MessageBubbleLinkListener { |
| 58 public: | 59 public: |
| 59 explicit NetworkMenuButton(StatusAreaButton::Delegate* delegate, | 60 explicit NetworkMenuButton(StatusAreaButton::Delegate* delegate, |
| 60 StatusAreaViewChromeos::ScreenMode screen_mode); | 61 StatusAreaViewChromeos::ScreenMode screen_mode); |
| 61 virtual ~NetworkMenuButton(); | 62 virtual ~NetworkMenuButton(); |
| 62 | 63 |
| 63 static void RegisterPrefs(PrefService* local_state); | 64 static void RegisterPrefs(PrefService* local_state); |
| 64 | 65 |
| 65 // NetworkLibrary::NetworkDeviceObserver implementation. | 66 // NetworkLibrary::NetworkDeviceObserver implementation. |
| 66 virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, | 67 virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, |
| 67 const NetworkDevice* device) OVERRIDE; | 68 const NetworkDevice* device) OVERRIDE; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 84 | 85 |
| 85 // NetworkMenuIcon::Delegate implementation: | 86 // NetworkMenuIcon::Delegate implementation: |
| 86 virtual void NetworkMenuIconChanged() OVERRIDE; | 87 virtual void NetworkMenuIconChanged() OVERRIDE; |
| 87 | 88 |
| 88 // views::View | 89 // views::View |
| 89 virtual void OnLocaleChanged() OVERRIDE; | 90 virtual void OnLocaleChanged() OVERRIDE; |
| 90 | 91 |
| 91 // views::ViewMenuDelegate implementation. | 92 // views::ViewMenuDelegate implementation. |
| 92 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; | 93 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; |
| 93 | 94 |
| 94 // MessageBubbleDelegate implementation: | 95 // views::Widget::Observer implementation: |
| 95 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; | 96 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 96 virtual bool CloseOnEscape() OVERRIDE; | 97 |
| 97 virtual bool FadeInOnShow() OVERRIDE; | 98 // MessageBubbleLinkListener implementation: |
| 98 virtual void OnLinkActivated(size_t index) OVERRIDE; | 99 virtual void OnLinkActivated(size_t index) OVERRIDE; |
| 99 | 100 |
| 100 private: | 101 private: |
| 101 // Returns carrier info. | 102 // Returns carrier info. |
| 102 const MobileConfig::Carrier* GetCarrier(NetworkLibrary* cros); | 103 const MobileConfig::Carrier* GetCarrier(NetworkLibrary* cros); |
| 103 | 104 |
| 104 // Returns carrier deal if it's specified and should be shown, | 105 // Returns carrier deal if it's specified and should be shown, |
| 105 // otherwise returns NULL. | 106 // otherwise returns NULL. |
| 106 const MobileConfig::CarrierDeal* GetCarrierDeal( | 107 const MobileConfig::CarrierDeal* GetCarrierDeal( |
| 107 const MobileConfig::Carrier* carrier); | 108 const MobileConfig::Carrier* carrier); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 158 |
| 158 // Factory for delaying showing promo notification. | 159 // Factory for delaying showing promo notification. |
| 159 base::WeakPtrFactory<NetworkMenuButton> weak_ptr_factory_; | 160 base::WeakPtrFactory<NetworkMenuButton> weak_ptr_factory_; |
| 160 | 161 |
| 161 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); | 162 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 } // namespace chromeos | 165 } // namespace chromeos |
| 165 | 166 |
| 166 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 167 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
| OLD | NEW |