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

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

Issue 10831361: Draggable region support for frameless app window on CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ShouldDescendIntoChildForEventHandling Created 8 years, 4 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 fa5ee73435153f5ad777d550dad7bef87e13aa8a..d2fd5e181bdd10a2498fb9cad27987dceeb6b4be 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -760,7 +760,14 @@ int NativeWidgetAura::GetNonClientComponent(const gfx::Point& point) const {
bool NativeWidgetAura::ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) {
+ const gfx::Point& event_location,
+ ui::EventType event_type) {
+ views::WidgetDelegate* widget_delegate = GetWidget()->widget_delegate();
+ if (widget_delegate &&
+ !widget_delegate->ShouldDescendIntoChildForEventHandling(
+ child, event_location, event_type))
+ 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;
@@ -777,7 +784,7 @@ bool NativeWidgetAura::ShouldDescendIntoChildForEventHandling(
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)) {
+ if (layer->visible() && layer->bounds().Contains(event_location)) {
Layers::const_iterator root_layer_iter(
std::find(window_->layer()->children().begin(),
window_->layer()->children().end(), layer));

Powered by Google App Engine
This is Rietveld 408576698