| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/renderer_host/media/desktop_capture_device_ash.h" | 5 #include "content/browser/renderer_host/media/desktop_capture_device_ash.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
| 9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
| 10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return false; | 110 return false; |
| 111 | 111 |
| 112 // If the desktop layer is already destroyed then return failure. | 112 // If the desktop layer is already destroyed then return failure. |
| 113 desktop_layer_ = desktop_window_->layer(); | 113 desktop_layer_ = desktop_window_->layer(); |
| 114 if (!desktop_layer_) | 114 if (!desktop_layer_) |
| 115 return false; | 115 return false; |
| 116 | 116 |
| 117 DCHECK(oracle_proxy.get()); | 117 DCHECK(oracle_proxy.get()); |
| 118 oracle_proxy_ = oracle_proxy; | 118 oracle_proxy_ = oracle_proxy; |
| 119 | 119 |
| 120 // Update capture resolution. |
| 121 oracle_proxy_->UpdateCaptureSize(ui::ConvertSizeToPixel( |
| 122 desktop_layer_, desktop_layer_->bounds().size())); |
| 123 |
| 120 // Start observing window events. | 124 // Start observing window events. |
| 121 desktop_window_->AddObserver(this); | 125 desktop_window_->AddObserver(this); |
| 122 | 126 |
| 123 // Start observing compositor updates. | 127 // Start observing compositor updates. |
| 124 ui::Compositor* compositor = desktop_layer_->GetCompositor(); | 128 ui::Compositor* compositor = desktop_layer_->GetCompositor(); |
| 125 if (!compositor) | 129 if (!compositor) |
| 126 return false; | 130 return false; |
| 127 | 131 |
| 128 compositor->AddObserver(this); | 132 compositor->AddObserver(this); |
| 129 | 133 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 scoped_ptr<Client> client) { | 294 scoped_ptr<Client> client) { |
| 291 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 295 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 292 impl_->AllocateAndStart(params, client.Pass()); | 296 impl_->AllocateAndStart(params, client.Pass()); |
| 293 } | 297 } |
| 294 | 298 |
| 295 void DesktopCaptureDeviceAsh::StopAndDeAllocate() { | 299 void DesktopCaptureDeviceAsh::StopAndDeAllocate() { |
| 296 impl_->StopAndDeAllocate(); | 300 impl_->StopAndDeAllocate(); |
| 297 } | 301 } |
| 298 | 302 |
| 299 } // namespace content | 303 } // namespace content |
| OLD | NEW |