| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // We use the touch layout only when we are running in Metro mode. | 58 // We use the touch layout only when we are running in Metro mode. |
| 59 return base::win::IsMetroProcess() && ui::IsTouchDevicePresent(); | 59 return base::win::IsMetroProcess() && ui::IsTouchDevicePresent(); |
| 60 } | 60 } |
| 61 #endif // defined(OS_WIN) | 61 #endif // defined(OS_WIN) |
| 62 | 62 |
| 63 const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f, | 63 const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f, |
| 64 2.0f}; | 64 2.0f}; |
| 65 COMPILE_ASSERT(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales), | 65 COMPILE_ASSERT(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales), |
| 66 kScaleFactorScales_incorrect_size); | 66 kScaleFactorScales_incorrect_size); |
| 67 const size_t kScaleFactorScalesLength = arraysize(kScaleFactorScales); | |
| 68 | 67 |
| 69 } // namespace | 68 } // namespace |
| 70 | 69 |
| 71 DisplayLayout GetDisplayLayout() { | 70 DisplayLayout GetDisplayLayout() { |
| 72 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 73 if (UseTouchOptimizedUI()) | 72 if (UseTouchOptimizedUI()) |
| 74 return LAYOUT_TOUCH; | 73 return LAYOUT_TOUCH; |
| 75 #endif | 74 #endif |
| 76 return LAYOUT_DESKTOP; | 75 return LAYOUT_DESKTOP; |
| 77 } | 76 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 174 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); |
| 176 if (screen->IsDIPEnabled()) { | 175 if (screen->IsDIPEnabled()) { |
| 177 gfx::Display display = screen->GetDisplayNearestWindow(view); | 176 gfx::Display display = screen->GetDisplayNearestWindow(view); |
| 178 return GetSupportedScaleFactor(display.device_scale_factor()); | 177 return GetSupportedScaleFactor(display.device_scale_factor()); |
| 179 } | 178 } |
| 180 return ui::SCALE_FACTOR_100P; | 179 return ui::SCALE_FACTOR_100P; |
| 181 } | 180 } |
| 182 #endif // !defined(OS_MACOSX) | 181 #endif // !defined(OS_MACOSX) |
| 183 | 182 |
| 184 } // namespace ui | 183 } // namespace ui |
| OLD | NEW |