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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d032d6a83bce6a69d29c6e73ef36ec23ac4a1ef1..7434db0c37f8dd0ec9d548a0c4c5198660757c28 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -99,6 +99,7 @@
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/browser/ui/webui/log_web_ui_url.h"
#include "chrome/browser/usb/usb_tab_helper.h"
+#include "chrome/browser/webauth/authenticator_web_contents_manager.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_features.h"
@@ -890,6 +891,20 @@ AppLoadedInTabSource ClassifyAppLoadedInTabSource(
}
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+void CreateAuthenticatorForWebContents(
+ content::RenderFrameHost* render_frame_host,
+ const service_manager::BindSourceInfo& source_info,
+ webauth::mojom::AuthenticatorRequest request) {
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(render_frame_host);
+ if (!web_contents) {
+ NOTREACHED();
+ return;
Mike West 2017/06/13 21:11:22 Why `NOTREACHED()` here rather than `DCHECK(web_co
kpaulhamus 2017/06/15 01:27:13 Updated.
+ }
+ AuthenticatorWebContentsManager::GetOrCreateForWebContents(web_contents)
+ ->CreateAuthenticator(render_frame_host, std::move(request));
+}
+
void CreateUsbDeviceManager(RenderFrameHost* render_frame_host,
const service_manager::BindSourceInfo& source_info,
device::mojom::UsbDeviceManagerRequest request) {
@@ -3196,6 +3211,11 @@ void ChromeContentBrowserClient::ExposeInterfacesToFrame(
}
#endif
+ if (base::FeatureList::IsEnabled(features::kWebAuth)) {
+ registry->AddInterface(
+ base::Bind(&CreateAuthenticatorForWebContents, render_frame_host));
+ }
+
#if defined(OS_LINUX) || defined(OS_WIN)
if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) {
registry->AddInterface(base::Bind(&ShareServiceImpl::Create));

Powered by Google App Engine
This is Rietveld 408576698