| Index: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
|
| diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
|
| index cdf779cbf963192e5d3f4c13d40b7edd52a1a48a..97c54dab9299f5301d85a6bd369ce6e5db7af0ba 100644
|
| --- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
|
| +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
|
| @@ -7,6 +7,8 @@
|
| #include "base/bind.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/chromeos/platform_keys/platform_keys.h"
|
| +#include "chrome/browser/chromeos/platform_keys/platform_keys_service.h"
|
| +#include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h"
|
| #include "chrome/common/extensions/api/enterprise_platform_keys.h"
|
| #include "chrome/common/extensions/api/enterprise_platform_keys_internal.h"
|
| #include "content/public/browser/browser_thread.h"
|
| @@ -48,9 +50,15 @@ EnterprisePlatformKeysInternalGenerateKeyFunction::Run() {
|
| if (!ValidateToken(params->token_id))
|
| return RespondNow(Error(kErrorInvalidToken));
|
|
|
| - chromeos::platform_keys::GenerateRSAKey(
|
| + chromeos::PlatformKeysService* service =
|
| + chromeos::PlatformKeysServiceFactory::GetInstance()->GetForBrowserContext(
|
| + browser_context());
|
| + DCHECK(service);
|
| +
|
| + service->GenerateRSAKey(
|
| params->token_id,
|
| params->modulus_length,
|
| + extension_id(),
|
| base::Bind(
|
| &EnterprisePlatformKeysInternalGenerateKeyFunction::OnGeneratedKey,
|
| this),
|
| @@ -82,10 +90,16 @@ EnterprisePlatformKeysInternalSignFunction::Run() {
|
| if (!ValidateToken(params->token_id))
|
| return RespondNow(Error(kErrorInvalidToken));
|
|
|
| - chromeos::platform_keys::Sign(
|
| + chromeos::PlatformKeysService* service =
|
| + chromeos::PlatformKeysServiceFactory::GetInstance()->GetForBrowserContext(
|
| + browser_context());
|
| + DCHECK(service);
|
| +
|
| + service->Sign(
|
| params->token_id,
|
| params->public_key,
|
| params->data,
|
| + extension_id(),
|
| base::Bind(&EnterprisePlatformKeysInternalSignFunction::OnSigned, this),
|
| GetProfile());
|
| return RespondLater();
|
|
|