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

Unified Diff: cc/layer_tree_impl.cc

Issue 11550035: Implement pinch-zoom scaling for main-frame scrollbars and pinch-zoom overlay scrollbars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing files. Created 8 years 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: cc/layer_tree_impl.cc
diff --git a/cc/layer_tree_impl.cc b/cc/layer_tree_impl.cc
index d434bb0e6a2a4f78f1706fa3740720224f8bc1d0..60e85decb6cf191cb9c234784d61e7b7f177b9b9 100644
--- a/cc/layer_tree_impl.cc
+++ b/cc/layer_tree_impl.cc
@@ -6,6 +6,7 @@
#include "cc/layer_tree_host_common.h"
#include "cc/layer_tree_host_impl.h"
+#include "cc/pinch_zoom_scrollbars_manager.h"
namespace cc {
@@ -13,9 +14,13 @@ LayerTreeImpl::LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl)
: layer_tree_host_impl_(layer_tree_host_impl)
, source_frame_number_(-1)
, hud_layer_(0)
+ , pinch_zoom_scrollbar_vertical_(0)
+ , pinch_zoom_scrollbar_horizontal_(0)
, root_scroll_layer_(0)
, currently_scrolling_layer_(0)
, scrolling_layer_id_from_previous_tree_(0) {
+ if (settings().pageScalePinchZoomEnabled)
+ pinch_zoom_scrollbars_ = PinchZoomScrollbarsManager::create();
}
LayerTreeImpl::~LayerTreeImpl() {
@@ -54,6 +59,20 @@ void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) {
layer_tree_host_impl_->OnCanDrawStateChangedForTree(this);
}
+void LayerTreeImpl::set_pinch_zoom_scrollbar_vertical(ScrollbarLayerImpl* layer_impl)
+{
+ pinch_zoom_scrollbar_vertical_ = layer_impl;
+ if (pinch_zoom_scrollbars_)
+ pinch_zoom_scrollbars_->setScrollbarVertical(layer_impl);
+}
+
+void LayerTreeImpl::set_pinch_zoom_scrollbar_horizontal(ScrollbarLayerImpl* layer_impl)
+{
+ pinch_zoom_scrollbar_horizontal_ = layer_impl;
+ if (pinch_zoom_scrollbars_)
+ pinch_zoom_scrollbars_->setScrollbarHorizontal(layer_impl);
+}
+
scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() {
// Clear all data structures that have direct references to the layer tree.
scrolling_layer_id_from_previous_tree_ =

Powered by Google App Engine
This is Rietveld 408576698