Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: webkit/compositor_bindings/web_layer_tree_view_impl.cc

Issue 11552009: Add support for calculating the position of the top controls in the cc layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove auto-hide per UX decision. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/compositor_bindings/web_layer_tree_view_impl.cc
diff --git a/webkit/compositor_bindings/web_layer_tree_view_impl.cc b/webkit/compositor_bindings/web_layer_tree_view_impl.cc
index 85a0fec8575d29a649066c7c4c397bae7a1f5657..69181912f56dfc8d1c4ea0a3ba2cd4147a3e11d5 100644
--- a/webkit/compositor_bindings/web_layer_tree_view_impl.cc
+++ b/webkit/compositor_bindings/web_layer_tree_view_impl.cc
@@ -5,6 +5,7 @@
#include "web_layer_tree_view_impl.h"
#include "base/command_line.h"
+#include "base/string_number_conversions.h"
#include "cc/font_atlas.h"
#include "cc/input_handler.h"
#include "cc/layer.h"
@@ -50,6 +51,20 @@ bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti
settings.initialDebugState.showPaintRects = webSettings.showPaintRects;
settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformLayerTree;
settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders;
+
+ settings.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)
+ settings.topControlsHeightPx = controls_height;
+ }
+ if (settings.calculateTopControlsPosition && (settings.topControlsHeightPx <= 0 || !settings.compositorFrameMessage)) {
+ DCHECK(false) << "Top controls repositioning enabled without valid height or compositorFrameMessage set.";
+ settings.calculateTopControlsPosition = false;
+ }
+
m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass());
if (!m_layerTreeHost.get())
return false;

Powered by Google App Engine
This is Rietveld 408576698