Skip to content

Commit

Permalink
[Payments] Desktop: enable the Payment Request integration by default
Browse files Browse the repository at this point in the history
The WebPayments feature flag is now ENABLED_BY_DEFAULT, and on
the renderer side the feature is enabled based on the same feature.

See blink-dev intent to ship update here: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/Payment$20Request%7Csort:relevance/blink-dev/p1DYoxHlkKg/0mP2L5cyBQAJ

BUG=717660
TEST=existing

Review-Url: https://codereview.chromium.org/2855923002
Cr-Commit-Position: refs/heads/master@{#468845}
  • Loading branch information
mathp authored and Commit bot committed May 3, 2017
1 parent 2c386b2 commit 0ea8510
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 38 deletions.
12 changes: 1 addition & 11 deletions chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1608,15 +1608,6 @@ bool IsAutoReloadVisibleOnlyEnabled() {
return true;
}

#if !defined(OS_ANDROID)
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) {
Expand Down Expand Up @@ -3219,8 +3210,7 @@ void ChromeContentBrowserClient::ExposeInterfacesToFrame(
web_contents->GetJavaInterfaces()->GetWeakPtr()));
}
#else
if (AreExperimentalWebPlatformFeaturesEnabled() &&
base::FeatureList::IsEnabled(features::kWebPayments)) {
if (base::FeatureList::IsEnabled(features::kWebPayments)) {
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
if (web_contents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
Expand All @@ -33,10 +32,7 @@ class SitePerProcessPaymentsBrowserTest : public InProcessBrowserTest {
// HTTPS server only serves a valid cert for localhost, so this is needed
// to load pages from other hosts without an error.
command_line->AppendSwitch(switches::kIgnoreCertificateErrors);
command_line->AppendSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
command_line->AppendSwitchASCII(switches::kEnableFeatures,
features::kWebPayments.name);

// Append --site-per-process flag.
content::IsolateAllSitesForTesting(command_line);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand All @@ -59,14 +57,6 @@ PaymentRequestBrowserTestBase::PaymentRequestBrowserTestBase(
is_valid_ssl_(true) {}
PaymentRequestBrowserTestBase::~PaymentRequestBrowserTestBase() {}

void PaymentRequestBrowserTestBase::SetUpCommandLine(
base::CommandLine* command_line) {
InProcessBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
command_line->AppendSwitchASCII(switches::kEnableFeatures,
features::kWebPayments.name);
}

void PaymentRequestBrowserTestBase::SetUpOnMainThread() {
https_server_ = base::MakeUnique<net::EmbeddedTestServer>(
net::EmbeddedTestServer::TYPE_HTTPS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class PaymentRequestBrowserTestBase
explicit PaymentRequestBrowserTestBase(const std::string& test_file_path);
~PaymentRequestBrowserTestBase() override;

void SetUpCommandLine(base::CommandLine* command_line) override;
void SetUpOnMainThread() override;

void SetIncognito();
Expand Down
2 changes: 1 addition & 1 deletion content/child/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
#if defined(OS_ANDROID)
if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
WebRuntimeFeatures::EnableMediaSession(false);
#endif

WebRuntimeFeatures::EnablePaymentRequest(
base::FeatureList::IsEnabled(features::kWebPayments));
#endif

WebRuntimeFeatures::EnableServiceWorkerNavigationPreload(
base::FeatureList::IsEnabled(features::kServiceWorkerNavigationPreload));
Expand Down
14 changes: 4 additions & 10 deletions content/public/common/content_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ const base::Feature kWebAssemblyStreaming{"WebAssemblyStreaming",
const base::Feature kWebGLImageChromium{"WebGLImageChromium",
base::FEATURE_ENABLED_BY_DEFAULT};

// The JavaScript API for payments on the web.
const base::Feature kWebPayments{"WebPayments",
base::FEATURE_ENABLED_BY_DEFAULT};

// Makes WebRTC use ECDSA certs by default (i.e., when no cert type was
// specified in JS).
const base::Feature kWebRtcEcdsaDefault {"WebRTC-EnableWebRtcEcdsa",
Expand Down Expand Up @@ -319,21 +323,11 @@ const base::Feature kServiceWorkerPaymentApps{
"ServiceWorkerPaymentApps",
base::FEATURE_DISABLED_BY_DEFAULT};

// The JavaScript API for payments on the web.
const base::Feature kWebPayments{"WebPayments",
base::FEATURE_ENABLED_BY_DEFAULT};

// Controls whether the WebNFC API is enabled:
// https://w3c.github.io/web-nfc/
const base::Feature kWebNfc{"WebNFC", base::FEATURE_DISABLED_BY_DEFAULT};
#endif

#if !defined(OS_ANDROID)
// The JavaScript API for payments on the web.
const base::Feature kWebPayments{"WebPayments",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif

#if defined(OS_WIN)
// Emergency "off switch" for new Windows sandbox security mitigation,
// sandbox::MITIGATION_EXTENSION_POINT_DISABLE.
Expand Down

0 comments on commit 0ea8510

Please sign in to comment.