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