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 fraction_of_time_without_user_input_recorder_.RecordEventAtTime( | |
499 event->time_stamp()); | |
sadrul
2017/03/19 00:38:51
Do you care whether the event is actually coming f
tdresser
2017/03/24 14:56:30
Done.
| |
500 | |
498 if (!dispatching_held_event_) { | 501 if (!dispatching_held_event_) { |
499 bool can_be_held = IsEventCandidateForHold(*event); | 502 bool can_be_held = IsEventCandidateForHold(*event); |
500 if (!move_hold_count_ || !can_be_held) { | 503 if (!move_hold_count_ || !can_be_held) { |
501 if (can_be_held) | 504 if (can_be_held) |
502 held_move_event_.reset(); | 505 held_move_event_.reset(); |
503 DispatchDetails details = DispatchHeldEvents(); | 506 DispatchDetails details = DispatchHeldEvents(); |
504 if (details.dispatcher_destroyed || details.target_destroyed) | 507 if (details.dispatcher_destroyed || details.target_destroyed) |
505 return details; | 508 return details; |
506 } | 509 } |
507 } | 510 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
916 } | 919 } |
917 | 920 |
918 // This flag is set depending on the gestures recognized in the call above, | 921 // This flag is set depending on the gestures recognized in the call above, |
919 // and needs to propagate with the forwarded event. | 922 // and needs to propagate with the forwarded event. |
920 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 923 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
921 | 924 |
922 return PreDispatchLocatedEvent(target, event); | 925 return PreDispatchLocatedEvent(target, event); |
923 } | 926 } |
924 | 927 |
925 } // namespace aura | 928 } // namespace aura |
OLD | NEW |