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 ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_LIST_DETAILED_VIEW_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_LIST_DETAILED_VIEW_H_ |
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_LIST_DETAILED_VIEW_H_ | 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_LIST_DETAILED_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/system/chromeos/network/network_detailed_view.h" | 10 #include "ash/system/chromeos/network/network_detailed_view.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class NetworkListViewBase; | 25 class NetworkListViewBase; |
26 } | 26 } |
27 | 27 |
28 namespace views { | 28 namespace views { |
29 class BubbleDelegateView; | 29 class BubbleDelegateView; |
30 } | 30 } |
31 | 31 |
32 namespace ash { | 32 namespace ash { |
33 class HoverHighlightView; | 33 class HoverHighlightView; |
34 class SystemTrayItem; | 34 class SystemTrayItem; |
| 35 class ThrobberView; |
35 class TrayPopupLabelButton; | 36 class TrayPopupLabelButton; |
36 | 37 |
37 namespace tray { | 38 namespace tray { |
38 | 39 |
39 class NetworkStateListDetailedView | 40 class NetworkStateListDetailedView |
40 : public NetworkDetailedView, | 41 : public NetworkDetailedView, |
41 public views::ButtonListener, | 42 public views::ButtonListener, |
42 public ViewClickListener, | 43 public ViewClickListener, |
43 public ui::NetworkListDelegate, | 44 public ui::NetworkListDelegate, |
44 public base::SupportsWeakPtr<NetworkStateListDetailedView> { | 45 public base::SupportsWeakPtr<NetworkStateListDetailedView> { |
45 public: | 46 public: |
46 enum ListType { LIST_TYPE_NETWORK, LIST_TYPE_VPN }; | 47 enum ListType { LIST_TYPE_NETWORK, LIST_TYPE_VPN }; |
47 | 48 |
48 NetworkStateListDetailedView(SystemTrayItem* owner, | 49 NetworkStateListDetailedView(SystemTrayItem* owner, |
49 ListType list_type, | 50 ListType list_type, |
50 user::LoginStatus login); | 51 user::LoginStatus login); |
51 ~NetworkStateListDetailedView() override; | 52 ~NetworkStateListDetailedView() override; |
52 | 53 |
53 // Overridden from NetworkDetailedView: | 54 // Overridden from NetworkDetailedView: |
54 void Init() override; | 55 void Init() override; |
55 DetailedViewType GetViewType() const override; | 56 DetailedViewType GetViewType() const override; |
56 void Update() override; | 57 void Update() override; |
57 | 58 |
| 59 // Called by the WiFi Scanning Throbber when pressed. |
| 60 bool ThrobberPressed(views::View* sender, const ui::Event& event); |
| 61 |
58 protected: | 62 protected: |
59 // Overridden from ButtonListener. | 63 // Overridden from ButtonListener. |
60 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 64 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
61 | 65 |
62 // Overridden from ViewClickListener. | 66 // Overridden from ViewClickListener. |
63 void OnViewClicked(views::View* sender) override; | 67 void OnViewClicked(views::View* sender) override; |
64 | 68 |
65 private: | 69 private: |
66 class InfoBubble; | 70 class InfoBubble; |
67 | 71 |
68 // Create UI components. | 72 // Create UI components. |
69 void CreateHeaderEntry(); | 73 void CreateHeaderEntry(); |
70 void CreateHeaderButtons(); | |
71 void CreateNetworkExtra(); | 74 void CreateNetworkExtra(); |
72 | 75 |
73 // Update UI components. | 76 // Update UI components. |
74 void UpdateHeaderButtons(); | 77 void UpdateHeaderButtons(); |
75 void UpdateTechnologyButton(TrayPopupHeaderButton* button, | 78 void UpdateTechnologyButton(TrayPopupHeaderButton* button, |
76 const chromeos::NetworkTypePattern& technology); | 79 const chromeos::NetworkTypePattern& technology); |
77 | 80 |
78 void UpdateNetworkList(); | 81 void UpdateNetworkList(); |
79 | 82 |
80 bool OrderChild(views::View* view, int index); | 83 bool OrderChild(views::View* view, int index); |
(...skipping 30 matching lines...) Expand all Loading... |
111 const ui::NetworkInfo& info) override; | 114 const ui::NetworkInfo& info) override; |
112 views::Label* CreateInfoLabel() override; | 115 views::Label* CreateInfoLabel() override; |
113 void RelayoutScrollList() override; | 116 void RelayoutScrollList() override; |
114 | 117 |
115 // Type of list (all networks or vpn) | 118 // Type of list (all networks or vpn) |
116 ListType list_type_; | 119 ListType list_type_; |
117 | 120 |
118 // Track login state. | 121 // Track login state. |
119 user::LoginStatus login_; | 122 user::LoginStatus login_; |
120 | 123 |
| 124 // Track WiFi scanning state. |
| 125 bool wifi_scanning_; |
| 126 |
121 // Child views. | 127 // Child views. |
122 TrayPopupHeaderButton* info_icon_; | 128 TrayPopupHeaderButton* info_icon_; |
123 TrayPopupHeaderButton* button_wifi_; | 129 TrayPopupHeaderButton* button_wifi_; |
124 TrayPopupHeaderButton* button_mobile_; | 130 TrayPopupHeaderButton* button_mobile_; |
125 TrayPopupLabelButton* other_wifi_; | 131 TrayPopupLabelButton* other_wifi_; |
126 TrayPopupLabelButton* turn_on_wifi_; | 132 TrayPopupLabelButton* turn_on_wifi_; |
127 TrayPopupLabelButton* other_mobile_; | 133 TrayPopupLabelButton* other_mobile_; |
128 TrayPopupLabelButton* settings_; | 134 TrayPopupLabelButton* settings_; |
129 TrayPopupLabelButton* proxy_settings_; | 135 TrayPopupLabelButton* proxy_settings_; |
130 | 136 |
131 // A small bubble for displaying network info. | 137 // A small bubble for displaying network info. |
132 views::BubbleDelegateView* info_bubble_; | 138 views::BubbleDelegateView* info_bubble_; |
133 | 139 |
| 140 // WiFi scanning throbber. |
| 141 ThrobberView* scanning_throbber_; |
| 142 |
134 gfx::Image controlled_by_extension_icon_; | 143 gfx::Image controlled_by_extension_icon_; |
135 | 144 |
136 scoped_ptr<ui::NetworkListViewBase> network_list_view_; | 145 scoped_ptr<ui::NetworkListViewBase> network_list_view_; |
137 | 146 |
138 DISALLOW_COPY_AND_ASSIGN(NetworkStateListDetailedView); | 147 DISALLOW_COPY_AND_ASSIGN(NetworkStateListDetailedView); |
139 }; | 148 }; |
140 | 149 |
141 } // namespace tray | 150 } // namespace tray |
142 } // namespace ash | 151 } // namespace ash |
143 | 152 |
144 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_LIST_DETAILED_VIEW_H_ | 153 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_LIST_DETAILED_VIEW_H_ |
OLD | NEW |