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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2274303002: Enable the WebUSB Origin Trial. (Closed)
Patch Set: Revert update to global-interface-listing-expected.txt. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after
2889 2889
2890 #if defined(ENABLE_MOJO_MEDIA) 2890 #if defined(ENABLE_MOJO_MEDIA)
2891 registry->AddInterface( 2891 registry->AddInterface(
2892 base::Bind(&OutputProtectionImpl::Create, render_frame_host)); 2892 base::Bind(&OutputProtectionImpl::Create, render_frame_host));
2893 #endif // defined(ENABLE_MOJO_MEDIA) 2893 #endif // defined(ENABLE_MOJO_MEDIA)
2894 } 2894 }
2895 2895
2896 void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces( 2896 void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces(
2897 shell::InterfaceRegistry* registry, 2897 shell::InterfaceRegistry* registry,
2898 content::RenderFrameHost* render_frame_host) { 2898 content::RenderFrameHost* render_frame_host) {
2899 // WebUSB is an experimental web API. It will only work if the experiment 2899 if (base::FeatureList::IsEnabled(features::kWebUsb)
2900 // is enabled and WebUSB feature is enabled. It should also not be available
2901 // to apps and extensions.
2902 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2903 switches::kEnableExperimentalWebPlatformFeatures) &&
2904 base::FeatureList::IsEnabled(features::kWebUsb)
2905 #if defined(ENABLE_EXTENSIONS) 2900 #if defined(ENABLE_EXTENSIONS)
2906 && 2901 &&
2907 !render_frame_host->GetSiteInstance()->GetSiteURL().SchemeIs( 2902 !render_frame_host->GetSiteInstance()->GetSiteURL().SchemeIs(
2908 extensions::kExtensionScheme) 2903 extensions::kExtensionScheme)
2909 #endif 2904 #endif
2910 ) { 2905 ) {
2911 registry->AddInterface( 2906 registry->AddInterface(
2912 base::Bind(&CreateUsbDeviceManager, render_frame_host)); 2907 base::Bind(&CreateUsbDeviceManager, render_frame_host));
2913 registry->AddInterface( 2908 registry->AddInterface(
2914 base::Bind(&CreateWebUsbChooserService, render_frame_host)); 2909 base::Bind(&CreateWebUsbChooserService, render_frame_host));
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
3154 if (channel <= kMaxDisableEncryptionChannel) { 3149 if (channel <= kMaxDisableEncryptionChannel) {
3155 static const char* const kWebRtcDevSwitchNames[] = { 3150 static const char* const kWebRtcDevSwitchNames[] = {
3156 switches::kDisableWebRtcEncryption, 3151 switches::kDisableWebRtcEncryption,
3157 }; 3152 };
3158 to_command_line->CopySwitchesFrom(from_command_line, 3153 to_command_line->CopySwitchesFrom(from_command_line,
3159 kWebRtcDevSwitchNames, 3154 kWebRtcDevSwitchNames,
3160 arraysize(kWebRtcDevSwitchNames)); 3155 arraysize(kWebRtcDevSwitchNames));
3161 } 3156 }
3162 } 3157 }
3163 #endif // defined(ENABLE_WEBRTC) 3158 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698