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

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

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.cc
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f7afec7dfaa8c0dfcaee140b7641b51602f60ac4
--- /dev/null
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
@@ -0,0 +1,88 @@
+// 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.
+
+#include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h"
+
+#include "chrome/common/extensions/api/easy_unlock_private.h"
+
+namespace extensions {
+namespace api {
+
+EasyUnlockPrivatePerformECDHKeyAgreementFunction::
+EasyUnlockPrivatePerformECDHKeyAgreementFunction() {}
+
+EasyUnlockPrivatePerformECDHKeyAgreementFunction::
+~EasyUnlockPrivatePerformECDHKeyAgreementFunction() {}
+
+bool EasyUnlockPrivatePerformECDHKeyAgreementFunction::RunAsync() {
+ return false;
+}
+
+void EasyUnlockPrivatePerformECDHKeyAgreementFunction::OnData(
+ const std::string& secret_key) {
+ if (!secret_key.empty()) {
+ results_ = easy_unlock_private::PerformECDHKeyAgreement::Results::Create(
+ secret_key);
+ }
+ SendResponse(true);
+}
+
+EasyUnlockPrivateGenerateEcP256KeyPairFunction::
+EasyUnlockPrivateGenerateEcP256KeyPairFunction() {}
+
+EasyUnlockPrivateGenerateEcP256KeyPairFunction::
+~EasyUnlockPrivateGenerateEcP256KeyPairFunction() {}
+
+bool EasyUnlockPrivateGenerateEcP256KeyPairFunction::RunAsync() {
+ return false;
+}
+
+void EasyUnlockPrivateGenerateEcP256KeyPairFunction::OnData(
+ const std::string& public_key,
+ const std::string& private_key) {
+ if (!public_key.empty() && !private_key.empty()) {
+ results_ = easy_unlock_private::GenerateEcP256KeyPair::Results::Create(
+ public_key, private_key);
+ }
+ SendResponse(true);
+}
+
+EasyUnlockPrivateCreateSecureMessageFunction::
+EasyUnlockPrivateCreateSecureMessageFunction() {}
+
+EasyUnlockPrivateCreateSecureMessageFunction::
+~EasyUnlockPrivateCreateSecureMessageFunction() {}
+
+bool EasyUnlockPrivateCreateSecureMessageFunction::RunAsync() {
+ return false;
+}
+
+void EasyUnlockPrivateCreateSecureMessageFunction::OnData(
+ const std::string& message) {
+ if (!message.empty()) {
+ results_ = easy_unlock_private::CreateSecureMessage::Results::Create(
+ message);
+ }
+ SendResponse(true);
+}
+
+EasyUnlockPrivateUnwrapSecureMessageFunction::
+EasyUnlockPrivateUnwrapSecureMessageFunction() {}
+
+EasyUnlockPrivateUnwrapSecureMessageFunction::
+~EasyUnlockPrivateUnwrapSecureMessageFunction() {}
+
+bool EasyUnlockPrivateUnwrapSecureMessageFunction::RunAsync() {
+ return false;
+}
+
+void EasyUnlockPrivateUnwrapSecureMessageFunction::OnData(
+ const std::string& data) {
+ if (!data.empty())
+ results_ = easy_unlock_private::UnwrapSecureMessage::Results::Create(data);
+ SendResponse(true);
+}
+
+} // namespace api
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698