Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h

Issue 214863002: Extension API enterprise.platformKeys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Splitted custom_binding, added comments... Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5556505ab93c76bf4eab0699195645a75744a54e
--- /dev/null
+++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
@@ -0,0 +1,123 @@
+// 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 {
not at google - send to devlin 2014/05/05 21:09:24 this inner namespace is unusual. see comment below
pneubeck (no reviews) 2014/05/05 21:28:23 See typedefs at the end. TheNamesAreReallyExtreeee
not at google - send to devlin 2014/05/05 21:44:49 I see. Yeah, I dunno, I was confused, so chances a
pneubeck (no reviews) 2014/05/06 14:07:21 Long names are problematic because you have too re
not at google - send to devlin 2014/05/07 00:00:12 Ok if you insist. This is just very unusual. No ot
not at google - send to devlin 2014/05/07 15:42:25 I had a realisation last night that we should be g
+
+class TokenMethodExtensionFunction : public ChromeAsyncExtensionFunction {
not at google - send to devlin 2014/05/05 21:09:24 I just submitted r268033 which encourages you to i
pneubeck (no reviews) 2014/05/06 14:07:21 Done.
+ public:
+ void SetResults(scoped_ptr<base::ListValue> results);
+ virtual void SendResponse(bool success) OVERRIDE;
+
+ protected:
+ TokenMethodExtensionFunction();
+ virtual ~TokenMethodExtensionFunction();
+
+ bool ValidateToken(const std::string& token_id);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TokenMethodExtensionFunction);
+};
+
+class Generate : public TokenMethodExtensionFunction {
not at google - send to devlin 2014/05/05 21:09:24 registration for these functions is generated by t
pneubeck (no reviews) 2014/05/06 14:07:21 Done.
+ public:
+ Generate();
+
+ protected:
+ virtual ~Generate();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.generateKey",
+ ENTERPRISE_PLATFORMKEYSINTERNAL_GENERATEKEY);
+};
+
+class Sign : public TokenMethodExtensionFunction {
+ public:
+ Sign();
+
+ protected:
+ virtual ~Sign();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.sign",
+ ENTERPRISE_PLATFORMKEYSINTERNAL_SIGN);
+};
+
+class GetCerts : public TokenMethodExtensionFunction {
+ public:
+ GetCerts();
+
+ protected:
+ virtual ~GetCerts();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.getCertificates",
+ ENTERPRISE_PLATFORMKEYS_GETCERTIFICATES);
+};
+
+class ImportCert : public TokenMethodExtensionFunction {
+ public:
+ ImportCert();
+
+ protected:
+ virtual ~ImportCert();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.importCertificate",
+ ENTERPRISE_PLATFORMKEYS_IMPORTCERTIFICATE);
+};
+
+class RemoveCert : public TokenMethodExtensionFunction {
+ public:
+ RemoveCert();
+
+ protected:
+ virtual ~RemoveCert();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("enterprise.platformKeys.removeCertificate",
+ ENTERPRISE_PLATFORMKEYS_REMOVECERTIFICATE);
+};
+
+class GetTokens : public ChromeAsyncExtensionFunction {
+ protected:
+ virtual ~GetTokens();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("enterprise.platformKeysInternal.getTokens",
+ ENTERPRISE_PLATFORMKEYSINTERNAL_GETTOKENS);
+};
+
+} // namespace enterprise_platform_keys
+
+typedef enterprise_platform_keys::Generate
+ EnterprisePlatformKeysInternalGenerateKeyFunction;
+typedef enterprise_platform_keys::Sign
+ EnterprisePlatformKeysInternalSignFunction;
+typedef enterprise_platform_keys::GetTokens
+ EnterprisePlatformKeysInternalGetTokensFunction;
+
+typedef enterprise_platform_keys::GetCerts
+ EnterprisePlatformKeysGetCertificatesFunction;
+typedef enterprise_platform_keys::ImportCert
+ EnterprisePlatformKeysImportCertificateFunction;
+typedef enterprise_platform_keys::RemoveCert
+ EnterprisePlatformKeysRemoveCertificateFunction;
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_ENTERPRISE_PLATFORM_KEYS_API_H_

Powered by Google App Engine
This is Rietveld 408576698