| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/display/screen_manager_ozone.h" | 5 #include "services/ui/display/screen_manager_ozone.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/sys_info.h" | |
| 13 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "chromeos/system/devicemode.h" |
| 14 #include "services/service_manager/public/cpp/interface_registry.h" | 14 #include "services/service_manager/public/cpp/interface_registry.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/display/manager/chromeos/display_change_observer.h" | 16 #include "ui/display/manager/chromeos/display_change_observer.h" |
| 17 #include "ui/display/manager/display_layout_store.h" | 17 #include "ui/display/manager/display_layout_store.h" |
| 18 #include "ui/display/manager/display_manager_utilities.h" | 18 #include "ui/display/manager/display_manager_utilities.h" |
| 19 #include "ui/display/screen.h" | 19 #include "ui/display/screen.h" |
| 20 #include "ui/display/screen_base.h" | 20 #include "ui/display/screen_base.h" |
| 21 #include "ui/display/types/display_snapshot.h" | 21 #include "ui/display/types/display_snapshot.h" |
| 22 #include "ui/display/types/fake_display_controller.h" | 22 #include "ui/display/types/fake_display_controller.h" |
| 23 #include "ui/display/types/native_display_delegate.h" | 23 #include "ui/display/types/native_display_delegate.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // Tests may inject a NativeDisplayDelegate, otherwise get it from | 142 // Tests may inject a NativeDisplayDelegate, otherwise get it from |
| 143 // OzonePlatform. | 143 // OzonePlatform. |
| 144 if (!native_display_delegate_) { | 144 if (!native_display_delegate_) { |
| 145 native_display_delegate_ = | 145 native_display_delegate_ = |
| 146 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(); | 146 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 // The FakeDisplayController gives us a way to make the NativeDisplayDelegate | 149 // The FakeDisplayController gives us a way to make the NativeDisplayDelegate |
| 150 // pretend something display related has happened. | 150 // pretend something display related has happened. |
| 151 if (!base::SysInfo::IsRunningOnChromeOS()) { | 151 if (!chromeos::IsRunningAsSystemCompositor()) { |
| 152 fake_display_controller_ = | 152 fake_display_controller_ = |
| 153 native_display_delegate_->GetFakeDisplayController(); | 153 native_display_delegate_->GetFakeDisplayController(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Create a new Screen instance. | 156 // Create a new Screen instance. |
| 157 std::unique_ptr<ScreenBase> screen = base::MakeUnique<ScreenBase>(); | 157 std::unique_ptr<ScreenBase> screen = base::MakeUnique<ScreenBase>(); |
| 158 Screen::SetScreenInstance(screen.get()); | 158 Screen::SetScreenInstance(screen.get()); |
| 159 screen_ = screen.get(); | 159 screen_ = screen.get(); |
| 160 | 160 |
| 161 // Configure display manager. ScreenManager acts as an observer to find out | 161 // Configure display manager. ScreenManager acts as an observer to find out |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 controller_bindings_.AddBinding(this, std::move(request)); | 369 controller_bindings_.AddBinding(this, std::move(request)); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void ScreenManagerOzone::Create( | 372 void ScreenManagerOzone::Create( |
| 373 const service_manager::Identity& remote_identity, | 373 const service_manager::Identity& remote_identity, |
| 374 mojom::TestDisplayControllerRequest request) { | 374 mojom::TestDisplayControllerRequest request) { |
| 375 test_bindings_.AddBinding(this, std::move(request)); | 375 test_bindings_.AddBinding(this, std::move(request)); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace display | 378 } // namespace display |
| OLD | NEW |