| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 DCHECK(!metrics_.pixel_size.IsEmpty()); | 67 DCHECK(!metrics_.pixel_size.IsEmpty()); |
| 68 | 68 |
| 69 // TODO(kylechar): The origin here isn't right if any displays have | 69 // TODO(kylechar): The origin here isn't right if any displays have |
| 70 // scale_factor other than 1.0 but will prevent windows from being stacked. | 70 // scale_factor other than 1.0 but will prevent windows from being stacked. |
| 71 gfx::Rect bounds(metrics_.bounds.origin(), metrics_.pixel_size); | 71 gfx::Rect bounds(metrics_.bounds.origin(), metrics_.pixel_size); |
| 72 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
| 73 platform_window_ = base::MakeUnique<ui::WinWindow>(this, bounds); | 73 platform_window_ = base::MakeUnique<ui::WinWindow>(this, bounds); |
| 74 #elif defined(USE_X11) | 74 #elif defined(USE_X11) |
| 75 platform_window_ = base::MakeUnique<ui::X11Window>(this); | 75 platform_window_ = base::MakeUnique<ui::X11Window>(this); |
| 76 platform_window_->SetBounds(bounds); |
| 76 #elif defined(OS_ANDROID) | 77 #elif defined(OS_ANDROID) |
| 77 platform_window_ = base::MakeUnique<ui::PlatformWindowAndroid>(this); | 78 platform_window_ = base::MakeUnique<ui::PlatformWindowAndroid>(this); |
| 79 platform_window_->SetBounds(bounds); |
| 78 #elif defined(USE_OZONE) | 80 #elif defined(USE_OZONE) |
| 79 platform_window_ = | 81 platform_window_ = |
| 80 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); | 82 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); |
| 81 #else | 83 #else |
| 82 NOTREACHED() << "Unsupported platform"; | 84 NOTREACHED() << "Unsupported platform"; |
| 83 #endif | 85 #endif |
| 84 | 86 |
| 85 platform_window_->SetBounds(bounds); | |
| 86 platform_window_->Show(); | 87 platform_window_->Show(); |
| 87 } | 88 } |
| 88 | 89 |
| 89 int64_t DefaultPlatformDisplay::GetId() const { | 90 int64_t DefaultPlatformDisplay::GetId() const { |
| 90 return id_; | 91 return id_; |
| 91 } | 92 } |
| 92 | 93 |
| 93 DefaultPlatformDisplay::~DefaultPlatformDisplay() { | 94 DefaultPlatformDisplay::~DefaultPlatformDisplay() { |
| 94 // Don't notify the delegate from the destructor. | 95 // Don't notify the delegate from the destructor. |
| 95 delegate_ = nullptr; | 96 delegate_ = nullptr; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 265 |
| 265 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} | 266 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} |
| 266 | 267 |
| 267 bool DefaultPlatformDisplay::IsInHighContrastMode() { | 268 bool DefaultPlatformDisplay::IsInHighContrastMode() { |
| 268 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 269 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
| 269 } | 270 } |
| 270 | 271 |
| 271 } // namespace ws | 272 } // namespace ws |
| 272 | 273 |
| 273 } // namespace ui | 274 } // namespace ui |
| OLD | NEW |