summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/android/content_startup_flags.cc7
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc1
-rw-r--r--content/child/runtime_features.cc12
-rw-r--r--content/public/common/content_switches.cc3
-rw-r--r--content/public/common/content_switches.h1
5 files changed, 19 insertions, 5 deletions
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index 9254c28..e5acab9 100644
--- a/content/browser/android/content_startup_flags.cc
+++ b/content/browser/android/content_startup_flags.cc
@@ -4,6 +4,7 @@
#include "content/browser/android/content_startup_flags.h"
+#include "base/android/build_info.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/logging.h"
@@ -70,6 +71,12 @@ void SetContentCommandLineFlags(bool single_process,
if (base::SysInfo::IsLowEndDevice())
parsed_command_line->AppendSwitch(switches::kInProcessGPU);
+ // Web Notifications are only supported on Android JellyBean and beyond.
+ if (base::android::BuildInfo::GetInstance()->sdk_int() <
+ base::android::SDK_VERSION_JELLY_BEAN) {
+ parsed_command_line->AppendSwitch(switches::kDisableNotifications);
+ }
+
parsed_command_line->AppendSwitch(switches::kEnableViewportMeta);
parsed_command_line->AppendSwitch(
switches::kMainFrameResizesAreOrientationChanges);
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 1557903..68b50c7 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1219,6 +1219,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisableLogging,
switches::kDisableMediaSource,
switches::kDisableMojoChannel,
+ switches::kDisableNotifications,
switches::kDisableOverlayScrollbar,
switches::kDisablePinch,
switches::kDisablePrefixedEncryptedMedia,
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 875dbcb..21bebcb 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -48,8 +48,6 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
// Android does not have support for PagePopup
WebRuntimeFeatures::enablePagePopup(false);
- // Android does not yet support the Web Notification API. crbug.com/115320
- WebRuntimeFeatures::enableNotifications(false);
// Android does not yet support SharedWorker. crbug.com/154571
WebRuntimeFeatures::enableSharedWorker(false);
// Android does not yet support NavigatorContentUtils.
@@ -105,6 +103,13 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kDisableMediaSource))
WebRuntimeFeatures::enableMediaSource(false);
+ if (command_line.HasSwitch(switches::kDisableNotifications)) {
+ WebRuntimeFeatures::enableNotifications(false);
+
+ // Chrome's Push Messaging implementation relies on Web Notifications.
+ WebRuntimeFeatures::enablePushMessaging(false);
+ }
+
if (command_line.HasSwitch(switches::kDisableSharedWorkers))
WebRuntimeFeatures::enableSharedWorker(false);
@@ -112,9 +117,6 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kDisableWebRTC))
WebRuntimeFeatures::enablePeerConnection(false);
- if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures))
- WebRuntimeFeatures::enableNotifications(true);
-
// WebAudio is enabled by default on ARM and X86, if the MediaCodec
// API is available.
WebRuntimeFeatures::enableWebAudio(
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 60d3423..c11062ce 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -194,6 +194,9 @@ const char kDisableMediaSource[] = "disable-media-source";
// Disables usage of the namespace sandbox.
const char kDisableNamespaceSandbox[] = "disable-namespace-sandbox";
+// Disables the Web Notification and the Push APIs.
+const char kDisableNotifications[] = "disable-notifications";
+
// Disable rasterizer that writes directly to GPU memory.
// Overrides the kEnableOneCopy flag.
const char kDisableOneCopy[] = "disable-one-copy";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index e678ada..2c87ae0 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -67,6 +67,7 @@ CONTENT_EXPORT extern const char kDisableLocalStorage[];
CONTENT_EXPORT extern const char kDisableLogging[];
CONTENT_EXPORT extern const char kDisableMediaSource[];
CONTENT_EXPORT extern const char kDisableNamespaceSandbox[];
+CONTENT_EXPORT extern const char kDisableNotifications[];
CONTENT_EXPORT extern const char kDisableOneCopy[];
extern const char kDisablePepper3d[];
CONTENT_EXPORT extern const char kDisablePinch[];