| OLD | NEW |
| 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_list_view_base.h" | 16 #include "ash/system/network/network_state_list_detailed_view.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "chromeos/network/network_state_handler.h" | 18 #include "chromeos/network/network_state_handler.h" |
| 19 #include "chromeos/network/network_type_pattern.h" | 19 #include "chromeos/network/network_type_pattern.h" |
| 20 #include "ui/gfx/image/image_skia.h" | |
| 21 | 20 |
| 22 namespace views { | 21 namespace views { |
| 23 class Label; | 22 class Label; |
| 24 class Separator; | 23 class Separator; |
| 25 class View; | 24 class View; |
| 26 } | 25 } |
| 27 | 26 |
| 28 namespace ash { | 27 namespace ash { |
| 29 class HoverHighlightView; | 28 class HoverHighlightView; |
| 30 struct NetworkInfo; | |
| 31 class TriView; | 29 class TriView; |
| 32 | 30 |
| 31 namespace tray { |
| 32 |
| 33 // A list of available networks of a given type. This class is used for all | 33 // 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. | 34 // network types except VPNs. For VPNs, see the |VPNList| class. |
| 35 class NetworkListView : public NetworkListViewBase, | 35 class NetworkListView : public NetworkStateListDetailedView, |
| 36 public network_icon::AnimationObserver { | 36 public network_icon::AnimationObserver { |
| 37 public: | 37 public: |
| 38 class SectionHeaderRowView; | 38 class SectionHeaderRowView; |
| 39 | 39 |
| 40 explicit NetworkListView(tray::NetworkStateListDetailedView* detailed_view); | 40 NetworkListView(SystemTrayItem* owner, LoginStatus login); |
| 41 ~NetworkListView() override; | 41 ~NetworkListView() override; |
| 42 | 42 |
| 43 // NetworkListViewBase: | 43 // NetworkStateListDetailedView: |
| 44 void Update() override; | 44 void UpdateNetworkList() override; |
| 45 bool IsNetworkEntry(views::View* view, std::string* guid) const override; | 45 bool IsNetworkEntry(views::View* view, std::string* guid) const override; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // Clears |network_list_| and adds to it |networks| that match |delegate_|'s | 48 // Clears |network_list_| and adds to it |networks| that match |delegate_|'s |
| 49 // network type pattern. | 49 // network type pattern. |
| 50 void UpdateNetworks( | 50 void UpdateNetworks( |
| 51 const chromeos::NetworkStateHandler::NetworkStateList& networks); | 51 const chromeos::NetworkStateHandler::NetworkStateList& networks); |
| 52 | 52 |
| 53 // Updates |network_list_| entries and sets |this| to observe network icon | 53 // Updates |network_list_| entries and sets |this| to observe network icon |
| 54 // animations when any of the networks are in connecting state. | 54 // animations when any of the networks are in connecting state. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 using NetworkGuidMap = std::map<std::string, HoverHighlightView*>; | 144 using NetworkGuidMap = std::map<std::string, HoverHighlightView*>; |
| 145 NetworkGuidMap network_guid_map_; | 145 NetworkGuidMap network_guid_map_; |
| 146 | 146 |
| 147 // Save a map of network guids to their infos against current |network_list_|. | 147 // Save a map of network guids to their infos against current |network_list_|. |
| 148 using NetworkInfoMap = std::map<std::string, std::unique_ptr<NetworkInfo>>; | 148 using NetworkInfoMap = std::map<std::string, std::unique_ptr<NetworkInfo>>; |
| 149 NetworkInfoMap last_network_info_map_; | 149 NetworkInfoMap last_network_info_map_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(NetworkListView); | 151 DISALLOW_COPY_AND_ASSIGN(NetworkListView); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace tray |
| 154 } // namespace ash | 155 } // namespace ash |
| 155 | 156 |
| 156 #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_H_ | 157 #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_H_ |
| OLD | NEW |