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

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 comments Created 3 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/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..a4a7c487f827b630419435a41f3dd542762b23d3
--- /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 get destroyed when the WebContents goes away.
Mike West 2017/06/13 21:11:22 Tiny nit: s/get/is/
kpaulhamus 2017/06/15 01:27:13 Done.
+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_

Powered by Google App Engine
This is Rietveld 408576698