Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: ui/aura/window_event_dispatcher.cc

Issue 552503003: Introduce EventProcessor::OnEventProcessingStarted() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sadrul comments addressed Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 void WindowEventDispatcher::ReleaseNativeCapture() { 428 void WindowEventDispatcher::ReleaseNativeCapture() {
429 host_->ReleaseCapture(); 429 host_->ReleaseCapture();
430 } 430 }
431 431
432 //////////////////////////////////////////////////////////////////////////////// 432 ////////////////////////////////////////////////////////////////////////////////
433 // WindowEventDispatcher, ui::EventProcessor implementation: 433 // WindowEventDispatcher, ui::EventProcessor implementation:
434 ui::EventTarget* WindowEventDispatcher::GetRootTarget() { 434 ui::EventTarget* WindowEventDispatcher::GetRootTarget() {
435 return window(); 435 return window();
436 } 436 }
437 437
438 void WindowEventDispatcher::PrepareEventForDispatch(ui::Event* event) { 438 void WindowEventDispatcher::OnEventProcessingStarted(ui::Event* event) {
439 if (dispatching_held_event_) { 439 // The held events are already in |window()|'s coordinate system. So it is
440 // The held events are already in |window()|'s coordinate system. So it is 440 // not necessary to apply the transform to convert from the host's
441 // not necessary to apply the transform to convert from the host's 441 // coordinate system to |window()|'s coordinate system.
442 // coordinate system to |window()|'s coordinate system. 442 if (event->IsLocatedEvent() && !dispatching_held_event_)
443 return;
444 }
445 if (event->IsLocatedEvent()) {
446 TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event)); 443 TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event));
447 }
448 } 444 }
449 445
450 //////////////////////////////////////////////////////////////////////////////// 446 ////////////////////////////////////////////////////////////////////////////////
451 // WindowEventDispatcher, ui::EventDispatcherDelegate implementation: 447 // WindowEventDispatcher, ui::EventDispatcherDelegate implementation:
452 448
453 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { 449 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) {
454 return event_dispatch_target_ == target; 450 return event_dispatch_target_ == target;
455 } 451 }
456 452
457 ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent( 453 ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent(
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 897
902 default: 898 default:
903 NOTREACHED(); 899 NOTREACHED();
904 break; 900 break;
905 } 901 }
906 902
907 PreDispatchLocatedEvent(target, event); 903 PreDispatchLocatedEvent(target, event);
908 } 904 }
909 905
910 } // namespace aura 906 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698