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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 2651753003: Wires up ShouldDescendIntoChildForEventHandling() for DesktopNativeWidgetAura (Closed)
Patch Set: improve 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: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 75bccedd68f0d07514a91cf98e1a6f3eb98c40aa..8082fb5a3f3c295563e9e92fbd9c92da36ca445d 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -819,36 +819,8 @@ int NativeWidgetAura::GetNonClientComponent(const gfx::Point& point) const {
bool NativeWidgetAura::ShouldDescendIntoChildForEventHandling(
aura::Window* child,
const gfx::Point& location) {
- views::WidgetDelegate* widget_delegate = GetWidget()->widget_delegate();
- if (widget_delegate &&
- !widget_delegate->ShouldDescendIntoChildForEventHandling(child, location))
- return false;
-
- // Don't descend into |child| if there is a view with a Layer that contains
- // the point and is stacked above |child|s layer.
- typedef std::vector<ui::Layer*> Layers;
- const Layers& root_layers(delegate_->GetRootLayers());
- if (root_layers.empty())
- return true;
-
- Layers::const_iterator child_layer_iter(
- std::find(window_->layer()->children().begin(),
- window_->layer()->children().end(), child->layer()));
- if (child_layer_iter == window_->layer()->children().end())
- return true;
-
- for (std::vector<ui::Layer*>::const_reverse_iterator i = root_layers.rbegin();
- i != root_layers.rend(); ++i) {
- ui::Layer* layer = *i;
- if (layer->visible() && layer->bounds().Contains(location)) {
- Layers::const_iterator root_layer_iter(
- std::find(window_->layer()->children().begin(),
- window_->layer()->children().end(), layer));
- if (root_layer_iter > child_layer_iter)
- return false;
- }
- }
- return true;
+ return delegate_->ShouldDescendIntoChildForEventHandling(
+ window_->layer(), child, child->layer(), location);
}
bool NativeWidgetAura::CanFocus() {
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | ui/views/widget/native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698