Chromium Code Reviews| 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..9b022b24801913ac30a2e1d80224dede1ed79974 |
| --- /dev/null |
| +++ b/chrome/browser/webauth/authenticator_web_contents_manager.cc |
| @@ -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. |
| + |
| +#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) {} |
| + |
| +//} // namespace authenticator |
|
Mike West
2017/06/13 21:11:22
Leftover?
kpaulhamus
2017/06/15 01:27:13
Done.
|