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

Unified Diff: ui/aura/window_tree_host_x11.cc

Issue 2525113002: Rename WindowTreeHost functions to indicate pixels/dips. (Closed)
Patch Set: DIP + rebase Created 4 years, 1 month 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
Index: ui/aura/window_tree_host_x11.cc
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index c618a1ced10224bd7a8bdc9c35934488f3c3520f..03f64c0372d936b0383fe2afbf00ff3ffe9d5db4 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -312,9 +312,9 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
bounds_ = bounds;
OnConfigureNotify();
if (size_changed)
- OnHostResized(bounds.size());
+ OnHostResizedInPixels(bounds.size());
if (origin_changed)
- OnHostMoved(bounds_.origin());
+ OnHostMovedInPixels(bounds_.origin());
break;
}
case GenericEvent:
@@ -433,15 +433,15 @@ void WindowTreeHostX11::SetBounds(const gfx::Rect& bounds) {
// |bounds_| later.
bounds_ = bounds;
if (origin_changed)
- OnHostMoved(bounds.origin());
+ OnHostMovedInPixels(bounds.origin());
if (size_changed || current_scale != new_scale) {
- OnHostResized(bounds.size());
+ OnHostResizedInPixels(bounds.size());
} else {
window()->SchedulePaintInRect(window()->bounds());
}
}
-gfx::Point WindowTreeHostX11::GetLocationOnNativeScreen() const {
+gfx::Point WindowTreeHostX11::GetLocationOnNativeScreenInPixels() const {
return bounds_.origin();
}
@@ -465,10 +465,11 @@ void WindowTreeHostX11::SetCursorNative(gfx::NativeCursor cursor) {
SetCursorInternal(cursor);
}
-void WindowTreeHostX11::MoveCursorToNative(const gfx::Point& location) {
+void WindowTreeHostX11::MoveCursorToNativeInPixels(
+ const gfx::Point& location_in_pixels) {
XWarpPointer(xdisplay_, None, x_root_window_, 0, 0, 0, 0,
- bounds_.x() + location.x(),
- bounds_.y() + location.y());
+ bounds_.x() + location_in_pixels.x(),
+ bounds_.y() + location_in_pixels.y());
}
void WindowTreeHostX11::OnCursorVisibilityChangedNative(bool show) {
@@ -570,8 +571,8 @@ void WindowTreeHostX11::TranslateAndDispatchLocatedEvent(
}
// static
-WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
- return new WindowTreeHostX11(bounds);
+WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds_in_pixels) {
+ return new WindowTreeHostX11(bounds_in_pixels);
}
namespace test {

Powered by Google App Engine
This is Rietveld 408576698