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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some new gfx::Screen additions Created 8 years, 2 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 | Annotate | Revision Log
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 <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const std::vector<ui::ScaleFactor>& scale_factors) { 144 const std::vector<ui::ScaleFactor>& scale_factors) {
145 std::vector<ui::ScaleFactor>& supported_scale_factors = 145 std::vector<ui::ScaleFactor>& supported_scale_factors =
146 GetSupportedScaleFactorsInternal(); 146 GetSupportedScaleFactorsInternal();
147 supported_scale_factors = scale_factors; 147 supported_scale_factors = scale_factors;
148 } 148 }
149 149
150 } // namespace test 150 } // namespace test
151 151
152 #if !defined(OS_MACOSX) 152 #if !defined(OS_MACOSX)
153 ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view) { 153 ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view) {
154 if (gfx::Screen::IsDIPEnabled()) { 154 gfx::Screen* screen = gfx::Screen::GetScreenFor(view);
155 gfx::Display display = gfx::Screen::GetDisplayNearestWindow(view); 155 if (screen->IsDIPEnabled()) {
156 gfx::Display display = screen->GetDisplayNearestWindow(view);
156 return GetScaleFactorFromScale(display.device_scale_factor()); 157 return GetScaleFactorFromScale(display.device_scale_factor());
157 } 158 }
158 return ui::SCALE_FACTOR_100P; 159 return ui::SCALE_FACTOR_100P;
159 } 160 }
160 #endif // !defined(OS_MACOSX) 161 #endif // !defined(OS_MACOSX)
161 162
162 } // namespace ui 163 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698