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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Check for layerTreeView while setting handlers. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 LayerTreeHostImpl::EventListenerTypeForTouchStartAt( 603 LayerTreeHostImpl::EventListenerTypeForTouchStartAt(
604 const gfx::Point& viewport_point) { 604 const gfx::Point& viewport_point) {
605 gfx::PointF device_viewport_point = gfx::ScalePoint( 605 gfx::PointF device_viewport_point = gfx::ScalePoint(
606 gfx::PointF(viewport_point), active_tree_->device_scale_factor()); 606 gfx::PointF(viewport_point), active_tree_->device_scale_factor());
607 607
608 // Now determine if there are actually any handlers at that point. 608 // Now determine if there are actually any handlers at that point.
609 // TODO(rbyers): Consider also honoring touch-action (crbug.com/347272). 609 // TODO(rbyers): Consider also honoring touch-action (crbug.com/347272).
610 LayerImpl* layer_impl = 610 LayerImpl* layer_impl =
611 active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion( 611 active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion(
612 device_viewport_point); 612 device_viewport_point);
613 if (layer_impl == NULL) 613 if (layer_impl == NULL) {
614 // At present, TouchHandlerRegions are only set for LayerTrees serving the
615 // document's mainframe, i.e. LayerTrees that have a ViewPort defined. But
616 // subframes can still have touch handlers, so here we err on the side of
617 // caution and report a handler even if we don't know which layer it's on.
618 if ((active_tree_->event_listener_properties(
619 EventListenerClass::kTouchStartOrMove) ==
620 EventListenerProperties::kBlocking) &&
621 !active_tree_->OuterViewportScrollLayer()) {
622 return InputHandler::TouchStartEventListenerType::HANDLER;
623 }
614 return InputHandler::TouchStartEventListenerType::NO_HANDLER; 624 return InputHandler::TouchStartEventListenerType::NO_HANDLER;
625 }
615 626
616 if (!CurrentlyScrollingLayer()) 627 if (!CurrentlyScrollingLayer())
617 return InputHandler::TouchStartEventListenerType::HANDLER; 628 return InputHandler::TouchStartEventListenerType::HANDLER;
618 629
619 bool is_ancestor = 630 bool is_ancestor =
620 IsScrolledBy(layer_impl, active_tree_->CurrentlyScrollingLayer()); 631 IsScrolledBy(layer_impl, active_tree_->CurrentlyScrollingLayer());
621 return is_ancestor ? InputHandler::TouchStartEventListenerType:: 632 return is_ancestor ? InputHandler::TouchStartEventListenerType::
622 HANDLER_ON_SCROLLING_LAYER 633 HANDLER_ON_SCROLLING_LAYER
623 : InputHandler::TouchStartEventListenerType::HANDLER; 634 : InputHandler::TouchStartEventListenerType::HANDLER;
624 } 635 }
(...skipping 3464 matching lines...) Expand 10 before | Expand all | Expand 10 after
4089 worker_context_visibility_ = 4100 worker_context_visibility_ =
4090 worker_context->CacheController()->ClientBecameVisible(); 4101 worker_context->CacheController()->ClientBecameVisible();
4091 } else { 4102 } else {
4092 worker_context->CacheController()->ClientBecameNotVisible( 4103 worker_context->CacheController()->ClientBecameNotVisible(
4093 std::move(worker_context_visibility_)); 4104 std::move(worker_context_visibility_));
4094 } 4105 }
4095 } 4106 }
4096 } 4107 }
4097 4108
4098 } // namespace cc 4109 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/browser/site_per_process_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698