| Index: components/webauth/authenticator_web_contents_manager.cc
|
| diff --git a/components/webauth/authenticator_web_contents_manager.cc b/components/webauth/authenticator_web_contents_manager.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a976b2ade40fc37d63c172d0688bda925203fae6
|
| --- /dev/null
|
| +++ b/components/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 "components/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) {}
|
|
|