| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/extensions/networking_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/networking_private_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "chrome/browser/chromeos/net/managed_network_configuration_handler.h" | 10 #include "chrome/browser/chromeos/net/managed_network_configuration_handler.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 void ResultList::ServicePropertiesCallback( | 136 void ResultList::ServicePropertiesCallback( |
| 137 const std::string& service_path, | 137 const std::string& service_path, |
| 138 const std::string& network_type, | 138 const std::string& network_type, |
| 139 DBusMethodCallStatus call_status, | 139 DBusMethodCallStatus call_status, |
| 140 const base::DictionaryValue& result) { | 140 const base::DictionaryValue& result) { |
| 141 if (call_status == DBUS_METHOD_CALL_SUCCESS) { | 141 if (call_status == DBUS_METHOD_CALL_SUCCESS) { |
| 142 scoped_ptr<base::DictionaryValue> onc_properties( | 142 scoped_ptr<base::DictionaryValue> onc_properties( |
| 143 onc::TranslateShillServiceToONCPart( | 143 onc::TranslateShillServiceToONCPart( |
| 144 result, | 144 result, |
| 145 &onc::kNetworkConfigurationSignature)); | 145 &onc::kNetworkWithStateSignature)); |
| 146 | 146 |
| 147 scoped_ptr<api::NetworkProperties> filtered_result( | 147 scoped_ptr<api::NetworkProperties> filtered_result( |
| 148 CreateFilteredResult(*onc_properties)); | 148 CreateFilteredResult(*onc_properties)); |
| 149 | 149 |
| 150 std::string onc_type; | 150 std::string onc_type; |
| 151 if (filtered_result->additional_properties.GetString( | 151 if (filtered_result->additional_properties.GetString( |
| 152 onc::network_config::kType, &onc_type) && | 152 onc::network_config::kType, &onc_type) && |
| 153 (onc_type == network_type || | 153 (onc_type == network_type || |
| 154 network_type == onc::network_type::kAllTypes)) { | 154 network_type == onc::network_type::kAllTypes)) { |
| 155 // TODO(gspencer): For now the "GUID" we send back is going to look | 155 // TODO(gspencer): For now the "GUID" we send back is going to look |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 return true; | 199 return true; |
| 200 } | 200 } |
| 201 | 201 |
| 202 void NetworkingPrivateGetPropertiesFunction::ResultCallback( | 202 void NetworkingPrivateGetPropertiesFunction::ResultCallback( |
| 203 const std::string& service_path, | 203 const std::string& service_path, |
| 204 DBusMethodCallStatus call_status, | 204 DBusMethodCallStatus call_status, |
| 205 const base::DictionaryValue& result) { | 205 const base::DictionaryValue& result) { |
| 206 scoped_ptr<base::DictionaryValue> onc_properties( | 206 scoped_ptr<base::DictionaryValue> onc_properties( |
| 207 onc::TranslateShillServiceToONCPart( | 207 onc::TranslateShillServiceToONCPart( |
| 208 result, | 208 result, |
| 209 &onc::kNetworkConfigurationSignature)); | 209 &onc::kNetworkWithStateSignature)); |
| 210 GetPropertiesSuccess(service_path, | 210 GetPropertiesSuccess(service_path, |
| 211 *onc_properties); | 211 *onc_properties); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void NetworkingPrivateGetPropertiesFunction::GetPropertiesSuccess( | 214 void NetworkingPrivateGetPropertiesFunction::GetPropertiesSuccess( |
| 215 const std::string& service_path, | 215 const std::string& service_path, |
| 216 const base::DictionaryValue& dictionary) { | 216 const base::DictionaryValue& dictionary) { |
| 217 scoped_ptr<api::NetworkProperties> filtered_result( | 217 scoped_ptr<api::NetworkProperties> filtered_result( |
| 218 CreateFilteredResult(dictionary)); | 218 CreateFilteredResult(dictionary)); |
| 219 filtered_result->additional_properties.SetStringWithoutPathExpansion( | 219 filtered_result->additional_properties.SetStringWithoutPathExpansion( |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 const std::string& result) { | 448 const std::string& result) { |
| 449 results_ = api::VerifyAndEncryptData::Results::Create(result); | 449 results_ = api::VerifyAndEncryptData::Results::Create(result); |
| 450 SendResponse(true); | 450 SendResponse(true); |
| 451 } | 451 } |
| 452 | 452 |
| 453 void NetworkingPrivateVerifyAndEncryptDataFunction::ErrorCallback( | 453 void NetworkingPrivateVerifyAndEncryptDataFunction::ErrorCallback( |
| 454 const std::string& error_name, const std::string& error) { | 454 const std::string& error_name, const std::string& error) { |
| 455 error_ = error_name; | 455 error_ = error_name; |
| 456 SendResponse(false); | 456 SendResponse(false); |
| 457 } | 457 } |
| OLD | NEW |