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

Side by Side Diff: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc

Issue 2525113002: Rename WindowTreeHost functions to indicate pixels/dips. (Closed)
Patch Set: win Created 4 years 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 "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" 5 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 if (!display.is_valid()) 54 if (!display.is_valid())
55 return; 55 return;
56 aura::Window* root_window = Shell::GetInstance() 56 aura::Window* root_window = Shell::GetInstance()
57 ->window_tree_host_manager() 57 ->window_tree_host_manager()
58 ->GetRootWindowForDisplayId(display.id()); 58 ->GetRootWindowForDisplayId(display.id());
59 gfx::Point host_location(screen_location); 59 gfx::Point host_location(screen_location);
60 aura::client::ScreenPositionClient* client = 60 aura::client::ScreenPositionClient* client =
61 aura::client::GetScreenPositionClient(root_window); 61 aura::client::GetScreenPositionClient(root_window);
62 if (client) 62 if (client)
63 client->ConvertPointFromScreen(root_window, &host_location); 63 client->ConvertPointFromScreen(root_window, &host_location);
64 root_window->GetHost()->MoveCursorTo(host_location); 64 root_window->GetHost()->MoveCursorToLocationInDIP(host_location);
65 } 65 }
66 66
67 } // namespace 67 } // namespace
68 68
69 ScopedDisableInternalMouseAndKeyboardX11:: 69 ScopedDisableInternalMouseAndKeyboardX11::
70 ScopedDisableInternalMouseAndKeyboardX11() 70 ScopedDisableInternalMouseAndKeyboardX11()
71 : touchpad_device_id_(kDeviceIdNone), 71 : touchpad_device_id_(kDeviceIdNone),
72 keyboard_device_id_(kDeviceIdNone), 72 keyboard_device_id_(kDeviceIdNone),
73 core_keyboard_device_id_(kDeviceIdNone), 73 core_keyboard_device_id_(kDeviceIdNone),
74 last_mouse_location_(GetMouseLocationInScreen()) { 74 last_mouse_location_(GetMouseLocationInScreen()) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // blocked. Move the mouse cursor back to its last known location resulting 156 // blocked. Move the mouse cursor back to its last known location resulting
157 // from an external mouse to prevent the internal touchpad from moving it. 157 // from an external mouse to prevent the internal touchpad from moving it.
158 SetMouseLocationInScreen(last_mouse_location_); 158 SetMouseLocationInScreen(last_mouse_location_);
159 } else { 159 } else {
160 // Track the last location seen from an external mouse event. 160 // Track the last location seen from an external mouse event.
161 last_mouse_location_ = GetMouseLocationInScreen(); 161 last_mouse_location_ = GetMouseLocationInScreen();
162 } 162 }
163 } 163 }
164 164
165 } // namespace ash 165 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/non_client_frame_controller.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698