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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 2657283003: mash: make Env::last_mouse_location() accurate for Mus (Closed)
Patch Set: merge Created 3 years, 11 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index 4ccccb4cb7cd7e4d147c17046c18a30a03a4d4ac..6cd3c43e2dad9addd866098702afd9b64af79343 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -18,6 +18,7 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/env_input_state_controller.h"
+#include "ui/aura/mus/mus_mouse_location_updater.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
#include "ui/aura/window_targeter.h"
@@ -79,6 +80,8 @@ WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host)
held_event_factory_(this) {
ui::GestureRecognizer::Get()->AddGestureEventHelper(this);
Env::GetInstance()->AddObserver(this);
+ if (Env::GetInstance()->mode() == Env::Mode::MUS)
+ mus_mouse_location_updater_ = base::MakeUnique<MusMouseLocationUpdater>();
}
WindowEventDispatcher::~WindowEventDispatcher() {
@@ -423,6 +426,14 @@ void WindowEventDispatcher::OnEventProcessingStarted(ui::Event* event) {
// coordinate system to |window()|'s coordinate system.
if (event->IsLocatedEvent() && !is_dispatched_held_event(*event))
TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event));
+
+ if (mus_mouse_location_updater_)
+ mus_mouse_location_updater_->OnEventProcessingStarted(*event);
+}
+
+void WindowEventDispatcher::OnEventProcessingFinished(ui::Event* event) {
+ if (mus_mouse_location_updater_)
+ mus_mouse_location_updater_->OnEventProcessingFinished();
}
////////////////////////////////////////////////////////////////////////////////
« 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