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 "remoting/host/chromeos/aura_desktop_capturer.h" | 5 #include "remoting/host/chromeos/aura_desktop_capturer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
10 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h" | 10 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
13 | 13 |
14 #if defined(USE_ASH) | 14 #if defined(USE_ASH) |
15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
16 #endif | 16 #endif |
17 | 17 |
18 namespace remoting { | 18 namespace remoting { |
19 | 19 |
20 AuraDesktopCapturer::AuraDesktopCapturer() | 20 AuraDesktopCapturer::AuraDesktopCapturer() |
21 : callback_(NULL), desktop_window_(NULL), weak_factory_(this) { | 21 : callback_(nullptr), desktop_window_(nullptr), weak_factory_(this) { |
22 } | 22 } |
23 | 23 |
24 AuraDesktopCapturer::~AuraDesktopCapturer() { | 24 AuraDesktopCapturer::~AuraDesktopCapturer() { |
25 } | 25 } |
26 | 26 |
27 void AuraDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { | 27 void AuraDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { |
28 #if defined(USE_ASH) | 28 #if defined(USE_ASH) |
29 if (ash::Shell::HasInstance()) { | 29 if (ash::Shell::HasInstance()) { |
30 // TODO(kelvinp): Use ash::Shell::GetAllRootWindows() when multiple monitor | 30 // TODO(kelvinp): Use ash::Shell::GetAllRootWindows() when multiple monitor |
31 // support is implemented. | 31 // support is implemented. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 frame->size().width(), frame->size().height()); | 66 frame->size().width(), frame->size().height()); |
67 | 67 |
68 // TODO(kelvinp): Set Frame DPI according to the screen resolution. | 68 // TODO(kelvinp): Set Frame DPI according to the screen resolution. |
69 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). | 69 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). |
70 frame->mutable_updated_region()->SetRect(rect); | 70 frame->mutable_updated_region()->SetRect(rect); |
71 | 71 |
72 callback_->OnCaptureCompleted(frame.release()); | 72 callback_->OnCaptureCompleted(frame.release()); |
73 } | 73 } |
74 | 74 |
75 } // namespace remoting | 75 } // namespace remoting |
OLD | NEW |