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

Unified Diff: components/webauth/authenticator_impl.h

Issue 2788823002: Add the Mojo implementation of authenticator.mojom's MakeCredential. (Closed)
Patch Set: Address tryjobs failure Created 3 years, 6 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: components/webauth/authenticator_impl.h
diff --git a/components/webauth/authenticator_impl.h b/components/webauth/authenticator_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f5f7396eee6ae79bd8a549e63264bfaa6fda392
--- /dev/null
+++ b/components/webauth/authenticator_impl.h
@@ -0,0 +1,52 @@
+// Copyright 2017 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 COMPONENTS_WEBAUTH_AUTHENTICATOR_IMPL_H_
+#define COMPONENTS_WEBAUTH_AUTHENTICATOR_IMPL_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "content/public/browser/web_contents.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "public/platform/modules/webauth/authenticator.mojom.h"
jam 2017/06/27 13:52:17 nit: preface include with third_party/WebKit
+
+namespace content {
+class RenderFrameHost;
+}
+
+namespace webauth {
+
+// Implementation of the public Authenticator interface.
+class AuthenticatorImpl : public mojom::Authenticator {
+ public:
+ static void Create(content::RenderFrameHost* render_frame_host,
+ mojom::AuthenticatorRequest request);
+ ~AuthenticatorImpl() override;
+
+ void set_connection_error_handler(const base::Closure& error_handler) {
+ connection_error_handler_ = error_handler;
+ }
+
+ private:
+ AuthenticatorImpl(content::RenderFrameHost* render_frame_host);
+
+ // mojom:Authenticator
+ void MakeCredential(
+ mojom::RelyingPartyAccountPtr account,
+ std::vector<mojom::ScopedCredentialParametersPtr> parameters,
+ const std::vector<uint8_t>& challenge,
+ mojom::ScopedCredentialOptionsPtr options,
+ MakeCredentialCallback callback) override;
+
+ base::Closure connection_error_handler_;
+ base::CancelableClosure timeout_callback_;
+ url::Origin caller_origin_;
+ DISALLOW_COPY_AND_ASSIGN(AuthenticatorImpl);
+};
+
+} // namespace webauth
+
+#endif // COMPONENTS_WEBAUTH_AUTHENTICATOR_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698