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

Unified Diff: chrome/browser/webauth/authenticator_web_contents_manager.h

Issue 2788823002: Add the Mojo implementation of authenticator.mojom's MakeCredential. (Closed)
Patch Set: Addressing mkwst comments 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
« no previous file with comments | « chrome/browser/webauth/DEPS ('k') | chrome/browser/webauth/authenticator_web_contents_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webauth/authenticator_web_contents_manager.h
diff --git a/chrome/browser/webauth/authenticator_web_contents_manager.h b/chrome/browser/webauth/authenticator_web_contents_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..57e73ec5100d9c72937adfb208ff2288772c8c2f
--- /dev/null
+++ b/chrome/browser/webauth/authenticator_web_contents_manager.h
@@ -0,0 +1,40 @@
+// 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 CHROME_BROWSER_WEBAUTH_AUTHENTICATOR_WEB_CONTENTS_MANAGER_H_
+#define CHROME_BROWSER_WEBAUTH_AUTHENTICATOR_WEB_CONTENTS_MANAGER_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "components/webauth/authenticator.mojom.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+
+// This class owns the Authenticator associated with a given WebContents.
+// The Authenticator is destroyed when the WebContents goes away.
+class AuthenticatorWebContentsManager
+ : public content::WebContentsUserData<AuthenticatorWebContentsManager> {
+ public:
+ ~AuthenticatorWebContentsManager() override;
+
+ // Retrieves the instance of AuthenticatorWebContentsManager that was
+ // attached to the specified WebContents. If no instance was attached,
+ // creates one, and attaches it to the specified WebContents.
+ static AuthenticatorWebContentsManager* GetOrCreateForWebContents(
+ content::WebContents* web_contents);
+
+ // Creates the Authenticator that will interact with this |web_contents|.
+ void CreateAuthenticator(
+ content::RenderFrameHost* render_frame_host,
+ mojo::InterfaceRequest<webauth::mojom::Authenticator> authenticator);
+
+ private:
+ explicit AuthenticatorWebContentsManager(content::WebContents* web_contents);
+ friend class content::WebContentsUserData<AuthenticatorWebContentsManager>;
+
+ DISALLOW_COPY_AND_ASSIGN(AuthenticatorWebContentsManager);
+};
+
+#endif // CHROME_BROWSER_WEBAUTH_AUTHENTICATOR_WEB_CONTENTS_MANAGER_H_
« no previous file with comments | « chrome/browser/webauth/DEPS ('k') | chrome/browser/webauth/authenticator_web_contents_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698