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

Side by Side Diff: ash/wm/resize_handle_window_targeter.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/wm/resize_handle_window_targeter.h" 5 #include "ash/wm/resize_handle_window_targeter.h"
6 6
7 #include "ash/ash_constants.h" 7 #include "ash/ash_constants.h"
8 #include "ash/wm/immersive_fullscreen_controller.h" 8 #include "ash/wm/immersive_fullscreen_controller.h"
9 #include "ash/wm/window_state.h" 9 #include "ash/wm/window_state.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 insets = gfx::Insets(kImmersiveFullscreenTopEdgeInset, 0, 0, 0); 66 insets = gfx::Insets(kImmersiveFullscreenTopEdgeInset, 0, 0, 0);
67 } else { 67 } else {
68 // If the event falls very close to the inside of the frame border, then 68 // If the event falls very close to the inside of the frame border, then
69 // target the window itself, so that the window can be resized easily. 69 // target the window itself, so that the window can be resized easily.
70 insets = frame_border_inset_; 70 insets = frame_border_inset_;
71 } 71 }
72 72
73 if (!insets.empty()) { 73 if (!insets.empty()) {
74 gfx::Rect bounds = gfx::Rect(window_->bounds().size()); 74 gfx::Rect bounds = gfx::Rect(window_->bounds().size());
75 bounds.Inset(insets); 75 bounds.Inset(insets);
76 if (!bounds.Contains(event->location())) 76 if (!bounds.Contains(gfx::ToFlooredPoint(event->location())))
77 return window_; 77 return window_;
78 } 78 }
79 } 79 }
80 return aura::WindowTargeter::FindTargetForLocatedEvent(root, event); 80 return aura::WindowTargeter::FindTargetForLocatedEvent(root, event);
81 } 81 }
82 82
83 bool ResizeHandleWindowTargeter::SubtreeShouldBeExploredForEvent( 83 bool ResizeHandleWindowTargeter::SubtreeShouldBeExploredForEvent(
84 ui::EventTarget* target, 84 ui::EventTarget* target,
85 const ui::LocatedEvent& event) { 85 const ui::LocatedEvent& event) {
86 if (target == window_) { 86 if (target == window_) {
87 // Defer to the parent's targeter on whether |window_| should be able to 87 // Defer to the parent's targeter on whether |window_| should be able to
88 // receive the event. 88 // receive the event.
89 ui::EventTarget* parent = target->GetParentTarget(); 89 ui::EventTarget* parent = target->GetParentTarget();
90 if (parent) { 90 if (parent) {
91 ui::EventTargeter* targeter = parent->GetEventTargeter(); 91 ui::EventTargeter* targeter = parent->GetEventTargeter();
92 if (targeter) 92 if (targeter)
93 return targeter->SubtreeShouldBeExploredForEvent(target, event); 93 return targeter->SubtreeShouldBeExploredForEvent(target, event);
94 } 94 }
95 } 95 }
96 return aura::WindowTargeter::SubtreeShouldBeExploredForEvent(target, event); 96 return aura::WindowTargeter::SubtreeShouldBeExploredForEvent(target, event);
97 } 97 }
98 98
99 } // namespace ash 99 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698