| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/ui/ws/event_dispatcher.h" | 5 #include "services/ui/ws/event_dispatcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 DCHECK(event.type() == previous_event_->type() && | 281 DCHECK(event.type() == previous_event_->type() && |
| 282 event.time_stamp() == previous_event_->time_stamp() && | 282 event.time_stamp() == previous_event_->time_stamp() && |
| 283 event.flags() == previous_event_->flags()); | 283 event.flags() == previous_event_->flags()); |
| 284 DCHECK_EQ(previous_accelerator_match_phase_, AcceleratorMatchPhase::ANY); | 284 DCHECK_EQ(previous_accelerator_match_phase_, AcceleratorMatchPhase::ANY); |
| 285 } | 285 } |
| 286 previous_event_ = Event::Clone(event); | 286 previous_event_ = Event::Clone(event); |
| 287 previous_accelerator_match_phase_ = match_phase; | 287 previous_accelerator_match_phase_ = match_phase; |
| 288 #endif | 288 #endif |
| 289 if (event.IsKeyEvent()) { | 289 if (event.IsKeyEvent()) { |
| 290 const ui::KeyEvent* key_event = event.AsKeyEvent(); | 290 const ui::KeyEvent* key_event = event.AsKeyEvent(); |
| 291 if (event.type() == ui::ET_KEY_PRESSED && !key_event->is_char() && | 291 if (!key_event->is_char() && match_phase == AcceleratorMatchPhase::ANY) { |
| 292 match_phase == AcceleratorMatchPhase::ANY) { | |
| 293 Accelerator* pre_target = | 292 Accelerator* pre_target = |
| 294 FindAccelerator(*key_event, ui::mojom::AcceleratorPhase::PRE_TARGET); | 293 FindAccelerator(*key_event, ui::mojom::AcceleratorPhase::PRE_TARGET); |
| 295 if (pre_target) { | 294 if (pre_target) { |
| 296 delegate_->OnAccelerator( | 295 delegate_->OnAccelerator( |
| 297 pre_target->id(), event, | 296 pre_target->id(), event, |
| 298 EventDispatcherDelegate::AcceleratorPhase::PRE); | 297 EventDispatcherDelegate::AcceleratorPhase::PRE); |
| 299 return; | 298 return; |
| 300 } | 299 } |
| 301 } | 300 } |
| 302 ProcessKeyEvent(*key_event, match_phase); | 301 ProcessKeyEvent(*key_event, match_phase); |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 if (mouse_cursor_source_window_ == window) | 652 if (mouse_cursor_source_window_ == window) |
| 654 SetMouseCursorSourceWindow(nullptr); | 653 SetMouseCursorSourceWindow(nullptr); |
| 655 } | 654 } |
| 656 | 655 |
| 657 void EventDispatcher::OnDragCursorUpdated() { | 656 void EventDispatcher::OnDragCursorUpdated() { |
| 658 delegate_->UpdateNativeCursorFromDispatcher(); | 657 delegate_->UpdateNativeCursorFromDispatcher(); |
| 659 } | 658 } |
| 660 | 659 |
| 661 } // namespace ws | 660 } // namespace ws |
| 662 } // namespace ui | 661 } // namespace ui |
| OLD | NEW |