| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.h" | 5 #include "services/ui/ws/platform_display.h" |
| 6 | 6 |
| 7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "cc/ipc/quads.mojom.h" | 9 #include "cc/ipc/quads.mojom.h" |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void DefaultPlatformDisplay::Init(PlatformDisplayDelegate* delegate) { | 66 void DefaultPlatformDisplay::Init(PlatformDisplayDelegate* delegate) { |
| 67 delegate_ = delegate; | 67 delegate_ = delegate; |
| 68 | 68 |
| 69 DCHECK(!metrics_.pixel_size.IsEmpty()); | 69 DCHECK(!metrics_.pixel_size.IsEmpty()); |
| 70 | 70 |
| 71 // TODO(kylechar): The origin here isn't right if any displays have | 71 // TODO(kylechar): The origin here isn't right if any displays have |
| 72 // scale_factor other than 1.0 but will prevent windows from being stacked. | 72 // scale_factor other than 1.0 but will prevent windows from being stacked. |
| 73 gfx::Rect bounds(metrics_.bounds.origin(), metrics_.pixel_size); | 73 gfx::Rect bounds(metrics_.bounds.origin(), metrics_.pixel_size); |
| 74 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
| 75 platform_window_.reset(new ui::WinWindow(this, bounds)); | 75 platform_window_ = base::MakeUnique<ui::WinWindow>(this, bounds); |
| 76 #elif defined(USE_X11) | 76 #elif defined(USE_X11) |
| 77 platform_window_.reset(new ui::X11Window(this)); | 77 platform_window_ = base::MakeUnique<ui::X11Window>(this); |
| 78 #elif defined(OS_ANDROID) | 78 #elif defined(OS_ANDROID) |
| 79 platform_window_.reset(new ui::PlatformWindowAndroid(this)); | 79 platform_window_ = base::MakeUnique<ui::PlatformWindowAndroid>(this); |
| 80 #elif defined(USE_OZONE) | 80 #elif defined(USE_OZONE) |
| 81 platform_window_ = | 81 platform_window_ = |
| 82 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); | 82 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); |
| 83 #else | 83 #else |
| 84 NOTREACHED() << "Unsupported platform"; | 84 NOTREACHED() << "Unsupported platform"; |
| 85 #endif | 85 #endif |
| 86 delegate_->CreateRootWindow(metrics_.bounds.size()); | 86 delegate_->CreateRootWindow(metrics_.bounds.size()); |
| 87 | 87 |
| 88 platform_window_->SetBounds(bounds); | 88 platform_window_->SetBounds(bounds); |
| 89 platform_window_->Show(); | 89 platform_window_->Show(); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 306 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
| 307 } | 307 } |
| 308 | 308 |
| 309 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { | 309 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { |
| 310 return metrics_; | 310 return metrics_; |
| 311 } | 311 } |
| 312 | 312 |
| 313 } // namespace ws | 313 } // namespace ws |
| 314 | 314 |
| 315 } // namespace ui | 315 } // namespace ui |
| OLD | NEW |