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

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 a55ffd5e1510f50fc8f977ab468e19d3aa3b191b..4bcdfe5e225e5ba5d01319c37b64f8d2d3b4a0bb 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;
}
@@ -54,11 +57,12 @@ class MouseWatcher::Observer : public ui::EventHandler {
if (!host()->Contains(EventMonitor::GetLastMouseLocation(), event_type)) {
// Mouse moved outside the host's zone, start a timer to notify the
sky 2014/12/10 15:51:36 Update comment.
pkotwicz 2014/12/10 18:38:27 I have moved the comment into the else statement
// listener.
- if (!notify_listener_factory_.HasWeakPtrs()) {
+ if (event_type == MouseWatcherHost::MOUSE_PRESS) {
+ NotifyListener();
sky 2014/12/10 15:51:36 Did you look at all listeners and make sure they r
pkotwicz 2014/12/10 18:38:28 I have not found any cases where notifying the lis
+ } else {
base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&Observer::NotifyListener,
- notify_listener_factory_.GetWeakPtr()),
+ FROM_HERE, base::Bind(&Observer::NotifyListener,
+ notify_listener_factory_.GetWeakPtr()),
event_type == MouseWatcherHost::MOUSE_MOVE
? base::TimeDelta::FromMilliseconds(kNotifyListenerTimeMs)
: mouse_watcher_->notify_on_exit_time_);
« 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