Chromium Code Reviews| 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..f664f1a443d230d0dd42b0eefee06077c3e08c4b |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h |
| @@ -0,0 +1,101 @@ |
| +// 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 <string> |
| +#include <vector> |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/extensions/chrome_extension_function.h" |
| + |
| +namespace net { |
| +class X509Certificate; |
| +typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
| +} |
| + |
| +namespace extensions { |
| + |
| +class EnterprisePlatformKeysInternalGenerateKeyFunction |
| + : public ChromeUIThreadExtensionFunction { |
|
not at google - send to devlin
2014/05/14 18:11:01
put some kind of public/private/etc scope on this.
pneubeck (no reviews)
2014/05/15 09:25:10
Done.
|
| + virtual ~EnterprisePlatformKeysInternalGenerateKeyFunction(); |
| + virtual ResponseAction Run() OVERRIDE; |
| + |
| + // Called when the key was generated. If an error occurred, |public_key_der| |
| + // will be empty and instead |error_message| be set. |
| + void OnGeneratedKey(const std::string& public_key_der, |
| + const std::string& error_message); |
| + |
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.generateKey", |
| + ENTERPRISE_PLATFORMKEYSINTERNAL_GENERATEKEY); |
| +}; |
| + |
| +class EnterprisePlatformKeysInternalSignFunction |
| + : public ChromeUIThreadExtensionFunction { |
| + virtual ~EnterprisePlatformKeysInternalSignFunction(); |
| + virtual ResponseAction Run() OVERRIDE; |
| + |
| + // Called when the signature was generated. If an error occurred, |
| + // |signature| will be empty and instead |error_message| be set. |
| + void OnSigned(const std::string& signature, const std::string& error_message); |
| + |
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.sign", |
| + ENTERPRISE_PLATFORMKEYSINTERNAL_SIGN); |
| +}; |
| + |
| +class EnterprisePlatformKeysGetCertificatesFunction |
| + : public ChromeUIThreadExtensionFunction { |
| + virtual ~EnterprisePlatformKeysGetCertificatesFunction(); |
| + virtual ResponseAction Run() OVERRIDE; |
| + |
| + // Called when the list of certificates was determined. If an error occurred, |
| + // |certs| will be NULL and instead |error_message| be set. |
| + void OnGotCertificates(scoped_ptr<net::CertificateList> certs, |
| + const std::string& error_message); |
| + |
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.getCertificates", |
| + ENTERPRISE_PLATFORMKEYS_GETCERTIFICATES); |
| +}; |
| + |
| +class EnterprisePlatformKeysImportCertificateFunction |
| + : public ChromeUIThreadExtensionFunction { |
| + virtual ~EnterprisePlatformKeysImportCertificateFunction(); |
| + virtual ResponseAction Run() OVERRIDE; |
| + |
| + // Called when the certificate was imported. Only if an error occurred, |
| + // |error_message| will be set. |
| + void OnImportedCertificate(const std::string& error_message); |
| + |
| + DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.importCertificate", |
| + ENTERPRISE_PLATFORMKEYS_IMPORTCERTIFICATE); |
| +}; |
| + |
| +class EnterprisePlatformKeysRemoveCertificateFunction |
| + : public ChromeUIThreadExtensionFunction { |
| + virtual ~EnterprisePlatformKeysRemoveCertificateFunction(); |
| + virtual ResponseAction Run() OVERRIDE; |
| + |
| + // Called when the certificate was removed. Only if an error occurred, |
| + // |error_message| will be set. |
| + void OnRemovedCertificate(const std::string& error_message); |
| + |
| + 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_ |