| 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/ws/platform_display_default.h" | 5 #include "services/ui/ws/platform_display_default.h" |
| 6 | 6 |
| 7 #include "gpu/ipc/client/gpu_channel_host.h" | 7 #include "gpu/ipc/client/gpu_channel_host.h" |
| 8 #include "services/ui/display/screen_manager.h" | 8 #include "services/ui/display/screen_manager.h" |
| 9 #include "services/ui/ws/platform_display_init_params.h" | 9 #include "services/ui/ws/platform_display_init_params.h" |
| 10 #include "services/ui/ws/server_window.h" | 10 #include "services/ui/ws/server_window.h" |
| 11 #include "ui/base/cursor/cursor_loader.h" | 11 #include "ui/base/cursor/cursor_loader.h" |
| 12 #include "ui/display/display.h" | 12 #include "ui/display/display.h" |
| 13 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
| 14 #include "ui/events/event_utils.h" | 14 #include "ui/events/event_utils.h" |
| 15 #include "ui/platform_window/platform_ime_controller.h" | 15 #include "ui/platform_window/platform_ime_controller.h" |
| 16 #include "ui/platform_window/platform_window.h" | 16 #include "ui/platform_window/platform_window.h" |
| 17 | 17 |
| 18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 19 #include "ui/platform_window/win/win_window.h" | 19 #include "ui/platform_window/win/win_window.h" |
| 20 #elif defined(USE_X11) | 20 #elif defined(USE_X11) && !defined(OS_CHROMEOS) |
| 21 #include "ui/platform_window/x11/x11_window.h" | 21 #include "ui/platform_window/x11/x11_window.h" |
| 22 #elif defined(OS_ANDROID) | 22 #elif defined(OS_ANDROID) |
| 23 #include "ui/platform_window/android/platform_window_android.h" | 23 #include "ui/platform_window/android/platform_window_android.h" |
| 24 #elif defined(USE_OZONE) | 24 #elif defined(USE_OZONE) |
| 25 #include "ui/ozone/public/ozone_platform.h" | 25 #include "ui/ozone/public/ozone_platform.h" |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 namespace ws { | 29 namespace ws { |
| 30 | 30 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 void PlatformDisplayDefault::Init(PlatformDisplayDelegate* delegate) { | 52 void PlatformDisplayDefault::Init(PlatformDisplayDelegate* delegate) { |
| 53 delegate_ = delegate; | 53 delegate_ = delegate; |
| 54 | 54 |
| 55 DCHECK(!metrics_.pixel_size.IsEmpty()); | 55 DCHECK(!metrics_.pixel_size.IsEmpty()); |
| 56 | 56 |
| 57 // TODO(kylechar): The origin here isn't right if any displays have | 57 // TODO(kylechar): The origin here isn't right if any displays have |
| 58 // scale_factor other than 1.0 but will prevent windows from being stacked. | 58 // scale_factor other than 1.0 but will prevent windows from being stacked. |
| 59 gfx::Rect bounds(metrics_.bounds.origin(), metrics_.pixel_size); | 59 gfx::Rect bounds(metrics_.bounds.origin(), metrics_.pixel_size); |
| 60 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
| 61 platform_window_ = base::MakeUnique<ui::WinWindow>(this, bounds); | 61 platform_window_ = base::MakeUnique<ui::WinWindow>(this, bounds); |
| 62 #elif defined(USE_X11) | 62 #elif defined(USE_X11) && !defined(OS_CHROMEOS) |
| 63 platform_window_ = base::MakeUnique<ui::X11Window>(this); | 63 platform_window_ = base::MakeUnique<ui::X11Window>(this); |
| 64 platform_window_->SetBounds(bounds); | 64 platform_window_->SetBounds(bounds); |
| 65 #elif defined(OS_ANDROID) | 65 #elif defined(OS_ANDROID) |
| 66 platform_window_ = base::MakeUnique<ui::PlatformWindowAndroid>(this); | 66 platform_window_ = base::MakeUnique<ui::PlatformWindowAndroid>(this); |
| 67 platform_window_->SetBounds(bounds); | 67 platform_window_->SetBounds(bounds); |
| 68 #elif defined(USE_OZONE) | 68 #elif defined(USE_OZONE) |
| 69 platform_window_ = | 69 platform_window_ = |
| 70 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); | 70 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); |
| 71 #else | 71 #else |
| 72 NOTREACHED() << "Unsupported platform"; | 72 NOTREACHED() << "Unsupported platform"; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 void PlatformDisplayDefault::OnActivationChanged(bool active) {} | 241 void PlatformDisplayDefault::OnActivationChanged(bool active) {} |
| 242 | 242 |
| 243 bool PlatformDisplayDefault::IsInHighContrastMode() { | 243 bool PlatformDisplayDefault::IsInHighContrastMode() { |
| 244 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 244 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace ws | 247 } // namespace ws |
| 248 } // namespace ui | 248 } // namespace ui |
| OLD | NEW |