| OLD | NEW |
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 if (display.device_scale_factor() > 1.0) { | 83 if (display.device_scale_factor() > 1.0) { |
| 84 DCHECK_EQ(2.0, display.device_scale_factor()); | 84 DCHECK_EQ(2.0, display.device_scale_factor()); |
| 85 supported_scale_factors->push_back(SCALE_FACTOR_200P); | 85 supported_scale_factors->push_back(SCALE_FACTOR_200P); |
| 86 } else { | 86 } else { |
| 87 supported_scale_factors->push_back(SCALE_FACTOR_100P); | 87 supported_scale_factors->push_back(SCALE_FACTOR_100P); |
| 88 } | 88 } |
| 89 #elif defined(OS_MACOSX) | 89 #elif defined(OS_MACOSX) |
| 90 if (base::mac::IsOSLionOrLater()) | 90 if (base::mac::IsOSLionOrLater()) |
| 91 supported_scale_factors->push_back(SCALE_FACTOR_200P); | 91 supported_scale_factors->push_back(SCALE_FACTOR_200P); |
| 92 #elif defined(OS_WIN) && defined(ENABLE_HIDPI) | 92 #elif defined(OS_WIN) && defined(ENABLE_HIDPI) |
| 93 if (base::win::IsMetroProcess() && base::win::IsTouchEnabled()) { | 93 supported_scale_factors->push_back(SCALE_FACTOR_140P); |
| 94 supported_scale_factors->push_back(SCALE_FACTOR_140P); | 94 supported_scale_factors->push_back(SCALE_FACTOR_180P); |
| 95 supported_scale_factors->push_back(SCALE_FACTOR_180P); | |
| 96 } | |
| 97 #elif defined(OS_CHROMEOS) | 95 #elif defined(OS_CHROMEOS) |
| 98 // TODO(oshima): Include 200P only if the device support 200P | 96 // TODO(oshima): Include 200P only if the device support 200P |
| 99 supported_scale_factors->push_back(SCALE_FACTOR_200P); | 97 supported_scale_factors->push_back(SCALE_FACTOR_200P); |
| 100 #endif | 98 #endif |
| 101 std::sort(supported_scale_factors->begin(), | 99 std::sort(supported_scale_factors->begin(), |
| 102 supported_scale_factors->end(), | 100 supported_scale_factors->end(), |
| 103 ScaleFactorComparator); | 101 ScaleFactorComparator); |
| 104 } | 102 } |
| 105 return *supported_scale_factors; | 103 return *supported_scale_factors; |
| 106 } | 104 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 179 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); |
| 182 if (screen->IsDIPEnabled()) { | 180 if (screen->IsDIPEnabled()) { |
| 183 gfx::Display display = screen->GetDisplayNearestWindow(view); | 181 gfx::Display display = screen->GetDisplayNearestWindow(view); |
| 184 return GetScaleFactorFromScale(display.device_scale_factor()); | 182 return GetScaleFactorFromScale(display.device_scale_factor()); |
| 185 } | 183 } |
| 186 return ui::SCALE_FACTOR_100P; | 184 return ui::SCALE_FACTOR_100P; |
| 187 } | 185 } |
| 188 #endif // !defined(OS_MACOSX) | 186 #endif // !defined(OS_MACOSX) |
| 189 | 187 |
| 190 } // namespace ui | 188 } // namespace ui |
| OLD | NEW |