| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/runtime_features.h" | 5 #include "content/child/runtime_features.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| 11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/common/content_switches_internal.h" | 15 #include "content/common/content_switches_internal.h" |
| 16 #include "content/public/common/content_features.h" | 16 #include "content/public/common/content_features.h" |
| 17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 19 #include "ui/gl/gl_switches.h" | 19 #include "ui/gl/gl_switches.h" |
| 20 #include "ui/native_theme/native_theme_switches.h" | 20 #include "ui/native_theme/native_theme_switches.h" |
| 21 | 21 |
| 22 using blink::WebRuntimeFeatures; | 22 using blink::WebRuntimeFeatures; |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 static void SetRuntimeFeatureDefaultsForPlatform() { | 26 static void SetRuntimeFeatureDefaultsForPlatform() { |
| 27 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
| 28 // Android does not have support for PagePopup | 28 // Android does not have support for PagePopup |
| 29 WebRuntimeFeatures::enablePagePopup(false); | 29 WebRuntimeFeatures::enablePagePopupa(false); |
| 30 // No plan to support complex UI for date/time INPUT types. | 30 // No plan to support complex UI for date/time INPUT types. |
| 31 WebRuntimeFeatures::enableInputMultipleFieldsUI(false); | 31 WebRuntimeFeatures::enableInputMultipleFieldsUI(false); |
| 32 // Android does not yet support SharedWorker. crbug.com/154571 | 32 // Android does not yet support SharedWorker. crbug.com/154571 |
| 33 WebRuntimeFeatures::enableSharedWorker(false); | 33 WebRuntimeFeatures::enableSharedWorker(false); |
| 34 // Android does not yet support NavigatorContentUtils. | 34 // Android does not yet support NavigatorContentUtils. |
| 35 WebRuntimeFeatures::enableNavigatorContentUtils(false); | 35 WebRuntimeFeatures::enableNavigatorContentUtils(false); |
| 36 WebRuntimeFeatures::enableOrientationEvent(true); | 36 WebRuntimeFeatures::enableOrientationEvent(true); |
| 37 WebRuntimeFeatures::enableFastMobileScrolling(true); | 37 WebRuntimeFeatures::enableFastMobileScrolling(true); |
| 38 WebRuntimeFeatures::enableMediaCapture(true); | 38 WebRuntimeFeatures::enableMediaCapture(true); |
| 39 // Android won't be able to reliably support non-persistent notifications, the | 39 // Android won't be able to reliably support non-persistent notifications, the |
| 40 // intended behavior for which is in flux by itself. | 40 // intended behavior for which is in flux by itself. |
| 41 WebRuntimeFeatures::enableNotificationConstructor(false); | 41 WebRuntimeFeatures::enableNotificationConstructor(false); |
| 42 // Android does not yet support switching of audio output devices | 42 // Android does not yet support switching of audio output devices |
| 43 WebRuntimeFeatures::enableAudioOutputDevices(false); | 43 WebRuntimeFeatures::enableAudioOutputDevices(false); |
| 44 WebRuntimeFeatures::enableAutoplayMutedVideos(true); | 44 WebRuntimeFeatures::enableAutoplayMutedVideos(true); |
| 45 // Android does not yet support SystemMonitor. | 45 // Android does not yet support SystemMonitor. |
| 46 WebRuntimeFeatures::enableOnDeviceChange(false); | 46 WebRuntimeFeatures::enableOnDeviceChange(false); |
| 47 WebRuntimeFeatures::enableMediaSession(true); | 47 WebRuntimeFeatures::enableMediaSession(true); |
| 48 WebRuntimeFeatures::enableMediaControlsOverlayPlayButton(true); |
| 48 #else // defined(OS_ANDROID) | 49 #else // defined(OS_ANDROID) |
| 49 WebRuntimeFeatures::enableNavigatorContentUtils(true); | 50 WebRuntimeFeatures::enableNavigatorContentUtils(true); |
| 50 if (base::FeatureList::IsEnabled( | 51 if (base::FeatureList::IsEnabled( |
| 51 features::kCrossOriginMediaPlaybackRequiresUserGesture)) { | 52 features::kCrossOriginMediaPlaybackRequiresUserGesture)) { |
| 52 WebRuntimeFeatures::enableAutoplayMutedVideos(true); | 53 WebRuntimeFeatures::enableAutoplayMutedVideos(true); |
| 53 } | 54 } |
| 54 #endif // defined(OS_ANDROID) | 55 #endif // defined(OS_ANDROID) |
| 55 | 56 |
| 56 #if defined(OS_ANDROID) || defined(USE_AURA) | 57 #if defined(OS_ANDROID) || defined(USE_AURA) |
| 57 WebRuntimeFeatures::enableCompositedSelectionUpdate(true); | 58 WebRuntimeFeatures::enableCompositedSelectionUpdate(true); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 381 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 381 std::vector<std::string> disabled_features = base::SplitString( | 382 std::vector<std::string> disabled_features = base::SplitString( |
| 382 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 383 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 383 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 384 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 384 for (const std::string& feature : disabled_features) | 385 for (const std::string& feature : disabled_features) |
| 385 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 386 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 386 } | 387 } |
| 387 } | 388 } |
| 388 | 389 |
| 389 } // namespace content | 390 } // namespace content |
| OLD | NEW |