Index: chrome/browser/webauth/authenticator_web_contents_manager.cc |
diff --git a/chrome/browser/webauth/authenticator_web_contents_manager.cc b/chrome/browser/webauth/authenticator_web_contents_manager.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2f6b02f22bfa126649d77f7c9e00d14e8ab7d3d3 |
--- /dev/null |
+++ b/chrome/browser/webauth/authenticator_web_contents_manager.cc |
@@ -0,0 +1,38 @@ |
+// 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. |
+ |
+#include "chrome/browser/webauth/authenticator_web_contents_manager.h" |
+ |
+#include <utility> |
+ |
+#include "base/logging.h" |
+#include "base/memory/ptr_util.h" |
+#include "components/webauth/authenticator_impl.h" |
+#include "content/public/browser/web_contents.h" |
+ |
+DEFINE_WEB_CONTENTS_USER_DATA_KEY(AuthenticatorWebContentsManager); |
+ |
+AuthenticatorWebContentsManager::~AuthenticatorWebContentsManager() {} |
+ |
+AuthenticatorWebContentsManager* |
+AuthenticatorWebContentsManager::GetOrCreateForWebContents( |
+ content::WebContents* web_contents) { |
+ DCHECK(web_contents); |
+ // Does nothing if the manager instance already exists. |
+ AuthenticatorWebContentsManager* manager = FromWebContents(web_contents); |
+ if (!manager) { |
+ CreateForWebContents(web_contents); |
+ manager = FromWebContents(web_contents); |
+ } |
+ return manager; |
+} |
+ |
+void AuthenticatorWebContentsManager::CreateAuthenticator( |
+ content::RenderFrameHost* render_frame_host, |
+ mojo::InterfaceRequest<webauth::mojom::Authenticator> request) { |
+ webauth::AuthenticatorImpl::Create(render_frame_host, std::move(request)); |
+} |
+ |
+AuthenticatorWebContentsManager::AuthenticatorWebContentsManager( |
+ content::WebContents* web_contents) {} |