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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 2854663002: Make EnvInputStateController owned by aura::Env. (Closed)
Patch Set: Created 3 years, 8 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') | no next file » | 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 559c9524748a85e10b0cb0fc40780d28baeb5aef..3f2ccddae1d0255a080fa3da0004b1860b460afc 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -91,7 +91,6 @@ WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host)
move_hold_count_(0),
dispatching_held_event_(nullptr),
observer_manager_(this),
- env_controller_(new EnvInputStateController),
event_targeter_(new WindowTargeter),
repost_event_factory_(this),
held_event_factory_(this) {
@@ -230,7 +229,8 @@ void WindowEventDispatcher::OnHostLostMouseGrab() {
void WindowEventDispatcher::OnCursorMovedToRootLocation(
const gfx::Point& root_location) {
- env_controller_->SetLastMouseLocation(window(), root_location);
+ Env::GetInstance()->env_controller()->SetLastMouseLocation(window(),
+ root_location);
// Synthesize a mouse move in case the cursor's location in root coordinates
// changed but its position in WindowTreeHost coordinates did not.
@@ -277,7 +277,8 @@ ui::EventDispatchDetails WindowEventDispatcher::DispatchMouseEnterOrExit(
Window* target,
const ui::MouseEvent& event,
ui::EventType type) {
- env_controller_->UpdateStateForMouseEvent(window(), event);
+ Env::GetInstance()->env_controller()->UpdateStateForMouseEvent(window(),
+ event);
if (!mouse_moved_handler_ || !mouse_moved_handler_->delegate() ||
!window()->Contains(mouse_moved_handler_))
return DispatchDetails();
@@ -813,7 +814,8 @@ DispatchDetails WindowEventDispatcher::PreDispatchMouseEvent(
return DispatchDetails();
}
- env_controller_->UpdateStateForMouseEvent(window(), *event);
+ Env::GetInstance()->env_controller()->UpdateStateForMouseEvent(window(),
+ *event);
if (IsEventCandidateForHold(*event) && !dispatching_held_event_) {
if (move_hold_count_) {
@@ -909,7 +911,7 @@ DispatchDetails WindowEventDispatcher::PreDispatchTouchEvent(
return DispatchDetails();
}
- env_controller_->UpdateStateForTouchEvent(*event);
+ Env::GetInstance()->env_controller()->UpdateStateForTouchEvent(*event);
ui::TouchEvent orig_event(*event, target, window());
if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(&orig_event,
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698