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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 return ParseNetworkGuid(guid, &unused_1, &unused_2, ssid); | 76 return ParseNetworkGuid(guid, &unused_1, &unused_2, ssid); |
77 } | 77 } |
78 | 78 |
79 // Iterates over the map cloning the contained networks to a | 79 // Iterates over the map cloning the contained networks to a |
80 // list then returns the list. | 80 // list then returns the list. |
81 std::unique_ptr<base::ListValue> CopyNetworkMapToList( | 81 std::unique_ptr<base::ListValue> CopyNetworkMapToList( |
82 const NetworkingPrivateLinux::NetworkMap& network_map) { | 82 const NetworkingPrivateLinux::NetworkMap& network_map) { |
83 std::unique_ptr<base::ListValue> network_list(new base::ListValue); | 83 std::unique_ptr<base::ListValue> network_list(new base::ListValue); |
84 | 84 |
85 for (const auto& network : network_map) { | 85 for (const auto& network : network_map) { |
86 network_list->Append(network.second->DeepCopy()); | 86 network_list->Append(network.second->CreateDeepCopy()); |
87 } | 87 } |
88 | 88 |
89 return network_list; | 89 return network_list; |
90 } | 90 } |
91 | 91 |
92 // Constructs a network guid from its constituent parts. | 92 // Constructs a network guid from its constituent parts. |
93 std::string ConstructNetworkGuid(const dbus::ObjectPath& device_path, | 93 std::string ConstructNetworkGuid(const dbus::ObjectPath& device_path, |
94 const dbus::ObjectPath& access_point_path, | 94 const dbus::ObjectPath& access_point_path, |
95 const std::string& ssid) { | 95 const std::string& ssid) { |
96 return device_path.value() + "|" + access_point_path.value() + "|" + ssid; | 96 return device_path.value() + "|" + access_point_path.value() + "|" + ssid; |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 base::Unretained(this), base::Passed(&guid_list))); | 1199 base::Unretained(this), base::Passed(&guid_list))); |
1200 } | 1200 } |
1201 | 1201 |
1202 void NetworkingPrivateLinux::OnNetworksChangedEventTask( | 1202 void NetworkingPrivateLinux::OnNetworksChangedEventTask( |
1203 std::unique_ptr<GuidList> guid_list) { | 1203 std::unique_ptr<GuidList> guid_list) { |
1204 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 1204 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
1205 OnNetworksChangedEventOnUIThread(*guid_list); | 1205 OnNetworksChangedEventOnUIThread(*guid_list); |
1206 } | 1206 } |
1207 | 1207 |
1208 } // namespace extensions | 1208 } // namespace extensions |
OLD | NEW |