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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2446093004: [Web Payments] Initial plumb of Payment Request dialog (Closed)
Patch Set: Responses 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
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 edadc181b79f064b4e61b5ddca3e0c6a640b945a..4cf3e376bc25d2f0a236dcc092929cec1f52774c 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"
@@ -1401,6 +1402,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) {
@@ -2969,7 +2979,16 @@ void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces(
web_contents->GetJavaInterfaces()->GetWeakPtr()));
}
#endif
-
+#if 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,
+ render_frame_host, web_contents));
+ }
+ }
+#endif
#if defined(ENABLE_MEDIA_ROUTER)
registry->AddInterface(
base::Bind(&CastRemotingConnector::CreateRemoterFactory,

Powered by Google App Engine
This is Rietveld 408576698