| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/mouse_watcher.h" | 5 #include "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" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 break; | 70 break; |
| 71 case base::wayland::WAYLAND_POINTER_FOCUS: | 71 case base::wayland::WAYLAND_POINTER_FOCUS: |
| 72 if (!event->pointer_focus.state) | 72 if (!event->pointer_focus.state) |
| 73 HandleGlobalMouseMoveEvent(true); | 73 HandleGlobalMouseMoveEvent(true); |
| 74 break; | 74 break; |
| 75 default: | 75 default: |
| 76 break; | 76 break; |
| 77 } | 77 } |
| 78 return EVENT_CONTINUE; | 78 return EVENT_CONTINUE; |
| 79 } | 79 } |
| 80 #elif defined(TOUCH_UI) || defined(USE_AURA) | 80 #elif defined(USE_AURA) |
| 81 virtual base::EventStatus WillProcessEvent( | 81 virtual base::EventStatus WillProcessEvent( |
| 82 const base::NativeEvent& event) OVERRIDE { | 82 const base::NativeEvent& event) OVERRIDE { |
| 83 return base::EVENT_CONTINUE; | 83 return base::EVENT_CONTINUE; |
| 84 } | 84 } |
| 85 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { | 85 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { |
| 86 switch (ui::EventTypeFromNative(event)) { | 86 switch (ui::EventTypeFromNative(event)) { |
| 87 case ui::ET_MOUSE_MOVED: | 87 case ui::ET_MOUSE_MOVED: |
| 88 case ui::ET_MOUSE_DRAGGED: | 88 case ui::ET_MOUSE_DRAGGED: |
| 89 // DRAGGED is a special case of MOVED. See events_win.cc/events_x.cc. | 89 // DRAGGED is a special case of MOVED. See events_win.cc/events_x.cc. |
| 90 HandleGlobalMouseMoveEvent(false); | 90 HandleGlobalMouseMoveEvent(false); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void MouseWatcher::Stop() { | 202 void MouseWatcher::Stop() { |
| 203 observer_.reset(NULL); | 203 observer_.reset(NULL); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void MouseWatcher::NotifyListener() { | 206 void MouseWatcher::NotifyListener() { |
| 207 observer_.reset(NULL); | 207 observer_.reset(NULL); |
| 208 listener_->MouseMovedOutOfView(); | 208 listener_->MouseMovedOutOfView(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace views | 211 } // namespace views |
| OLD | NEW |