| 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/display/manager/display_manager.h" | 5 #include "ui/display/manager/display_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "ui/display/manager/display_manager_utilities.h" | 33 #include "ui/display/manager/display_manager_utilities.h" |
| 34 #include "ui/display/manager/managed_display_info.h" | 34 #include "ui/display/manager/managed_display_info.h" |
| 35 #include "ui/display/screen.h" | 35 #include "ui/display/screen.h" |
| 36 #include "ui/gfx/font_render_params.h" | 36 #include "ui/gfx/font_render_params.h" |
| 37 #include "ui/gfx/geometry/rect.h" | 37 #include "ui/gfx/geometry/rect.h" |
| 38 #include "ui/gfx/geometry/size_conversions.h" | 38 #include "ui/gfx/geometry/size_conversions.h" |
| 39 #include "ui/strings/grit/ui_strings.h" | 39 #include "ui/strings/grit/ui_strings.h" |
| 40 | 40 |
| 41 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
| 42 #include "base/sys_info.h" | 42 #include "base/sys_info.h" |
| 43 #include "chromeos/system/devicemode.h" |
| 43 #endif | 44 #endif |
| 44 | 45 |
| 45 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 46 #include "base/win/windows_version.h" | 47 #include "base/win/windows_version.h" |
| 47 #endif | 48 #endif |
| 48 | 49 |
| 49 namespace display { | 50 namespace display { |
| 50 | 51 |
| 51 namespace { | 52 namespace { |
| 52 | 53 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 using std::vector; | 130 using std::vector; |
| 130 | 131 |
| 131 // static | 132 // static |
| 132 int64_t DisplayManager::kUnifiedDisplayId = -10; | 133 int64_t DisplayManager::kUnifiedDisplayId = -10; |
| 133 | 134 |
| 134 DisplayManager::DisplayManager(std::unique_ptr<Screen> screen) | 135 DisplayManager::DisplayManager(std::unique_ptr<Screen> screen) |
| 135 : screen_(std::move(screen)), | 136 : screen_(std::move(screen)), |
| 136 layout_store_(new DisplayLayoutStore), | 137 layout_store_(new DisplayLayoutStore), |
| 137 weak_ptr_factory_(this) { | 138 weak_ptr_factory_(this) { |
| 138 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
| 139 configure_displays_ = base::SysInfo::IsRunningOnChromeOS(); | 140 configure_displays_ = chromeos::IsRunningAsSystemCompositor(); |
| 140 change_display_upon_host_resize_ = !configure_displays_; | 141 change_display_upon_host_resize_ = !configure_displays_; |
| 141 unified_desktop_enabled_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 142 unified_desktop_enabled_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 142 ::switches::kEnableUnifiedDesktop); | 143 ::switches::kEnableUnifiedDesktop); |
| 143 #endif | 144 #endif |
| 144 } | 145 } |
| 145 | 146 |
| 146 DisplayManager::~DisplayManager() { | 147 DisplayManager::~DisplayManager() { |
| 147 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
| 148 // Reset the font params. | 149 // Reset the font params. |
| 149 gfx::SetFontRenderParamsDeviceScaleFactor(1.0f); | 150 gfx::SetFontRenderParamsDeviceScaleFactor(1.0f); |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 } | 1437 } |
| 1437 | 1438 |
| 1438 const Display& DisplayManager::GetSecondaryDisplay() const { | 1439 const Display& DisplayManager::GetSecondaryDisplay() const { |
| 1439 CHECK_LE(2U, GetNumDisplays()); | 1440 CHECK_LE(2U, GetNumDisplays()); |
| 1440 return GetDisplayAt(0).id() == Screen::GetScreen()->GetPrimaryDisplay().id() | 1441 return GetDisplayAt(0).id() == Screen::GetScreen()->GetPrimaryDisplay().id() |
| 1441 ? GetDisplayAt(1) | 1442 ? GetDisplayAt(1) |
| 1442 : GetDisplayAt(0); | 1443 : GetDisplayAt(0); |
| 1443 } | 1444 } |
| 1444 | 1445 |
| 1445 } // namespace display | 1446 } // namespace display |
| OLD | NEW |