Chromium Code Reviews| 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_); |