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

Unified Diff: ui/views/mouse_watcher.cc

Issue 753933003: Dismiss the multi window resizer when the user clicks outside of the resizer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@toplevel_consume_press
Patch Set: Created 6 years 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
« no previous file with comments | « ui/views/mouse_watcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mouse_watcher.cc
diff --git a/ui/views/mouse_watcher.cc b/ui/views/mouse_watcher.cc
index 85941b5bdc95c81f27025bbd54d61f1d46d1bdce..676dc8bbca8e5425ca9a9048c9663c9819609c84 100644
--- a/ui/views/mouse_watcher.cc
+++ b/ui/views/mouse_watcher.cc
@@ -39,6 +39,9 @@ class MouseWatcher::Observer : public ui::EventHandler {
case ui::ET_MOUSE_EXITED:
HandleMouseEvent(MouseWatcherHost::MOUSE_EXIT);
break;
+ case ui::ET_MOUSE_PRESSED:
+ HandleMouseEvent(MouseWatcherHost::MOUSE_PRESS);
+ break;
default:
break;
}
@@ -52,9 +55,11 @@ class MouseWatcher::Observer : public ui::EventHandler {
// It's safe to use last_mouse_location() here as this function is invoked
// during event dispatching.
if (!host()->Contains(EventMonitor::GetLastMouseLocation(), event_type)) {
- // Mouse moved outside the host's zone, start a timer to notify the
- // listener.
- if (!notify_listener_factory_.HasWeakPtrs()) {
+ if (event_type == MouseWatcherHost::MOUSE_PRESS) {
+ NotifyListener();
+ } else if (!notify_listener_factory_.HasWeakPtrs()) {
+ // Mouse moved outside the host's zone, start a timer to notify the
+ // listener.
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&Observer::NotifyListener,
« no previous file with comments | « ui/views/mouse_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698