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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
11 #include "cc/output/copy_output_result.h" | 11 #include "cc/output/copy_output_result.h" |
12 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h" | 12 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/aura/window_tree_host.h" | 14 #include "ui/aura/window_tree_host.h" |
15 | 15 |
16 #if defined(USE_ASH) | 16 #if defined(USE_ASH) |
17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
18 #endif | 18 #endif |
19 | 19 |
20 namespace remoting { | 20 namespace remoting { |
21 | 21 |
22 AuraDesktopCapturer::AuraDesktopCapturer() | 22 AuraDesktopCapturer::AuraDesktopCapturer() |
23 : callback_(nullptr), desktop_window_(nullptr), weak_factory_(this) { | 23 : callback_(nullptr), desktop_window_(nullptr), weak_factory_(this) {} |
24 } | |
25 | 24 |
26 AuraDesktopCapturer::~AuraDesktopCapturer() { | 25 AuraDesktopCapturer::~AuraDesktopCapturer() {} |
27 } | |
28 | 26 |
29 void AuraDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { | 27 void AuraDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { |
30 #if defined(USE_ASH) | 28 #if defined(USE_ASH) |
31 if (ash::Shell::HasInstance()) { | 29 if (ash::Shell::HasInstance()) { |
32 // TODO(kelvinp): Use ash::Shell::GetAllRootWindows() when multiple monitor | 30 // TODO(kelvinp): Use ash::Shell::GetAllRootWindows() when multiple monitor |
33 // support is implemented. | 31 // support is implemented. |
34 desktop_window_ = ash::Shell::GetPrimaryRootWindow(); | 32 desktop_window_ = ash::Shell::GetPrimaryRootWindow(); |
35 DCHECK(desktop_window_) << "Failed to retrieve the Aura Shell root window"; | 33 DCHECK(desktop_window_) << "Failed to retrieve the Aura Shell root window"; |
36 } | 34 } |
37 #endif | 35 #endif |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 frame->size().width(), frame->size().height()); | 70 frame->size().width(), frame->size().height()); |
73 | 71 |
74 // TODO(kelvinp): Set Frame DPI according to the screen resolution. | 72 // TODO(kelvinp): Set Frame DPI according to the screen resolution. |
75 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). | 73 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). |
76 frame->mutable_updated_region()->SetRect(rect); | 74 frame->mutable_updated_region()->SetRect(rect); |
77 | 75 |
78 callback_->OnCaptureResult(DesktopCapturer::Result::SUCCESS, | 76 callback_->OnCaptureResult(DesktopCapturer::Result::SUCCESS, |
79 std::move(frame)); | 77 std::move(frame)); |
80 } | 78 } |
81 | 79 |
| 80 bool AuraDesktopCapturer::GetSourceList(SourceList* sources) { |
| 81 // TODO(zijiehe): Implement screen enumeration. |
| 82 sources->push_back({0}); |
| 83 return true; |
| 84 } |
| 85 |
| 86 bool AuraDesktopCapturer::SelectSource(SourceId id) { |
| 87 // TODO(zijiehe): Implement screen selection. |
| 88 return true; |
| 89 } |
| 90 |
82 } // namespace remoting | 91 } // namespace remoting |
OLD | NEW |