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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2446093004: [Web Payments] Initial plumb of Payment Request dialog (Closed)
Patch Set: Handle new member function Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/payments/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5c20fc0035923a1b364d4acfdbfb1dfc5b0d782f..d6d47ba97cf60a6a8dd54ded2a4cb5dfb1b00f43 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"
@@ -1437,6 +1438,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) {
@@ -3004,6 +3014,15 @@ void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces(
base::Bind(&ForwardShareServiceRequest,
web_contents->GetJavaInterfaces()->GetWeakPtr()));
}
+#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
+ if (AreExperimentalWebPlatformFeaturesEnabled()) {
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(render_frame_host);
+ if (web_contents) {
+ registry->AddInterface(
+ base::Bind(CreatePaymentRequestHandler, web_contents));
+ }
+ }
#endif
}
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/payments/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698