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

Side by Side Diff: ui/base/layout.cc

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 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/aura/test/test_screen.h ('k') | ui/display/BUILD.gn » ('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/base/layout.h" 5 #include "ui/base/layout.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 delete g_supported_scale_factors; 100 delete g_supported_scale_factors;
101 g_supported_scale_factors = NULL; 101 g_supported_scale_factors = NULL;
102 } 102 }
103 } 103 }
104 104
105 } // namespace test 105 } // namespace test
106 106
107 #if !defined(OS_MACOSX) 107 #if !defined(OS_MACOSX)
108 float GetScaleFactorForNativeView(gfx::NativeView view) { 108 float GetScaleFactorForNativeView(gfx::NativeView view) {
109 display::Display display = 109 display::Display display =
110 display::Screen::GetScreen()->GetDisplayNearestWindow(view); 110 display::Screen::GetScreen()->GetDisplayNearestView(view);
111 DCHECK(display.is_valid()); 111 DCHECK(display.is_valid());
112 return display.device_scale_factor(); 112 return display.device_scale_factor();
113 } 113 }
114 #endif // !defined(OS_MACOSX) 114 #endif // !defined(OS_MACOSX)
115 115
116 } // namespace ui 116 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/test/test_screen.h ('k') | ui/display/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698