| Index: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
|
| diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c7040ffa68f4d5b19e314a97e148898361251a0f
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
|
| @@ -0,0 +1,109 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_ENTERPRISE_PLATFORM_KEYS_API_H_
|
| +#define CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_ENTERPRISE_PLATFORM_KEYS_API_H_
|
| +
|
| +#include "base/compiler_specific.h"
|
| +#include "chrome/browser/extensions/chrome_extension_function.h"
|
| +
|
| +namespace extensions {
|
| +
|
| +namespace enterprise_platform_keys_details {
|
| +class TokenMethod;
|
| +}
|
| +
|
| +class EnterprisePlatformKeysTokenMethodExtensionFunction
|
| + : public ChromeUIThreadExtensionFunction {
|
| + public:
|
| + EnterprisePlatformKeysTokenMethodExtensionFunction();
|
| +
|
| + // Called back by the implementation of the token methods.
|
| + // Calling any of these will lead to the destruction of the ExtensionFunction
|
| + // object.
|
| + void RespondWithoutResult();
|
| + void RespondWithResults(scoped_ptr<base::ListValue> results);
|
| + void RespondWithError(const std::string& error_message);
|
| +
|
| + protected:
|
| + virtual ~EnterprisePlatformKeysTokenMethodExtensionFunction();
|
| +
|
| + bool ValidateToken(const std::string& token_id);
|
| +
|
| + scoped_ptr<enterprise_platform_keys_details::TokenMethod> token_method_;
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(EnterprisePlatformKeysTokenMethodExtensionFunction);
|
| +};
|
| +
|
| +class EnterprisePlatformKeysInternalGenerateKeyFunction
|
| + : public EnterprisePlatformKeysTokenMethodExtensionFunction {
|
| + public:
|
| + EnterprisePlatformKeysInternalGenerateKeyFunction();
|
| +
|
| + protected:
|
| + virtual ~EnterprisePlatformKeysInternalGenerateKeyFunction();
|
| + virtual ResponseAction Run() OVERRIDE;
|
| +
|
| + private:
|
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.generateKey",
|
| + ENTERPRISE_PLATFORMKEYSINTERNAL_GENERATEKEY);
|
| +};
|
| +
|
| +class EnterprisePlatformKeysInternalSignFunction
|
| + : public EnterprisePlatformKeysTokenMethodExtensionFunction {
|
| + protected:
|
| + virtual ~EnterprisePlatformKeysInternalSignFunction();
|
| + virtual ResponseAction Run() OVERRIDE;
|
| +
|
| + private:
|
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.sign",
|
| + ENTERPRISE_PLATFORMKEYSINTERNAL_SIGN);
|
| +};
|
| +
|
| +class EnterprisePlatformKeysGetCertificatesFunction
|
| + : public EnterprisePlatformKeysTokenMethodExtensionFunction {
|
| + protected:
|
| + virtual ~EnterprisePlatformKeysGetCertificatesFunction();
|
| + virtual ResponseAction Run() OVERRIDE;
|
| +
|
| + private:
|
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.getCertificates",
|
| + ENTERPRISE_PLATFORMKEYS_GETCERTIFICATES);
|
| +};
|
| +
|
| +class EnterprisePlatformKeysImportCertificateFunction
|
| + : public EnterprisePlatformKeysTokenMethodExtensionFunction {
|
| + protected:
|
| + virtual ~EnterprisePlatformKeysImportCertificateFunction();
|
| + virtual ResponseAction Run() OVERRIDE;
|
| +
|
| + private:
|
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.importCertificate",
|
| + ENTERPRISE_PLATFORMKEYS_IMPORTCERTIFICATE);
|
| +};
|
| +
|
| +class EnterprisePlatformKeysRemoveCertificateFunction
|
| + : public EnterprisePlatformKeysTokenMethodExtensionFunction {
|
| + protected:
|
| + virtual ~EnterprisePlatformKeysRemoveCertificateFunction();
|
| + virtual ResponseAction Run() OVERRIDE;
|
| +
|
| + private:
|
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.removeCertificate",
|
| + ENTERPRISE_PLATFORMKEYS_REMOVECERTIFICATE);
|
| +};
|
| +
|
| +class EnterprisePlatformKeysInternalGetTokensFunction
|
| + : public ChromeUIThreadExtensionFunction {
|
| + virtual ~EnterprisePlatformKeysInternalGetTokensFunction();
|
| + virtual ResponseAction Run() OVERRIDE;
|
| +
|
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.getTokens",
|
| + ENTERPRISE_PLATFORMKEYSINTERNAL_GETTOKENS);
|
| +};
|
| +
|
| +} // namespace extensions
|
| +
|
| +#endif // CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_ENTERPRISE_PLATFORM_KEYS_API_H_
|
|
|