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 "components/mus/ws/display_manager.h" | 5 #include "components/mus/ws/display_manager.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/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/delegated_frame_data.h" | 10 #include "cc/output/delegated_frame_data.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 void DefaultDisplayManager::SetViewportSize(const gfx::Size& size) { | 232 void DefaultDisplayManager::SetViewportSize(const gfx::Size& size) { |
233 platform_window_->SetBounds(gfx::Rect(size)); | 233 platform_window_->SetBounds(gfx::Rect(size)); |
234 } | 234 } |
235 | 235 |
236 void DefaultDisplayManager::SetTitle(const base::string16& title) { | 236 void DefaultDisplayManager::SetTitle(const base::string16& title) { |
237 platform_window_->SetTitle(title); | 237 platform_window_->SetTitle(title); |
238 } | 238 } |
239 | 239 |
| 240 void DefaultDisplayManager::SetCapture() { |
| 241 platform_window_->SetCapture(); |
| 242 } |
| 243 |
| 244 void DefaultDisplayManager::ReleaseCapture() { |
| 245 platform_window_->ReleaseCapture(); |
| 246 } |
| 247 |
240 void DefaultDisplayManager::SetCursorById(int32_t cursor_id) { | 248 void DefaultDisplayManager::SetCursorById(int32_t cursor_id) { |
241 #if !defined(OS_ANDROID) | 249 #if !defined(OS_ANDROID) |
242 // TODO(erg): This still isn't sufficient, and will only use native cursors | 250 // TODO(erg): This still isn't sufficient, and will only use native cursors |
243 // that chrome would use, not custom image cursors. For that, we should | 251 // that chrome would use, not custom image cursors. For that, we should |
244 // delegate to the window manager to load images from resource packs. | 252 // delegate to the window manager to load images from resource packs. |
245 // | 253 // |
246 // We probably also need to deal with different DPIs. | 254 // We probably also need to deal with different DPIs. |
247 ui::Cursor cursor(cursor_id); | 255 ui::Cursor cursor(cursor_id); |
248 cursor_loader_->SetPlatformCursor(&cursor); | 256 cursor_loader_->SetPlatformCursor(&cursor); |
249 platform_window_->SetCursor(cursor.platform()); | 257 platform_window_->SetCursor(cursor.platform()); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 platform_window_->Close(); | 405 platform_window_->Close(); |
398 } | 406 } |
399 | 407 |
400 void DefaultDisplayManager::OnClosed() { | 408 void DefaultDisplayManager::OnClosed() { |
401 delegate_->OnDisplayClosed(); | 409 delegate_->OnDisplayClosed(); |
402 } | 410 } |
403 | 411 |
404 void DefaultDisplayManager::OnWindowStateChanged( | 412 void DefaultDisplayManager::OnWindowStateChanged( |
405 ui::PlatformWindowState new_state) {} | 413 ui::PlatformWindowState new_state) {} |
406 | 414 |
407 void DefaultDisplayManager::OnLostCapture() {} | 415 void DefaultDisplayManager::OnLostCapture() { |
| 416 delegate_->OnLostCapture(); |
| 417 } |
408 | 418 |
409 void DefaultDisplayManager::OnAcceleratedWidgetAvailable( | 419 void DefaultDisplayManager::OnAcceleratedWidgetAvailable( |
410 gfx::AcceleratedWidget widget, | 420 gfx::AcceleratedWidget widget, |
411 float device_pixel_ratio) { | 421 float device_pixel_ratio) { |
412 if (widget != gfx::kNullAcceleratedWidget) { | 422 if (widget != gfx::kNullAcceleratedWidget) { |
413 top_level_display_client_.reset( | 423 top_level_display_client_.reset( |
414 new TopLevelDisplayClient(widget, gpu_state_, surfaces_state_)); | 424 new TopLevelDisplayClient(widget, gpu_state_, surfaces_state_)); |
415 delegate_->OnTopLevelSurfaceChanged( | 425 delegate_->OnTopLevelSurfaceChanged( |
416 top_level_display_client_->surface_id()); | 426 top_level_display_client_->surface_id()); |
417 } | 427 } |
418 UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio); | 428 UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio); |
419 } | 429 } |
420 | 430 |
421 void DefaultDisplayManager::OnAcceleratedWidgetDestroyed() { | 431 void DefaultDisplayManager::OnAcceleratedWidgetDestroyed() { |
422 NOTREACHED(); | 432 NOTREACHED(); |
423 } | 433 } |
424 | 434 |
425 void DefaultDisplayManager::OnActivationChanged(bool active) {} | 435 void DefaultDisplayManager::OnActivationChanged(bool active) {} |
426 | 436 |
427 } // namespace ws | 437 } // namespace ws |
428 | 438 |
429 } // namespace mus | 439 } // namespace mus |
OLD | NEW |