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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Address comments. Created 3 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: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index edf102efdb5e1ec07e1072c7d14b79e42cf6c9d1..d39d30e88850b76d3117aa67942ae963ea3f7133 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -616,8 +616,24 @@ LayerTreeHostImpl::EventListenerTypeForTouchStartAt(
LayerImpl* layer_impl =
active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion(
device_viewport_point);
- if (layer_impl == NULL)
+ if (layer_impl == NULL) {
+ // At present, TouchHandlerRegions are only set for LayerTrees serving the
+ // document's mainframe, i.e. LayerTrees that have a ViewPort defined. But
+ // subframes can still have touch handlers, so here we err on the side of
+ // caution and report a handler even if we don't know which layer it's on.
+ // This code can be removed once ScrollingCoordinator is per-compositor
+ // rather than per-page, https://crbug.com/680606, since a per-compositor
+ // version will correctly send touch-rects for non-mainframes.
+ EventListenerProperties properties =
+ active_tree_->event_listener_properties(
+ EventListenerClass::kTouchStartOrMove);
+ if ((properties == EventListenerProperties::kBlocking ||
+ properties == EventListenerProperties::kBlockingAndPassive) &&
+ !active_tree_->OuterViewportScrollLayer()) {
+ return InputHandler::TouchStartEventListenerType::HANDLER;
+ }
return InputHandler::TouchStartEventListenerType::NO_HANDLER;
+ }
if (!CurrentlyScrollingLayer())
return InputHandler::TouchStartEventListenerType::HANDLER;
@@ -2995,6 +3011,7 @@ void LayerTreeHostImpl::ApplyScroll(ScrollNode* scroll_node,
// we want to scroll the inner viewport -- to allow panning while zoomed --
// but also move browser controls if needed.
bool is_inner_viewport_scroll_layer =
+ InnerViewportScrollLayer() &&
scroll_node->owning_layer_id == InnerViewportScrollLayer()->id();
if (is_viewport_scroll_layer || is_inner_viewport_scroll_layer) {

Powered by Google App Engine
This is Rietveld 408576698