OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/aura/window_event_dispatcher.h" | 5 #include "ui/aura/window_event_dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { | 488 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { |
489 return event_dispatch_target_ == target; | 489 return event_dispatch_target_ == target; |
490 } | 490 } |
491 | 491 |
492 ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent( | 492 ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent( |
493 ui::EventTarget* target, | 493 ui::EventTarget* target, |
494 ui::Event* event) { | 494 ui::Event* event) { |
495 Window* target_window = static_cast<Window*>(target); | 495 Window* target_window = static_cast<Window*>(target); |
496 CHECK(window()->Contains(target_window)); | 496 CHECK(window()->Contains(target_window)); |
497 | 497 |
| 498 if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) { |
| 499 fraction_of_time_without_user_input_recorder_.RecordEventAtTime( |
| 500 event->time_stamp()); |
| 501 } |
| 502 |
498 if (!dispatching_held_event_) { | 503 if (!dispatching_held_event_) { |
499 bool can_be_held = IsEventCandidateForHold(*event); | 504 bool can_be_held = IsEventCandidateForHold(*event); |
500 if (!move_hold_count_ || !can_be_held) { | 505 if (!move_hold_count_ || !can_be_held) { |
501 if (can_be_held) | 506 if (can_be_held) |
502 held_move_event_.reset(); | 507 held_move_event_.reset(); |
503 DispatchDetails details = DispatchHeldEvents(); | 508 DispatchDetails details = DispatchHeldEvents(); |
504 if (details.dispatcher_destroyed || details.target_destroyed) | 509 if (details.dispatcher_destroyed || details.target_destroyed) |
505 return details; | 510 return details; |
506 } | 511 } |
507 } | 512 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 } | 921 } |
917 | 922 |
918 // This flag is set depending on the gestures recognized in the call above, | 923 // This flag is set depending on the gestures recognized in the call above, |
919 // and needs to propagate with the forwarded event. | 924 // and needs to propagate with the forwarded event. |
920 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 925 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
921 | 926 |
922 return PreDispatchLocatedEvent(target, event); | 927 return PreDispatchLocatedEvent(target, event); |
923 } | 928 } |
924 | 929 |
925 } // namespace aura | 930 } // namespace aura |
OLD | NEW |