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

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

Issue 2779093004: Update event states in Env when target window has been destroyed. (Closed)
Patch Set: get EnvInputStateController from Env Created 3 years, 7 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 | « no previous file | ui/aura/mus/window_tree_client.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/env_input_state_controller.h" 5 #include "ui/aura/env_input_state_controller.h"
6 6
7 #include "ui/aura/client/screen_position_client.h" 7 #include "ui/aura/client/screen_position_client.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/gfx/geometry/point.h" 10 #include "ui/gfx/geometry/point.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 default: 57 default:
58 NOTREACHED(); 58 NOTREACHED();
59 break; 59 break;
60 } 60 }
61 } 61 }
62 62
63 void EnvInputStateController::SetLastMouseLocation( 63 void EnvInputStateController::SetLastMouseLocation(
64 const Window* root_window, 64 const Window* root_window,
65 const gfx::Point& location_in_root) const { 65 const gfx::Point& location_in_root) const {
66 // If |root_window| is null, we are only using the event to update event
67 // states, so we shouldn't update mouse location.
68 if (!root_window && Env::GetInstance()->mode() == aura::Env::Mode::MUS)
69 return;
70
66 client::ScreenPositionClient* client = 71 client::ScreenPositionClient* client =
67 client::GetScreenPositionClient(root_window); 72 client::GetScreenPositionClient(root_window);
68 if (client) { 73 if (client) {
69 gfx::Point location_in_screen = location_in_root; 74 gfx::Point location_in_screen = location_in_root;
70 client->ConvertPointToScreen(root_window, &location_in_screen); 75 client->ConvertPointToScreen(root_window, &location_in_screen);
71 Env::GetInstance()->set_last_mouse_location(location_in_screen); 76 Env::GetInstance()->set_last_mouse_location(location_in_screen);
72 } else { 77 } else {
73 Env::GetInstance()->set_last_mouse_location(location_in_root); 78 Env::GetInstance()->set_last_mouse_location(location_in_root);
74 } 79 }
75 } 80 }
76 81
77 } // namespace aura 82 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698