Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: components/mus/ws/display_manager.cc

Issue 1605773004: mus: Implement Window Server Capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Original Review Comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 platform_window_->Close(); 400 platform_window_->Close();
393 } 401 }
394 402
395 void DefaultDisplayManager::OnClosed() { 403 void DefaultDisplayManager::OnClosed() {
396 delegate_->OnDisplayClosed(); 404 delegate_->OnDisplayClosed();
397 } 405 }
398 406
399 void DefaultDisplayManager::OnWindowStateChanged( 407 void DefaultDisplayManager::OnWindowStateChanged(
400 ui::PlatformWindowState new_state) {} 408 ui::PlatformWindowState new_state) {}
401 409
402 void DefaultDisplayManager::OnLostCapture() {} 410 void DefaultDisplayManager::OnLostCapture() {
411 delegate_->OnLostCapture();
412 }
403 413
404 void DefaultDisplayManager::OnAcceleratedWidgetAvailable( 414 void DefaultDisplayManager::OnAcceleratedWidgetAvailable(
405 gfx::AcceleratedWidget widget, 415 gfx::AcceleratedWidget widget,
406 float device_pixel_ratio) { 416 float device_pixel_ratio) {
407 if (widget != gfx::kNullAcceleratedWidget) { 417 if (widget != gfx::kNullAcceleratedWidget) {
408 top_level_display_client_.reset( 418 top_level_display_client_.reset(
409 new TopLevelDisplayClient(widget, gpu_state_, surfaces_state_)); 419 new TopLevelDisplayClient(widget, gpu_state_, surfaces_state_));
410 delegate_->OnTopLevelSurfaceChanged( 420 delegate_->OnTopLevelSurfaceChanged(
411 top_level_display_client_->surface_id()); 421 top_level_display_client_->surface_id());
412 } 422 }
413 UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio); 423 UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio);
414 } 424 }
415 425
416 void DefaultDisplayManager::OnAcceleratedWidgetDestroyed() { 426 void DefaultDisplayManager::OnAcceleratedWidgetDestroyed() {
417 NOTREACHED(); 427 NOTREACHED();
418 } 428 }
419 429
420 void DefaultDisplayManager::OnActivationChanged(bool active) {} 430 void DefaultDisplayManager::OnActivationChanged(bool active) {}
421 431
422 } // namespace ws 432 } // namespace ws
423 433
424 } // namespace mus 434 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698