ChromeOS default switches cleanup - switches::kEnableThreadedCompositing and switches::kEnableSmoothScrolling should not be an option on ChromeOS anymore.
BUG=170948
TEST=existing tests
Review URL: https://chromiumcodereview.appspot.com/11938025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177859 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index bd05e5b..6191595 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -327,7 +327,7 @@
"threaded-compositing-mode",
IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
- kOsAll,
+ kOsAll & ~kOsCrOS,
MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
},
{
@@ -562,7 +562,7 @@
IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
// Can't expose the switch unless the code is compiled in.
// On by default for the Mac (different implementation in WebKit).
- kOsWin | kOsLinux | kOsCrOS,
+ kOsWin | kOsLinux,
SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
},
{
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 469da74..c1e8463 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -722,13 +722,14 @@
static const char* kForwardSwitches[] = {
::switches::kAllowWebUICompositing,
::switches::kDeviceManagementUrl,
- ::switches::kForceDeviceScaleFactor,
::switches::kDisableAccelerated2dCanvas,
::switches::kDisableAcceleratedPlugins,
::switches::kDisableAcceleratedVideoDecode,
+ ::switches::kDisableForceCompositingMode,
::switches::kDisableGpuWatchdog,
::switches::kDisableLoginAnimations,
::switches::kDisableOobeAnimation,
+ ::switches::kDisableThreadedCompositing,
::switches::kDisableSeccompFilterSandbox,
::switches::kDisableSeccompSandbox,
::switches::kEnableAcceleratedOverflowScroll,
@@ -737,11 +738,8 @@
::switches::kEnableLogging,
::switches::kEnablePinch,
::switches::kEnableGestureTapHighlight,
- ::switches::kEnableSmoothScrolling,
- ::switches::kEnableThreadedCompositing,
::switches::kEnableViewport,
- ::switches::kDisableThreadedCompositing,
- ::switches::kForceCompositingMode,
+ ::switches::kForceDeviceScaleFactor,
::switches::kGpuStartupDialog,
::switches::kHasChromeOSKeyboard,
::switches::kLoginProfile,
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 9628215..9e679b0 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -61,6 +61,12 @@
command_line.HasSwitch(switches::kDisableThreadedCompositing))
return false;
+#if defined(OS_CHROMEOS)
+ // We always want threaded compositing on ChromeOS unless it's explicitly
+ // disabled above.
+ return true;
+#endif
+
if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
return true;
@@ -88,6 +94,11 @@
if (command_line.HasSwitch(switches::kDisableForceCompositingMode))
return false;
+#if defined(OS_CHROMEOS)
+ // We always want compositing ChromeOS unless it's explicitly disabled above.
+ return true;
+#endif
+
if (command_line.HasSwitch(switches::kForceCompositingMode))
return true;
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index bb8b483..43e0215 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -47,6 +47,7 @@
#include "content/port/browser/render_widget_host_view_port.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/color_chooser.h"
+#include "content/public/browser/compositor_util.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/download_manager.h"
@@ -485,7 +486,7 @@
GpuProcessHost::gpu_enabled() &&
!command_line.HasSwitch(switches::kDisableAcceleratedCompositing);
prefs.force_compositing_mode =
- command_line.HasSwitch(switches::kForceCompositingMode) &&
+ content::IsForceCompositingModeEnabled() &&
!command_line.HasSwitch(switches::kDisableForceCompositingMode);
prefs.fixed_position_compositing_enabled =
command_line.HasSwitch(switches::kEnableCompositingForFixedPosition);
@@ -553,10 +554,9 @@
prefs.touch_adjustment_enabled =
!command_line.HasSwitch(switches::kDisableTouchAdjustment);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
bool default_enable_scroll_animator = true;
#else
- // On CrOS, the launcher always passes in the --enable flag.
bool default_enable_scroll_animator = false;
#endif
prefs.enable_scroll_animator = default_enable_scroll_animator;