| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/display/display_info.h" | 5 #include "ash/display/display_info.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
| 19 #include "ui/gfx/geometry/size_conversions.h" | 19 #include "ui/gfx/geometry/size_conversions.h" |
| 20 #include "ui/gfx/geometry/size_f.h" | 20 #include "ui/gfx/geometry/size_f.h" |
| 21 | 21 |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 #include "ui/aura/window_tree_host.h" | 23 #include "ui/aura/window_tree_host.h" |
| 24 #include "ui/gfx/win/dpi.h" | 24 #include "ui/display/win/dpi.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 // Use larger than max int to catch overflow early. | 30 // Use larger than max int to catch overflow early. |
| 31 const int64_t kSynthesizedDisplayIdStart = 2200000000LL; | 31 const int64_t kSynthesizedDisplayIdStart = 2200000000LL; |
| 32 | 32 |
| 33 int64_t synthesized_display_id = kSynthesizedDisplayIdStart; | 33 int64_t synthesized_display_id = kSynthesizedDisplayIdStart; |
| 34 | 34 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 rotation = gfx::Display::ROTATE_270; | 164 rotation = gfx::Display::ROTATE_270; |
| 165 break; | 165 break; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 float device_scale_factor = 1.0f; | 171 float device_scale_factor = 1.0f; |
| 172 if (!GetDisplayBounds(main_spec, &bounds_in_native, &device_scale_factor)) { | 172 if (!GetDisplayBounds(main_spec, &bounds_in_native, &device_scale_factor)) { |
| 173 #if defined(OS_WIN) | 173 #if defined(OS_WIN) |
| 174 device_scale_factor = gfx::GetDPIScale(); | 174 device_scale_factor = display::win::GetDPIScale(); |
| 175 #endif | 175 #endif |
| 176 } | 176 } |
| 177 | 177 |
| 178 std::vector<DisplayMode> display_modes; | 178 std::vector<DisplayMode> display_modes; |
| 179 parts = base::SplitString(main_spec, "#", base::KEEP_WHITESPACE, | 179 parts = base::SplitString(main_spec, "#", base::KEEP_WHITESPACE, |
| 180 base::SPLIT_WANT_NONEMPTY); | 180 base::SPLIT_WANT_NONEMPTY); |
| 181 if (parts.size() == 2) { | 181 if (parts.size() == 2) { |
| 182 size_t native_mode = 0; | 182 size_t native_mode = 0; |
| 183 int largest_area = -1; | 183 int largest_area = -1; |
| 184 float highest_refresh_rate = -1.0f; | 184 float highest_refresh_rate = -1.0f; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 455 |
| 456 void DisplayInfo::ClearInputDevices() { | 456 void DisplayInfo::ClearInputDevices() { |
| 457 input_devices_.clear(); | 457 input_devices_.clear(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void ResetDisplayIdForTest() { | 460 void ResetDisplayIdForTest() { |
| 461 synthesized_display_id = kSynthesizedDisplayIdStart; | 461 synthesized_display_id = kSynthesizedDisplayIdStart; |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace ash | 464 } // namespace ash |
| OLD | NEW |