Chromium Code Reviews| Index: chrome/browser/extensions/api/networking_private/networking_private_service_client.h |
| diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client.h b/chrome/browser/extensions/api/networking_private/networking_private_service_client.h |
| index a708fc96e5e4bb3648f4bd71da57e6010250a1d4..e48094fd1319ab5790719ab2b3171701008775f9 100644 |
| --- a/chrome/browser/extensions/api/networking_private/networking_private_service_client.h |
| +++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client.h |
| @@ -11,12 +11,14 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| #include "base/id_map.h" |
| +#include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/observer_list.h" |
| #include "base/strings/string16.h" |
| #include "base/supports_user_data.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| #include "base/values.h" |
| +#include "chrome/browser/extensions/api/networking_private/wifi_passphrase_getter.h" |
| #include "components/browser_context_keyed_service/browser_context_keyed_service.h" |
| #include "components/wifi/wifi_service.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -51,6 +53,12 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService { |
| bool* verified, |
| std::string* error) = 0; |
| + virtual void VerifyAndEncryptCredentials(scoped_ptr<base::ListValue> args, |
|
tbarzic
2014/02/07 19:25:00
first arg to a new line, then align the rest with
mef
2014/02/07 19:53:31
Done.
|
| + std::string* network_guid, |
| + std::string* base64_encoded_public_key, |
| + std::string* base64_encoded_ciphertext, |
| + std::string* error) = 0; |
| + |
| virtual void VerifyAndEncryptData(scoped_ptr<base::ListValue> args, |
| std::string* base64_encoded_ciphertext, |
| std::string* error) = 0; |
| @@ -176,6 +184,13 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService { |
| const CryptoErrorCallback& error_callback); |
| // Verify that Chromecast provides valid cryptographically signed properties. |
| + // If valid, then get WiFi credentials from the system and encrypt them using |
| + // Chromecast's public key. |
| + void VerifyAndEncryptCredentials(scoped_ptr<base::ListValue> args, |
| + const StringResultCallback& callback, |
| + const CryptoErrorCallback& error_callback); |
| + |
| + // Verify that Chromecast provides valid cryptographically signed properties. |
| // If valid, then encrypt data using Chromecast's public key. |
| void VerifyAndEncryptData(scoped_ptr<base::ListValue> args, |
| const StringResultCallback& callback, |
| @@ -207,8 +222,11 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService { |
| BoolResultCallback verify_destination_callback; |
| StringResultCallback verify_and_encrypt_data_callback; |
| + StringResultCallback verify_and_encrypt_credentials_callback; |
| CryptoErrorCallback crypto_error_callback; |
| + scoped_refptr<WiFiPassphraseGetter> wifi_passphrase_getter; |
| + |
| ServiceCallbacksID id; |
| }; |
| typedef IDMap<ServiceCallbacks, IDMapOwnPointer> ServiceCallbacksMap; |
| @@ -234,9 +252,17 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService { |
| void AfterVerifyDestination(ServiceCallbacksID callback_id, |
| const bool* result, |
| const std::string* error); |
| + void AfterVerifyGetWiFiPassword(ServiceCallbacksID callback_id, |
| + const std::string* network_guid, |
| + const std::string* public_key, |
| + const std::string* encrypted_data, |
| + const std::string* error); |
| void AfterVerifyAndEncryptData(ServiceCallbacksID callback_id, |
| const std::string* result, |
| const std::string* error); |
| + void AfterGetAndEncryptCredentials(ServiceCallbacksID callback_id, |
| + const std::string& encrypted_data, |
| + const std::string& error); |
| void OnNetworksChangedEventOnUIThread( |
| const WiFiService::NetworkGuidList& network_guid_list); |