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 #include "extensions/browser/api/networking_private/networking_private_linux.h" | 5 #include "extensions/browser/api/networking_private/networking_private_linux.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 network_map_.swap(network_map); | 637 network_map_.swap(network_map); |
638 SendNetworkListChangedEvent(*network_list); | 638 SendNetworkListChangedEvent(*network_list); |
639 } | 639 } |
640 | 640 |
641 void NetworkingPrivateLinux::SendNetworkListChangedEvent( | 641 void NetworkingPrivateLinux::SendNetworkListChangedEvent( |
642 const base::ListValue& network_list) { | 642 const base::ListValue& network_list) { |
643 GuidList guidsForEventCallback; | 643 GuidList guidsForEventCallback; |
644 | 644 |
645 for (const auto& network : network_list) { | 645 for (const auto& network : network_list) { |
646 std::string guid; | 646 std::string guid; |
647 base::DictionaryValue* dict; | 647 const base::DictionaryValue* dict; |
648 if (network->GetAsDictionary(&dict)) { | 648 if (network.GetAsDictionary(&dict)) { |
649 if (dict->GetString(kAccessPointInfoGuid, &guid)) { | 649 if (dict->GetString(kAccessPointInfoGuid, &guid)) { |
650 guidsForEventCallback.push_back(guid); | 650 guidsForEventCallback.push_back(guid); |
651 } | 651 } |
652 } | 652 } |
653 } | 653 } |
654 | 654 |
655 OnNetworkListChangedEventOnUIThread(guidsForEventCallback); | 655 OnNetworkListChangedEventOnUIThread(guidsForEventCallback); |
656 } | 656 } |
657 | 657 |
658 bool NetworkingPrivateLinux::GetNetworkDevices( | 658 bool NetworkingPrivateLinux::GetNetworkDevices( |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 base::Unretained(this), base::Passed(&guid_list))); | 1203 base::Unretained(this), base::Passed(&guid_list))); |
1204 } | 1204 } |
1205 | 1205 |
1206 void NetworkingPrivateLinux::OnNetworksChangedEventTask( | 1206 void NetworkingPrivateLinux::OnNetworksChangedEventTask( |
1207 std::unique_ptr<GuidList> guid_list) { | 1207 std::unique_ptr<GuidList> guid_list) { |
1208 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 1208 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
1209 OnNetworksChangedEventOnUIThread(*guid_list); | 1209 OnNetworksChangedEventOnUIThread(*guid_list); |
1210 } | 1210 } |
1211 | 1211 |
1212 } // namespace extensions | 1212 } // namespace extensions |
OLD | NEW |