Chromium Code Reviews| 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 ce9507def3a49c33c13c5bdf4f876c55c6833eea..ba972cf5704e0814ab2636264034583bbb4b65d8 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -57,6 +57,7 @@ |
| #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" |
| #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| +#include "chrome/browser/payments/payment_request_impl.h" |
| #include "chrome/browser/permissions/permission_context_base.h" |
| #include "chrome/browser/platform_util.h" |
| #include "chrome/browser/prerender/prerender_final_status.h" |
| @@ -1411,6 +1412,15 @@ bool IsAutoReloadVisibleOnlyEnabled() { |
| return true; |
| } |
| +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
| +bool AreExperimentalWebPlatformFeaturesEnabled() { |
| + const base::CommandLine& browser_command_line = |
| + *base::CommandLine::ForCurrentProcess(); |
| + return browser_command_line.HasSwitch( |
| + switches::kEnableExperimentalWebPlatformFeatures); |
| +} |
| +#endif |
| + |
| void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| const base::CommandLine& browser_command_line, |
| base::CommandLine* command_line) { |
| @@ -2979,7 +2989,16 @@ void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces( |
| web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| } |
| #endif |
| - |
| +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
|
Lei Zhang
2016/11/16 00:59:33
You can do #elif since this is related to the abov
Kevin Bailey
2016/11/16 14:13:47
Done.
|
| + if (AreExperimentalWebPlatformFeaturesEnabled()) { |
| + content::WebContents* web_contents = |
| + content::WebContents::FromRenderFrameHost(render_frame_host); |
| + if (web_contents) { |
| + registry->AddInterface( |
| + base::Bind(CreatePaymentRequestHandler, web_contents)); |
| + } |
| + } |
| +#endif |
|
Lei Zhang
2016/11/16 00:59:33
And add a blank line to separate from the unrelate
Kevin Bailey
2016/11/16 14:13:47
Done.
|
| #if defined(ENABLE_MEDIA_ROUTER) |
| registry->AddInterface( |
| base::Bind(&CastRemotingConnector::CreateRemoterFactory, |