OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 std::string hex_ssid = | 190 std::string hex_ssid = |
191 base::HexEncode(vector_as_array(&raw_ssid), raw_ssid.size()); | 191 base::HexEncode(vector_as_array(&raw_ssid), raw_ssid.size()); |
192 network_info.hex_ssid = make_scoped_ptr(new std::string(hex_ssid)); | 192 network_info.hex_ssid = make_scoped_ptr(new std::string(hex_ssid)); |
193 network_info.ssid = make_scoped_ptr(new std::string(network->name())); | 193 network_info.ssid = make_scoped_ptr(new std::string(network->name())); |
194 network_info.guid = make_scoped_ptr(new std::string(network->guid())); | 194 network_info.guid = make_scoped_ptr(new std::string(network->guid())); |
195 if (bssid) | 195 if (bssid) |
196 network_info.bssid.reset(new std::string(*bssid)); | 196 network_info.bssid.reset(new std::string(*bssid)); |
197 scoped_ptr<base::ListValue> results = | 197 scoped_ptr<base::ListValue> results = |
198 extensions::core_api::networking_config::OnCaptivePortalDetected::Create( | 198 extensions::core_api::networking_config::OnCaptivePortalDetected::Create( |
199 network_info); | 199 network_info); |
200 scoped_ptr<Event> event(new Event(extensions::core_api::networking_config:: | 200 scoped_ptr<Event> event(new Event(events::UNKNOWN, |
| 201 extensions::core_api::networking_config:: |
201 OnCaptivePortalDetected::kEventName, | 202 OnCaptivePortalDetected::kEventName, |
202 results.Pass())); | 203 results.Pass())); |
203 return event.Pass(); | 204 return event.Pass(); |
204 } | 205 } |
205 | 206 |
206 void NetworkingConfigService::DispatchPortalDetectedEvent( | 207 void NetworkingConfigService::DispatchPortalDetectedEvent( |
207 const std::string& extension_id, | 208 const std::string& extension_id, |
208 const std::string& guid, | 209 const std::string& guid, |
209 const base::Closure& authentication_callback) { | 210 const base::Closure& authentication_callback) { |
210 // This dispatch starts a new cycle of portal detection and authentication. | 211 // This dispatch starts a new cycle of portal detection and authentication. |
(...skipping 10 matching lines...) Expand all Loading... |
221 | 222 |
222 network_handler->managed_network_configuration_handler()->GetProperties( | 223 network_handler->managed_network_configuration_handler()->GetProperties( |
223 service_path, base::Bind(&NetworkingConfigService::OnGotProperties, | 224 service_path, base::Bind(&NetworkingConfigService::OnGotProperties, |
224 weak_factory_.GetWeakPtr(), extension_id, guid, | 225 weak_factory_.GetWeakPtr(), extension_id, guid, |
225 authentication_callback), | 226 authentication_callback), |
226 base::Bind(&NetworkingConfigService::OnGetPropertiesFailed, | 227 base::Bind(&NetworkingConfigService::OnGetPropertiesFailed, |
227 weak_factory_.GetWeakPtr(), extension_id, guid)); | 228 weak_factory_.GetWeakPtr(), extension_id, guid)); |
228 } | 229 } |
229 | 230 |
230 } // namespace extensions | 231 } // namespace extensions |
OLD | NEW |