Index: cc/layer_tree_settings.cc |
diff --git a/cc/layer_tree_settings.cc b/cc/layer_tree_settings.cc |
index 4221167c29fa139a0ed67d473ea6deccda6bc79e..550adfd09360ca50378f77ffef2a97e2e1f1ff89 100644 |
--- a/cc/layer_tree_settings.cc |
+++ b/cc/layer_tree_settings.cc |
@@ -26,6 +26,7 @@ LayerTreeSettings::LayerTreeSettings() |
, showOverdrawInTracing(false) |
, canUseLCDText(true) |
, shouldClearRootRenderPass(true) |
+ , calculateTopControlsPosition(false) |
, refreshRate(0) |
, maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) |
, numRasterThreads(1) |
@@ -40,6 +41,19 @@ LayerTreeSettings::LayerTreeSettings() |
backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(switches::kBackgroundColorInsteadOfCheckerboard); |
showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceOverdraw); |
+ calculateTopControlsPosition = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableTopControlsPositionCalculation); |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight)) { |
+ std::string controls_height_str = |
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTopControlsHeight); |
+ int controls_height; |
+ if (base::StringToInt(controls_height_str, &controls_height) && controls_height > 0) |
+ topControlsHeight = controls_height; |
+ } |
+ if (calculateTopControlsPosition && (topControlsHeight <= 0 || !compositorFrameMessage)) { |
+ DCHECK(false) << "Top controls repositioning enabled without valid height or compositorFrameMessage set."; |
+ calculateTopControlsPosition = false; |
+ } |
+ |
// TODO(alokp): Remove this hard-coded setting. |
// Platforms that need to disable LCD text must explicitly set this value. |
#if defined(OS_ANDROID) |