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

Side by Side Diff: ui/display/win/screen_win_display.cc

Issue 1913613002: Add place holder to move gfx::Display/Screen to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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/display/win/screen_win_display.h ('k') | ui/display/win/screen_win_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/display/win/screen_win_display.h" 5 #include "ui/display/win/screen_win_display.h"
6 6
7 #include "ui/display/win/display_info.h" 7 #include "ui/display/win/display_info.h"
8 #include "ui/display/win/screen_win.h" 8 #include "ui/display/win/screen_win.h"
9 9
10 namespace display { 10 namespace display {
11 namespace win { 11 namespace win {
12 12
13 namespace { 13 namespace {
14 14
15 gfx::Display CreateDisplayFromDisplayInfo(const DisplayInfo& display_info) { 15 Display CreateDisplayFromDisplayInfo(const DisplayInfo& display_info) {
16 gfx::Display display(display_info.id()); 16 Display display(display_info.id());
17 gfx::Rect dip_screen_bounds( 17 gfx::Rect dip_screen_bounds(
18 display::win::ScreenWin::ScreenToDIPRect(nullptr, 18 ScreenWin::ScreenToDIPRect(nullptr, display_info.screen_rect()));
19 display_info.screen_rect()));
20 display.set_bounds(dip_screen_bounds); 19 display.set_bounds(dip_screen_bounds);
21 display.set_work_area( 20 display.set_work_area(
22 display::win::ScreenWin::ScreenToDIPRect( 21 ScreenWin::ScreenToDIPRect(
23 nullptr, display_info.screen_work_rect())); 22 nullptr, display_info.screen_work_rect()));
24 display.SetScaleAndBounds(display_info.device_scale_factor(), 23 display.SetScaleAndBounds(display_info.device_scale_factor(),
25 display_info.screen_rect()); 24 display_info.screen_rect());
26 display.set_rotation(display_info.rotation()); 25 display.set_rotation(display_info.rotation());
27 return display; 26 return display;
28 } 27 }
29 28
30 } // namespace 29 } // namespace
31 30
32 ScreenWinDisplay::ScreenWinDisplay() = default; 31 ScreenWinDisplay::ScreenWinDisplay() = default;
33 32
34 ScreenWinDisplay::ScreenWinDisplay(const DisplayInfo& display_info) 33 ScreenWinDisplay::ScreenWinDisplay(const DisplayInfo& display_info)
35 : display_(CreateDisplayFromDisplayInfo(display_info)), 34 : display_(CreateDisplayFromDisplayInfo(display_info)),
36 pixel_bounds_(display_info.screen_rect()) {} 35 pixel_bounds_(display_info.screen_rect()) {}
37 36
38 } // namespace win 37 } // namespace win
39 } // namespace display 38 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/win/screen_win_display.h ('k') | ui/display/win/screen_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698