| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 //////////////////////////////////////////////////////////////////////////////// | 417 //////////////////////////////////////////////////////////////////////////////// |
| 418 // WindowEventDispatcher, ui::EventProcessor implementation: | 418 // WindowEventDispatcher, ui::EventProcessor implementation: |
| 419 ui::EventTarget* WindowEventDispatcher::GetRootTarget() { | 419 ui::EventTarget* WindowEventDispatcher::GetRootTarget() { |
| 420 return window(); | 420 return window(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void WindowEventDispatcher::OnEventProcessingStarted(ui::Event* event) { | 423 void WindowEventDispatcher::OnEventProcessingStarted(ui::Event* event) { |
| 424 // The held events are already in |window()|'s coordinate system. So it is | 424 // The held events are already in |window()|'s coordinate system. So it is |
| 425 // not necessary to apply the transform to convert from the host's | 425 // not necessary to apply the transform to convert from the host's |
| 426 // coordinate system to |window()|'s coordinate system. | 426 // coordinate system to |window()|'s coordinate system. |
| 427 if (event->IsLocatedEvent() && !is_dispatched_held_event(*event)) | 427 if (event->IsLocatedEvent() && !is_dispatched_held_event(*event) && |
| 428 Env::GetInstance()->mode() == Env::Mode::LOCAL) { |
| 428 TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event)); | 429 TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event)); |
| 430 } |
| 429 | 431 |
| 430 if (mus_mouse_location_updater_) | 432 if (mus_mouse_location_updater_) |
| 431 mus_mouse_location_updater_->OnEventProcessingStarted(*event); | 433 mus_mouse_location_updater_->OnEventProcessingStarted(*event); |
| 432 } | 434 } |
| 433 | 435 |
| 434 void WindowEventDispatcher::OnEventProcessingFinished(ui::Event* event) { | 436 void WindowEventDispatcher::OnEventProcessingFinished(ui::Event* event) { |
| 435 if (mus_mouse_location_updater_) | 437 if (mus_mouse_location_updater_) |
| 436 mus_mouse_location_updater_->OnEventProcessingFinished(); | 438 mus_mouse_location_updater_->OnEventProcessingFinished(); |
| 437 } | 439 } |
| 438 | 440 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 } | 872 } |
| 871 | 873 |
| 872 // This flag is set depending on the gestures recognized in the call above, | 874 // This flag is set depending on the gestures recognized in the call above, |
| 873 // and needs to propagate with the forwarded event. | 875 // and needs to propagate with the forwarded event. |
| 874 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 876 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
| 875 | 877 |
| 876 return PreDispatchLocatedEvent(target, event); | 878 return PreDispatchLocatedEvent(target, event); |
| 877 } | 879 } |
| 878 | 880 |
| 879 } // namespace aura | 881 } // namespace aura |
| OLD | NEW |