Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: ash/system/network/network_list.h

Issue 2978363002: Revert of Add a row in the network tray to inform users to turn Bluetooth on to enable Tether. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/system/network/network_icon.cc ('k') | ash/system/network/network_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_NETWORK_NETWORK_LIST_H_ 5 #ifndef ASH_SYSTEM_NETWORK_NETWORK_LIST_H_
6 #define ASH_SYSTEM_NETWORK_NETWORK_LIST_H_ 6 #define ASH_SYSTEM_NETWORK_NETWORK_LIST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/system/network/network_icon_animation_observer.h" 14 #include "ash/system/network/network_icon_animation_observer.h"
15 #include "ash/system/network/network_info.h" 15 #include "ash/system/network/network_info.h"
16 #include "ash/system/network/network_state_list_detailed_view.h" 16 #include "ash/system/network/network_state_list_detailed_view.h"
17 #include "ash/system/tray/tray_info_label.h"
18 #include "base/macros.h" 17 #include "base/macros.h"
19 #include "chromeos/network/network_state_handler.h" 18 #include "chromeos/network/network_state_handler.h"
20 #include "chromeos/network/network_type_pattern.h" 19 #include "chromeos/network/network_type_pattern.h"
21 20
22 namespace views { 21 namespace views {
23 class Separator; 22 class Separator;
24 class View; 23 class View;
25 } 24 }
26 25
27 namespace ash { 26 namespace ash {
28 class HoverHighlightView; 27 class HoverHighlightView;
29 class TriView; 28 class TriView;
30 29
31 namespace tray { 30 namespace tray {
32 31
33 // A list of available networks of a given type. This class is used for all 32 // A list of available networks of a given type. This class is used for all
34 // network types except VPNs. For VPNs, see the |VPNList| class. 33 // network types except VPNs. For VPNs, see the |VPNList| class.
35 class NetworkListView : public NetworkStateListDetailedView, 34 class NetworkListView : public NetworkStateListDetailedView,
36 public network_icon::AnimationObserver, 35 public network_icon::AnimationObserver {
37 public TrayInfoLabel::Delegate {
38 public: 36 public:
39 class SectionHeaderRowView; 37 class SectionHeaderRowView;
40 38
41 NetworkListView(SystemTrayItem* owner, LoginStatus login); 39 NetworkListView(SystemTrayItem* owner, LoginStatus login);
42 ~NetworkListView() override; 40 ~NetworkListView() override;
43 41
44 // NetworkStateListDetailedView: 42 // NetworkStateListDetailedView:
45 void UpdateNetworkList() override; 43 void UpdateNetworkList() override;
46 bool IsNetworkEntry(views::View* view, std::string* guid) const override; 44 bool IsNetworkEntry(views::View* view, std::string* guid) const override;
47 45
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void PlaceViewAtIndex(views::View* view, int index); 97 void PlaceViewAtIndex(views::View* view, int index);
100 98
101 // Creates an info label with text specified by |message_id| and adds it to 99 // Creates an info label with text specified by |message_id| and adds it to
102 // |scroll_content()| if necessary or updates the text and reorders the 100 // |scroll_content()| if necessary or updates the text and reorders the
103 // |scroll_content()| placing the info label at |insertion_index|. When 101 // |scroll_content()| placing the info label at |insertion_index|. When
104 // |message_id| is zero removes the |*info_label_ptr| from the 102 // |message_id| is zero removes the |*info_label_ptr| from the
105 // |scroll_content()| and destroys it. |info_label_ptr| is an in/out parameter 103 // |scroll_content()| and destroys it. |info_label_ptr| is an in/out parameter
106 // and is only modified if the info label is created or destroyed. 104 // and is only modified if the info label is created or destroyed.
107 void UpdateInfoLabel(int message_id, 105 void UpdateInfoLabel(int message_id,
108 int insertion_index, 106 int insertion_index,
109 TrayInfoLabel** info_label_ptr); 107 InfoLabel** info_label_ptr);
110 108
111 // Creates a cellular/tether/Wi-Fi header row |view| and adds it to 109 // Creates a cellular/tether/Wi-Fi header row |view| and adds it to
112 // |scroll_content()| if necessary and reorders the |scroll_content()| placing 110 // |scroll_content()| if necessary and reorders the |scroll_content()| placing
113 // the |view| at |child_index|. Returns the index where the next child should 111 // the |view| at |child_index|. Returns the index where the next child should
114 // be inserted, i.e., the index directly after the last inserted child. 112 // be inserted, i.e., the index directly after the last inserted child.
115 int UpdateSectionHeaderRow(chromeos::NetworkTypePattern pattern, 113 int UpdateSectionHeaderRow(chromeos::NetworkTypePattern pattern,
116 bool enabled, 114 bool enabled,
117 int child_index, 115 int child_index,
118 SectionHeaderRowView** view, 116 SectionHeaderRowView** view,
119 views::Separator** separator_view); 117 views::Separator** separator_view);
120 118
121 // TrayInfoLabel::Delegate:
122 void OnLabelClicked(int message_id) override;
123 bool IsLabelClickable(int message_id) const override;
124
125 // network_icon::AnimationObserver: 119 // network_icon::AnimationObserver:
126 void NetworkIconChanged() override; 120 void NetworkIconChanged() override;
127 121
128 // Returns true if the info should be updated to the view for network, 122 // Returns true if the info should be updated to the view for network,
129 // otherwise false. 123 // otherwise false.
130 bool NeedUpdateViewForNetwork(const NetworkInfo& info) const; 124 bool NeedUpdateViewForNetwork(const NetworkInfo& info) const;
131 125
132 bool needs_relayout_; 126 bool needs_relayout_;
133 127
134 TrayInfoLabel* no_wifi_networks_view_; 128 InfoLabel* no_wifi_networks_view_;
135 TrayInfoLabel* no_mobile_networks_view_; 129 InfoLabel* no_mobile_networks_view_;
136 SectionHeaderRowView* mobile_header_view_; 130 SectionHeaderRowView* mobile_header_view_;
137 SectionHeaderRowView* wifi_header_view_; 131 SectionHeaderRowView* wifi_header_view_;
138 views::Separator* mobile_separator_view_; 132 views::Separator* mobile_separator_view_;
139 views::Separator* wifi_separator_view_; 133 views::Separator* wifi_separator_view_;
140 TriView* connection_warning_; 134 TriView* connection_warning_;
141 135
142 // An owned list of network info. 136 // An owned list of network info.
143 std::vector<std::unique_ptr<NetworkInfo>> network_list_; 137 std::vector<std::unique_ptr<NetworkInfo>> network_list_;
144 138
145 using NetworkMap = std::map<views::View*, std::string>; 139 using NetworkMap = std::map<views::View*, std::string>;
146 NetworkMap network_map_; 140 NetworkMap network_map_;
147 141
148 // A map of network guids to their view. 142 // A map of network guids to their view.
149 using NetworkGuidMap = std::map<std::string, HoverHighlightView*>; 143 using NetworkGuidMap = std::map<std::string, HoverHighlightView*>;
150 NetworkGuidMap network_guid_map_; 144 NetworkGuidMap network_guid_map_;
151 145
152 // Save a map of network guids to their infos against current |network_list_|. 146 // Save a map of network guids to their infos against current |network_list_|.
153 using NetworkInfoMap = std::map<std::string, std::unique_ptr<NetworkInfo>>; 147 using NetworkInfoMap = std::map<std::string, std::unique_ptr<NetworkInfo>>;
154 NetworkInfoMap last_network_info_map_; 148 NetworkInfoMap last_network_info_map_;
155 149
156 DISALLOW_COPY_AND_ASSIGN(NetworkListView); 150 DISALLOW_COPY_AND_ASSIGN(NetworkListView);
157 }; 151 };
158 152
159 } // namespace tray 153 } // namespace tray
160 } // namespace ash 154 } // namespace ash
161 155
162 #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_H_ 156 #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_H_
OLDNEW
« no previous file with comments | « ash/system/network/network_icon.cc ('k') | ash/system/network/network_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698