| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // A list of available networks of a given type. This class is used for all | 30 // A list of available networks of a given type. This class is used for all |
| 31 // network types except VPNs. For VPNs, see the |VPNList| class. | 31 // network types except VPNs. For VPNs, see the |VPNList| class. |
| 32 class NetworkListView : public NetworkListViewBase, | 32 class NetworkListView : public NetworkListViewBase, |
| 33 public network_icon::AnimationObserver { | 33 public network_icon::AnimationObserver { |
| 34 public: | 34 public: |
| 35 explicit NetworkListView(NetworkListDelegate* delegate); | 35 explicit NetworkListView(NetworkListDelegate* delegate); |
| 36 ~NetworkListView() override; | 36 ~NetworkListView() override; |
| 37 | 37 |
| 38 // NetworkListViewBase: | 38 // NetworkListViewBase: |
| 39 void Update() override; | 39 void Update() override; |
| 40 bool IsNetworkEntry(views::View* view, | 40 bool IsNetworkEntry(views::View* view, std::string* guid) const override; |
| 41 std::string* service_path) const override; | |
| 42 | 41 |
| 43 private: | 42 private: |
| 44 void UpdateNetworks( | 43 void UpdateNetworks( |
| 45 const chromeos::NetworkStateHandler::NetworkStateList& networks); | 44 const chromeos::NetworkStateHandler::NetworkStateList& networks); |
| 46 void UpdateNetworkIcons(); | 45 void UpdateNetworkIcons(); |
| 47 void UpdateNetworkListInternal(); | 46 void UpdateNetworkListInternal(); |
| 48 void HandleRelayout(); | 47 void HandleRelayout(); |
| 49 bool UpdateNetworkListEntries(std::set<std::string>* new_service_paths); | 48 bool UpdateNetworkListEntries(std::set<std::string>* new_guids); |
| 50 bool UpdateNetworkChildren(std::set<std::string>* new_service_paths, | 49 bool UpdateNetworkChildren(std::set<std::string>* new_guids, |
| 51 int* child_index, | 50 int* child_index, |
| 52 bool highlighted); | 51 bool highlighted); |
| 53 bool UpdateNetworkChild(int index, const NetworkInfo* info); | 52 bool UpdateNetworkChild(int index, const NetworkInfo* info); |
| 54 bool PlaceViewAtIndex(views::View* view, int index); | 53 bool PlaceViewAtIndex(views::View* view, int index); |
| 55 bool UpdateInfoLabel(int message_id, int index, views::Label** label); | 54 bool UpdateInfoLabel(int message_id, int index, views::Label** label); |
| 56 | 55 |
| 57 // network_icon::AnimationObserver: | 56 // network_icon::AnimationObserver: |
| 58 void NetworkIconChanged() override; | 57 void NetworkIconChanged() override; |
| 59 | 58 |
| 60 NetworkListDelegate* delegate_; | 59 NetworkListDelegate* delegate_; |
| 61 | 60 |
| 62 views::Label* no_wifi_networks_view_; | 61 views::Label* no_wifi_networks_view_; |
| 63 views::Label* no_cellular_networks_view_; | 62 views::Label* no_cellular_networks_view_; |
| 64 | 63 |
| 65 // An owned list of network info. | 64 // An owned list of network info. |
| 66 std::vector<std::unique_ptr<NetworkInfo>> network_list_; | 65 std::vector<std::unique_ptr<NetworkInfo>> network_list_; |
| 67 | 66 |
| 68 typedef std::map<views::View*, std::string> NetworkMap; | 67 typedef std::map<views::View*, std::string> NetworkMap; |
| 69 NetworkMap network_map_; | 68 NetworkMap network_map_; |
| 70 | 69 |
| 71 // A map of network service paths to their view. | 70 // A map of network guids to their view. |
| 72 typedef std::map<std::string, views::View*> ServicePathMap; | 71 typedef std::map<std::string, views::View*> NetworkGuidMap; |
| 73 ServicePathMap service_path_map_; | 72 NetworkGuidMap network_guid_map_; |
| 74 | 73 |
| 75 DISALLOW_COPY_AND_ASSIGN(NetworkListView); | 74 DISALLOW_COPY_AND_ASSIGN(NetworkListView); |
| 76 }; | 75 }; |
| 77 | 76 |
| 78 } // namespace ash | 77 } // namespace ash |
| 79 | 78 |
| 80 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_H_ | 79 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_H_ |
| OLD | NEW |