| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/pointer_watcher_delegate_aura.h" | 5 #include "ash/pointer_watcher_delegate_aura.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ui/aura/client/screen_position_client.h" | 8 #include "ui/aura/client/screen_position_client.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) { | 47 if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) { |
| 48 FOR_EACH_OBSERVER(views::PointerWatcher, non_move_watchers_, | 48 FOR_EACH_OBSERVER(views::PointerWatcher, non_move_watchers_, |
| 49 OnMouseCaptureChanged()); | 49 OnMouseCaptureChanged()); |
| 50 FOR_EACH_OBSERVER(views::PointerWatcher, move_watchers_, | 50 FOR_EACH_OBSERVER(views::PointerWatcher, move_watchers_, |
| 51 OnMouseCaptureChanged()); | 51 OnMouseCaptureChanged()); |
| 52 return; | 52 return; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // For compatibility with the mus version, don't send drags. | 55 // For compatibility with the mus version, don't send drags. |
| 56 if (event->type() != ui::ET_MOUSE_PRESSED && | 56 if (event->type() != ui::ET_MOUSE_PRESSED && |
| 57 event->type() != ui::ET_MOUSE_RELEASED && | 57 event->type() != ui::ET_MOUSE_RELEASED) |
| 58 event->type() != ui::ET_MOUSE_MOVED) | |
| 59 return; | 58 return; |
| 60 | 59 |
| 61 DCHECK(ui::PointerEvent::CanConvertFrom(*event)); | 60 DCHECK(ui::PointerEvent::CanConvertFrom(*event)); |
| 62 NotifyWatchers(ui::PointerEvent(*event), *event); | 61 NotifyWatchers(ui::PointerEvent(*event), *event); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void PointerWatcherDelegateAura::OnTouchEvent(ui::TouchEvent* event) { | 64 void PointerWatcherDelegateAura::OnTouchEvent(ui::TouchEvent* event) { |
| 66 // For compatibility with the mus version, don't send drags. | 65 // For compatibility with the mus version, don't send drags. |
| 67 if (event->type() != ui::ET_TOUCH_PRESSED && | 66 if (event->type() != ui::ET_TOUCH_PRESSED && |
| 68 event->type() != ui::ET_TOUCH_RELEASED) | 67 event->type() != ui::ET_TOUCH_RELEASED) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 96 views::PointerWatcher, move_watchers_, | 95 views::PointerWatcher, move_watchers_, |
| 97 OnPointerEventObserved(event, screen_location, target_widget)); | 96 OnPointerEventObserved(event, screen_location, target_widget)); |
| 98 if (event.type() != ui::ET_POINTER_MOVED) { | 97 if (event.type() != ui::ET_POINTER_MOVED) { |
| 99 FOR_EACH_OBSERVER( | 98 FOR_EACH_OBSERVER( |
| 100 views::PointerWatcher, non_move_watchers_, | 99 views::PointerWatcher, non_move_watchers_, |
| 101 OnPointerEventObserved(event, screen_location, target_widget)); | 100 OnPointerEventObserved(event, screen_location, target_widget)); |
| 102 } | 101 } |
| 103 } | 102 } |
| 104 | 103 |
| 105 } // namespace ash | 104 } // namespace ash |
| OLD | NEW |