Chromium Code Reviews| 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/extensions/extension_function_registry.h" | 10 #include "chrome/browser/extensions/extension_function_registry.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 NetworkingPrivateGetManagedPropertiesFunction:: | 65 NetworkingPrivateGetManagedPropertiesFunction:: |
| 66 ~NetworkingPrivateGetManagedPropertiesFunction() { | 66 ~NetworkingPrivateGetManagedPropertiesFunction() { |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool NetworkingPrivateGetManagedPropertiesFunction::RunImpl() { | 69 bool NetworkingPrivateGetManagedPropertiesFunction::RunImpl() { |
| 70 scoped_ptr<api::GetManagedProperties::Params> params = | 70 scoped_ptr<api::GetManagedProperties::Params> params = |
| 71 api::GetManagedProperties::Params::Create(*args_); | 71 api::GetManagedProperties::Params::Create(*args_); |
| 72 EXTENSION_FUNCTION_VALIDATE(params); | 72 EXTENSION_FUNCTION_VALIDATE(params); |
| 73 | 73 |
| 74 // TODO(pneubeck): FIX this once the relevant ProfileHelper change is | |
| 75 // committed. | |
|
stevenjb
2013/04/26 21:00:49
crbug? Or fix before committing?
pneubeck (no reviews)
2013/04/29 18:05:51
before committing
| |
| 76 | |
| 77 // The profile of the requesting browser. Profile* | |
| 78 // requesting_profile = profile(); | |
| 79 std::string userhash = "user1"; | |
| 80 | |
| 74 ManagedNetworkConfigurationHandler::Get()->GetManagedProperties( | 81 ManagedNetworkConfigurationHandler::Get()->GetManagedProperties( |
| 82 userhash, | |
| 75 params->network_guid, // service path | 83 params->network_guid, // service path |
| 76 base::Bind(&NetworkingPrivateGetManagedPropertiesFunction::Success, | 84 base::Bind(&NetworkingPrivateGetManagedPropertiesFunction::Success, |
| 77 this), | 85 this), |
| 78 base::Bind(&NetworkingPrivateGetManagedPropertiesFunction::Failure, | 86 base::Bind(&NetworkingPrivateGetManagedPropertiesFunction::Failure, |
| 79 this)); | 87 this)); |
| 80 return true; | 88 return true; |
| 81 } | 89 } |
| 82 | 90 |
| 83 void NetworkingPrivateGetManagedPropertiesFunction::Success( | 91 void NetworkingPrivateGetManagedPropertiesFunction::Success( |
| 84 const std::string& service_path, | 92 const std::string& service_path, |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 const std::string& result) { | 410 const std::string& result) { |
| 403 results_ = api::VerifyAndEncryptData::Results::Create(result); | 411 results_ = api::VerifyAndEncryptData::Results::Create(result); |
| 404 SendResponse(true); | 412 SendResponse(true); |
| 405 } | 413 } |
| 406 | 414 |
| 407 void NetworkingPrivateVerifyAndEncryptDataFunction::ErrorCallback( | 415 void NetworkingPrivateVerifyAndEncryptDataFunction::ErrorCallback( |
| 408 const std::string& error_name, const std::string& error) { | 416 const std::string& error_name, const std::string& error) { |
| 409 error_ = error_name; | 417 error_ = error_name; |
| 410 SendResponse(false); | 418 SendResponse(false); |
| 411 } | 419 } |
| OLD | NEW |