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

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: tests added, CL for review Created 6 years, 3 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
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 bool 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 } 444
445 return true;
448 } 446 }
449 447
450 //////////////////////////////////////////////////////////////////////////////// 448 ////////////////////////////////////////////////////////////////////////////////
451 // WindowEventDispatcher, ui::EventDispatcherDelegate implementation: 449 // WindowEventDispatcher, ui::EventDispatcherDelegate implementation:
452 450
453 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { 451 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) {
454 return event_dispatch_target_ == target; 452 return event_dispatch_target_ == target;
455 } 453 }
456 454
457 ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent( 455 ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent(
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 899
902 default: 900 default:
903 NOTREACHED(); 901 NOTREACHED();
904 break; 902 break;
905 } 903 }
906 904
907 PreDispatchLocatedEvent(target, event); 905 PreDispatchLocatedEvent(target, event);
908 } 906 }
909 907
910 } // namespace aura 908 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698