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

Side by Side Diff: ui/aura/test/test_screen.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 (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/test/test_screen.h" 5 #include "ui/aura/test/test_screen.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 host_->window()->AddObserver(this); 56 host_->window()->AddObserver(this);
57 host_->InitHost(); 57 host_->InitHost();
58 return host_; 58 return host_;
59 } 59 }
60 60
61 void TestScreen::SetDeviceScaleFactor(float device_scale_factor) { 61 void TestScreen::SetDeviceScaleFactor(float device_scale_factor) {
62 display::Display display(GetPrimaryDisplay()); 62 display::Display display(GetPrimaryDisplay());
63 gfx::Rect bounds_in_pixel(display.GetSizeInPixel()); 63 gfx::Rect bounds_in_pixel(display.GetSizeInPixel());
64 display.SetScaleAndBounds(device_scale_factor, bounds_in_pixel); 64 display.SetScaleAndBounds(device_scale_factor, bounds_in_pixel);
65 display_list().UpdateDisplay(display); 65 display_list().UpdateDisplay(display);
66 host_->OnHostResized(bounds_in_pixel.size()); 66 host_->OnHostResizedInPixels(bounds_in_pixel.size());
67 } 67 }
68 68
69 void TestScreen::SetDisplayRotation(display::Display::Rotation rotation) { 69 void TestScreen::SetDisplayRotation(display::Display::Rotation rotation) {
70 display::Display display(GetPrimaryDisplay()); 70 display::Display display(GetPrimaryDisplay());
71 gfx::Rect bounds_in_pixel(display.GetSizeInPixel()); 71 gfx::Rect bounds_in_pixel(display.GetSizeInPixel());
72 gfx::Rect new_bounds(bounds_in_pixel); 72 gfx::Rect new_bounds(bounds_in_pixel);
73 if (IsRotationPortrait(rotation) != IsRotationPortrait(display.rotation())) { 73 if (IsRotationPortrait(rotation) != IsRotationPortrait(display.rotation())) {
74 new_bounds.set_width(bounds_in_pixel.height()); 74 new_bounds.set_width(bounds_in_pixel.height());
75 new_bounds.set_height(bounds_in_pixel.width()); 75 new_bounds.set_height(bounds_in_pixel.width());
76 } 76 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 TestScreen::TestScreen(const gfx::Rect& screen_bounds, 162 TestScreen::TestScreen(const gfx::Rect& screen_bounds,
163 WindowTreeClient* window_tree_client) 163 WindowTreeClient* window_tree_client)
164 : host_(nullptr), ui_scale_(1.0f), window_tree_client_(window_tree_client) { 164 : host_(nullptr), ui_scale_(1.0f), window_tree_client_(window_tree_client) {
165 static int64_t synthesized_display_id = 2000; 165 static int64_t synthesized_display_id = 2000;
166 display::Display display(synthesized_display_id++); 166 display::Display display(synthesized_display_id++);
167 display.SetScaleAndBounds(1.0f, screen_bounds); 167 display.SetScaleAndBounds(1.0f, screen_bounds);
168 ProcessDisplayChanged(display, true /* is_primary */); 168 ProcessDisplayChanged(display, true /* is_primary */);
169 } 169 }
170 170
171 } // namespace aura 171 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/event_generator_delegate_aura.cc ('k') | ui/aura/test/ui_controls_factory_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698