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