| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 112     if (display.device_scale_factor() > 1.0) { | 112     if (display.device_scale_factor() > 1.0) { | 
| 113       DCHECK_EQ(2.0, display.device_scale_factor()); | 113       DCHECK_EQ(2.0, display.device_scale_factor()); | 
| 114       supported_scale_factors->push_back(SCALE_FACTOR_200P); | 114       supported_scale_factors->push_back(SCALE_FACTOR_200P); | 
| 115     } else { | 115     } else { | 
| 116       supported_scale_factors->push_back(SCALE_FACTOR_100P); | 116       supported_scale_factors->push_back(SCALE_FACTOR_100P); | 
| 117     } | 117     } | 
| 118 #elif defined(OS_MACOSX) | 118 #elif defined(OS_MACOSX) | 
| 119     if (base::mac::IsOSLionOrLater()) | 119     if (base::mac::IsOSLionOrLater()) | 
| 120       supported_scale_factors->push_back(SCALE_FACTOR_200P); | 120       supported_scale_factors->push_back(SCALE_FACTOR_200P); | 
| 121 #elif defined(OS_WIN) && defined(ENABLE_HIDPI) | 121 #elif defined(OS_WIN) && defined(ENABLE_HIDPI) | 
| 122     if (base::win::IsMetroProcess() && base::win::IsTouchEnabled()) { | 122     if (base::win::IsMetroProcess() && ui::IsTouchDevicePresent()) { | 
| 123       supported_scale_factors->push_back(SCALE_FACTOR_140P); | 123       supported_scale_factors->push_back(SCALE_FACTOR_140P); | 
| 124       supported_scale_factors->push_back(SCALE_FACTOR_180P); | 124       supported_scale_factors->push_back(SCALE_FACTOR_180P); | 
| 125     } | 125     } | 
| 126 #elif defined(OS_CHROMEOS) | 126 #elif defined(OS_CHROMEOS) | 
| 127     // TODO(oshima): Include 200P only if the device support 200P | 127     // TODO(oshima): Include 200P only if the device support 200P | 
| 128     supported_scale_factors->push_back(SCALE_FACTOR_200P); | 128     supported_scale_factors->push_back(SCALE_FACTOR_200P); | 
| 129 #endif | 129 #endif | 
| 130     std::sort(supported_scale_factors->begin(), | 130     std::sort(supported_scale_factors->begin(), | 
| 131               supported_scale_factors->end(), | 131               supported_scale_factors->end(), | 
| 132               ScaleFactorComparator); | 132               ScaleFactorComparator); | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 210   gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 210   gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 
| 211   if (screen->IsDIPEnabled()) { | 211   if (screen->IsDIPEnabled()) { | 
| 212     gfx::Display display = screen->GetDisplayNearestWindow(view); | 212     gfx::Display display = screen->GetDisplayNearestWindow(view); | 
| 213     return GetScaleFactorFromScale(display.device_scale_factor()); | 213     return GetScaleFactorFromScale(display.device_scale_factor()); | 
| 214   } | 214   } | 
| 215   return ui::SCALE_FACTOR_100P; | 215   return ui::SCALE_FACTOR_100P; | 
| 216 } | 216 } | 
| 217 #endif  // !defined(OS_MACOSX) | 217 #endif  // !defined(OS_MACOSX) | 
| 218 | 218 | 
| 219 }  // namespace ui | 219 }  // namespace ui | 
| OLD | NEW | 
|---|