| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/mouse_watcher.h" | 5 #include "ui/views/mouse_watcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "ui/base/events.h" | 12 #include "ui/base/events/event_constants.h" |
| 13 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 | 16 |
| 17 // Amount of time between when the mouse moves outside the Host's zone and when | 17 // Amount of time between when the mouse moves outside the Host's zone and when |
| 18 // the listener is notified. | 18 // the listener is notified. |
| 19 const int kNotifyListenerTimeMs = 300; | 19 const int kNotifyListenerTimeMs = 300; |
| 20 | 20 |
| 21 class MouseWatcher::Observer : public MessageLoopForUI::Observer { | 21 class MouseWatcher::Observer : public MessageLoopForUI::Observer { |
| 22 public: | 22 public: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void MouseWatcher::Stop() { | 145 void MouseWatcher::Stop() { |
| 146 observer_.reset(NULL); | 146 observer_.reset(NULL); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void MouseWatcher::NotifyListener() { | 149 void MouseWatcher::NotifyListener() { |
| 150 observer_.reset(NULL); | 150 observer_.reset(NULL); |
| 151 listener_->MouseMovedOutOfHost(); | 151 listener_->MouseMovedOutOfHost(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace views | 154 } // namespace views |
| OLD | NEW |