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

Unified Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h

Issue 391513002: Add easyUnlockPrivate extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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/easy_unlock_private/easy_unlock_private_api.h
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f7da9c653fe68dcf0501d4d4ba020d998c9f99c
--- /dev/null
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h
@@ -0,0 +1,90 @@
+// 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_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_API_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "extensions/browser/extension_function.h"
+
+// Implementations for chrome.easyUnlockPrivate API functions.
+
+namespace extensions {
+namespace api {
+
+class EasyUnlockPrivatePerformECDHKeyAgreementFunction
+ : public AsyncExtensionFunction {
+ public:
+ EasyUnlockPrivatePerformECDHKeyAgreementFunction();
+
+ protected:
+ virtual ~EasyUnlockPrivatePerformECDHKeyAgreementFunction();
+
+ virtual bool RunAsync() OVERRIDE;
+
+ private:
+ void OnData(const std::string& secret_key);
+
+ DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.performECDHKeyAgreement",
+ EASYUNLOCKPRIVATE_PERFORMECDHKEYAGREEMENT)
+};
+
+class EasyUnlockPrivateGenerateEcP256KeyPairFunction
+ : public AsyncExtensionFunction {
+ public:
+ EasyUnlockPrivateGenerateEcP256KeyPairFunction();
+
+ protected:
+ virtual ~EasyUnlockPrivateGenerateEcP256KeyPairFunction();
+
+ virtual bool RunAsync() OVERRIDE;
+
+ private:
+ void OnData(const std::string& public_key,
+ const std::string& private_key);
+
+ DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.generateEcP256KeyPair",
+ EASYUNLOCKPRIVATE_GENERATEECP256KEYPAIR)
+};
+
+class EasyUnlockPrivateCreateSecureMessageFunction
+ : public AsyncExtensionFunction {
+ public:
+ EasyUnlockPrivateCreateSecureMessageFunction();
+
+ protected:
+ virtual ~EasyUnlockPrivateCreateSecureMessageFunction();
+
+ virtual bool RunAsync() OVERRIDE;
+
+ private:
+ void OnData(const std::string& message);
+
+ DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.createSecureMessage",
+ EASYUNLOCKPRIVATE_CREATESECUREMESSAGE)
+};
+
+class EasyUnlockPrivateUnwrapSecureMessageFunction
+ : public AsyncExtensionFunction {
+ public:
+ EasyUnlockPrivateUnwrapSecureMessageFunction();
+
+ protected:
+ virtual ~EasyUnlockPrivateUnwrapSecureMessageFunction();
+
+ virtual bool RunAsync() OVERRIDE;
+
+ private:
+ void OnData(const std::string& data);
+
+ DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.unwrapSecureMessage",
+ EASYUNLOCKPRIVATE_UNWRAPSECUREMESSAGE)
+};
+
+} // namespace api
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_API_H_

Powered by Google App Engine
This is Rietveld 408576698