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

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

Issue 2524873002: Rename WindowTreeHost G|SetBounds to indicate they are in pixels. (Closed)
Patch Set: rebase 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/window_tree_host_x11.h ('k') | ui/aura/window_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/window_tree_host_x11.h" 5 #include "ui/aura/window_tree_host_x11.h"
6 6
7 #include <strings.h> 7 #include <strings.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/extensions/Xrandr.h> 10 #include <X11/extensions/Xrandr.h>
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 389 }
390 } 390 }
391 391
392 void WindowTreeHostX11::HideImpl() { 392 void WindowTreeHostX11::HideImpl() {
393 if (window_mapped_) { 393 if (window_mapped_) {
394 XWithdrawWindow(xdisplay_, xwindow_, 0); 394 XWithdrawWindow(xdisplay_, xwindow_, 0);
395 window_mapped_ = false; 395 window_mapped_ = false;
396 } 396 }
397 } 397 }
398 398
399 gfx::Rect WindowTreeHostX11::GetBounds() const { 399 gfx::Rect WindowTreeHostX11::GetBoundsInPixels() const {
400 return bounds_; 400 return bounds_;
401 } 401 }
402 402
403 void WindowTreeHostX11::SetBounds(const gfx::Rect& bounds) { 403 void WindowTreeHostX11::SetBoundsInPixels(const gfx::Rect& bounds) {
404 // Even if the host window's size doesn't change, aura's root window 404 // Even if the host window's size doesn't change, aura's root window
405 // size, which is in DIP, changes when the scale changes. 405 // size, which is in DIP, changes when the scale changes.
406 float current_scale = compositor()->device_scale_factor(); 406 float current_scale = compositor()->device_scale_factor();
407 float new_scale = display::Screen::GetScreen() 407 float new_scale = display::Screen::GetScreen()
408 ->GetDisplayNearestWindow(window()) 408 ->GetDisplayNearestWindow(window())
409 .device_scale_factor(); 409 .device_scale_factor();
410 bool origin_changed = bounds_.origin() != bounds.origin(); 410 bool origin_changed = bounds_.origin() != bounds.origin();
411 bool size_changed = bounds_.size() != bounds.size(); 411 bool size_changed = bounds_.size() != bounds.size();
412 XWindowChanges changes = {0}; 412 XWindowChanges changes = {0};
413 unsigned value_mask = 0; 413 unsigned value_mask = 0;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 575 }
576 576
577 namespace test { 577 namespace test {
578 578
579 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 579 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
580 default_override_redirect = override_redirect; 580 default_override_redirect = override_redirect;
581 } 581 }
582 582
583 } // namespace test 583 } // namespace test
584 } // namespace aura 584 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host_x11.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698