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

Side by Side Diff: ui/aura/test/ui_controls_factory_aurax11.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
« no previous file with comments | « ui/aura/test/test_screen.cc ('k') | ui/aura/test/ui_controls_factory_ozone.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <X11/keysym.h> 5 #include <X11/keysym.h>
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 const base::Closure& closure) override { 107 const base::Closure& closure) override {
108 gfx::Point root_location(screen_x, screen_y); 108 gfx::Point root_location(screen_x, screen_y);
109 aura::client::ScreenPositionClient* screen_position_client = 109 aura::client::ScreenPositionClient* screen_position_client =
110 aura::client::GetScreenPositionClient(host_->window()); 110 aura::client::GetScreenPositionClient(host_->window());
111 if (screen_position_client) { 111 if (screen_position_client) {
112 screen_position_client->ConvertPointFromScreen(host_->window(), 112 screen_position_client->ConvertPointFromScreen(host_->window(),
113 &root_location); 113 &root_location);
114 } 114 }
115 gfx::Point root_current_location = 115 gfx::Point root_current_location =
116 QueryLatestMousePositionRequestInHost(host_); 116 QueryLatestMousePositionRequestInHost(host_);
117 host_->ConvertPointFromHost(&root_current_location); 117 host_->ConvertPixelsToDIP(&root_current_location);
118 118
119 if (root_location != root_current_location && button_down_mask == 0) { 119 if (root_location != root_current_location && button_down_mask == 0) {
120 // Move the cursor because EnterNotify/LeaveNotify are generated with the 120 // Move the cursor because EnterNotify/LeaveNotify are generated with the
121 // current mouse position as a result of XGrabPointer() 121 // current mouse position as a result of XGrabPointer()
122 host_->window()->MoveCursorTo(root_location); 122 host_->window()->MoveCursorTo(root_location);
123 } else { 123 } else {
124 XEvent xevent = {0}; 124 XEvent xevent = {0};
125 XMotionEvent* xmotion = &xevent.xmotion; 125 XMotionEvent* xmotion = &xevent.xmotion;
126 xmotion->type = MotionNotify; 126 xmotion->type = MotionNotify;
127 xmotion->x = root_location.x(); 127 xmotion->x = root_location.x();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 }; 224 };
225 225
226 } // namespace 226 } // namespace
227 227
228 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { 228 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) {
229 return new UIControlsX11(host); 229 return new UIControlsX11(host);
230 } 230 }
231 231
232 } // namespace test 232 } // namespace test
233 } // namespace aura 233 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_screen.cc ('k') | ui/aura/test/ui_controls_factory_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698