| 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 #include "ash/system/network/network_list.h" | 5 #include "ash/system/network/network_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/strings/grit/ash_strings.h" | 9 #include "ash/strings/grit/ash_strings.h" |
| 10 #include "ash/system/network/network_icon.h" | 10 #include "ash/system/network/network_icon.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 CHECK(container()); | 301 CHECK(container()); |
| 302 | 302 |
| 303 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); | 303 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
| 304 | 304 |
| 305 NetworkStateHandler::NetworkStateList network_list; | 305 NetworkStateHandler::NetworkStateList network_list; |
| 306 handler->GetVisibleNetworkList(&network_list); | 306 handler->GetVisibleNetworkList(&network_list); |
| 307 UpdateNetworks(network_list); | 307 UpdateNetworks(network_list); |
| 308 | 308 |
| 309 // Add Tether networks. | 309 // Add Tether networks. |
| 310 NetworkStateHandler::NetworkStateList tether_network_list; | 310 NetworkStateHandler::NetworkStateList tether_network_list; |
| 311 handler->GetTetherNetworkList(0 /* no limit */, &tether_network_list); | 311 handler->GetVisibleNetworkListByType(NetworkTypePattern::Tether(), |
| 312 &tether_network_list); |
| 312 for (const auto* tether_network : tether_network_list) { | 313 for (const auto* tether_network : tether_network_list) { |
| 313 network_list_.push_back( | 314 network_list_.push_back( |
| 314 base::MakeUnique<NetworkInfo>(tether_network->guid())); | 315 base::MakeUnique<NetworkInfo>(tether_network->guid())); |
| 315 } | 316 } |
| 316 | 317 |
| 317 UpdateNetworkIcons(); | 318 UpdateNetworkIcons(); |
| 318 OrderNetworks(); | 319 OrderNetworks(); |
| 319 UpdateNetworkListInternal(); | 320 UpdateNetworkListInternal(); |
| 320 } | 321 } |
| 321 | 322 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 if (found == last_network_info_map_.end()) { | 675 if (found == last_network_info_map_.end()) { |
| 675 // If we cannot find |info| in |last_network_info_map_|, just return true | 676 // If we cannot find |info| in |last_network_info_map_|, just return true |
| 676 // since this is a new network so we have nothing to compare. | 677 // since this is a new network so we have nothing to compare. |
| 677 return true; | 678 return true; |
| 678 } else { | 679 } else { |
| 679 return *found->second != info; | 680 return *found->second != info; |
| 680 } | 681 } |
| 681 } | 682 } |
| 682 | 683 |
| 683 } // namespace ash | 684 } // namespace ash |
| OLD | NEW |