| 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/fake_desktop_environment.h" | 5 #include "remoting/host/fake_desktop_environment.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" |
| 9 #include "remoting/host/audio_capturer.h" | 10 #include "remoting/host/audio_capturer.h" |
| 10 #include "remoting/host/input_injector.h" | 11 #include "remoting/host/input_injector.h" |
| 11 #include "remoting/proto/event.pb.h" | 12 #include "remoting/proto/event.pb.h" |
| 12 #include "remoting/protocol/fake_desktop_capturer.h" | 13 #include "remoting/protocol/fake_desktop_capturer.h" |
| 13 | 14 |
| 14 namespace remoting { | 15 namespace remoting { |
| 15 | 16 |
| 16 FakeInputInjector::FakeInputInjector() {} | 17 FakeInputInjector::FakeInputInjector() {} |
| 17 FakeInputInjector::~FakeInputInjector() {} | 18 FakeInputInjector::~FakeInputInjector() {} |
| 18 | 19 |
| 19 void FakeInputInjector::Start( | 20 void FakeInputInjector::Start( |
| 20 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 21 std::unique_ptr<protocol::ClipboardStub> client_clipboard) {} |
| 21 } | |
| 22 | 22 |
| 23 void FakeInputInjector::InjectKeyEvent(const protocol::KeyEvent& event) { | 23 void FakeInputInjector::InjectKeyEvent(const protocol::KeyEvent& event) { |
| 24 if (key_events_) | 24 if (key_events_) |
| 25 key_events_->push_back(event); | 25 key_events_->push_back(event); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void FakeInputInjector::InjectTextEvent(const protocol::TextEvent& event) { | 28 void FakeInputInjector::InjectTextEvent(const protocol::TextEvent& event) { |
| 29 if (text_events_) | 29 if (text_events_) |
| 30 text_events_->push_back(event); | 30 text_events_->push_back(event); |
| 31 } | 31 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 void FakeScreenControls::SetScreenResolution( | 52 void FakeScreenControls::SetScreenResolution( |
| 53 const ScreenResolution& resolution) { | 53 const ScreenResolution& resolution) { |
| 54 } | 54 } |
| 55 | 55 |
| 56 FakeDesktopEnvironment::FakeDesktopEnvironment() {} | 56 FakeDesktopEnvironment::FakeDesktopEnvironment() {} |
| 57 | 57 |
| 58 FakeDesktopEnvironment::~FakeDesktopEnvironment() {} | 58 FakeDesktopEnvironment::~FakeDesktopEnvironment() {} |
| 59 | 59 |
| 60 // DesktopEnvironment implementation. | 60 // DesktopEnvironment implementation. |
| 61 scoped_ptr<AudioCapturer> FakeDesktopEnvironment::CreateAudioCapturer() { | 61 std::unique_ptr<AudioCapturer> FakeDesktopEnvironment::CreateAudioCapturer() { |
| 62 return nullptr; | 62 return nullptr; |
| 63 } | 63 } |
| 64 | 64 |
| 65 scoped_ptr<InputInjector> FakeDesktopEnvironment::CreateInputInjector() { | 65 std::unique_ptr<InputInjector> FakeDesktopEnvironment::CreateInputInjector() { |
| 66 scoped_ptr<FakeInputInjector> result(new FakeInputInjector()); | 66 std::unique_ptr<FakeInputInjector> result(new FakeInputInjector()); |
| 67 last_input_injector_ = result->AsWeakPtr(); | 67 last_input_injector_ = result->AsWeakPtr(); |
| 68 return std::move(result); | 68 return std::move(result); |
| 69 } | 69 } |
| 70 | 70 |
| 71 scoped_ptr<ScreenControls> FakeDesktopEnvironment::CreateScreenControls() { | 71 std::unique_ptr<ScreenControls> FakeDesktopEnvironment::CreateScreenControls() { |
| 72 return make_scoped_ptr(new FakeScreenControls()); | 72 return base::WrapUnique(new FakeScreenControls()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 scoped_ptr<webrtc::DesktopCapturer> | 75 std::unique_ptr<webrtc::DesktopCapturer> |
| 76 FakeDesktopEnvironment::CreateVideoCapturer() { | 76 FakeDesktopEnvironment::CreateVideoCapturer() { |
| 77 scoped_ptr<protocol::FakeDesktopCapturer> result( | 77 std::unique_ptr<protocol::FakeDesktopCapturer> result( |
| 78 new protocol::FakeDesktopCapturer()); | 78 new protocol::FakeDesktopCapturer()); |
| 79 if (!frame_generator_.is_null()) | 79 if (!frame_generator_.is_null()) |
| 80 result->set_frame_generator(frame_generator_); | 80 result->set_frame_generator(frame_generator_); |
| 81 return std::move(result); | 81 return std::move(result); |
| 82 } | 82 } |
| 83 | 83 |
| 84 scoped_ptr<webrtc::MouseCursorMonitor> | 84 std::unique_ptr<webrtc::MouseCursorMonitor> |
| 85 FakeDesktopEnvironment::CreateMouseCursorMonitor() { | 85 FakeDesktopEnvironment::CreateMouseCursorMonitor() { |
| 86 return make_scoped_ptr(new FakeMouseCursorMonitor()); | 86 return base::WrapUnique(new FakeMouseCursorMonitor()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 std::string FakeDesktopEnvironment::GetCapabilities() const { | 89 std::string FakeDesktopEnvironment::GetCapabilities() const { |
| 90 return std::string(); | 90 return std::string(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void FakeDesktopEnvironment::SetCapabilities(const std::string& capabilities) {} | 93 void FakeDesktopEnvironment::SetCapabilities(const std::string& capabilities) {} |
| 94 | 94 |
| 95 FakeDesktopEnvironmentFactory::FakeDesktopEnvironmentFactory() {} | 95 FakeDesktopEnvironmentFactory::FakeDesktopEnvironmentFactory() {} |
| 96 FakeDesktopEnvironmentFactory::~FakeDesktopEnvironmentFactory() {} | 96 FakeDesktopEnvironmentFactory::~FakeDesktopEnvironmentFactory() {} |
| 97 | 97 |
| 98 // DesktopEnvironmentFactory implementation. | 98 // DesktopEnvironmentFactory implementation. |
| 99 scoped_ptr<DesktopEnvironment> FakeDesktopEnvironmentFactory::Create( | 99 std::unique_ptr<DesktopEnvironment> FakeDesktopEnvironmentFactory::Create( |
| 100 base::WeakPtr<ClientSessionControl> client_session_control) { | 100 base::WeakPtr<ClientSessionControl> client_session_control) { |
| 101 scoped_ptr<FakeDesktopEnvironment> result(new FakeDesktopEnvironment()); | 101 std::unique_ptr<FakeDesktopEnvironment> result(new FakeDesktopEnvironment()); |
| 102 result->set_frame_generator(frame_generator_); | 102 result->set_frame_generator(frame_generator_); |
| 103 last_desktop_environment_ = result->AsWeakPtr(); | 103 last_desktop_environment_ = result->AsWeakPtr(); |
| 104 return std::move(result); | 104 return std::move(result); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void FakeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) {} | 107 void FakeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) {} |
| 108 | 108 |
| 109 bool FakeDesktopEnvironmentFactory::SupportsAudioCapture() const { | 109 bool FakeDesktopEnvironmentFactory::SupportsAudioCapture() const { |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace remoting | 113 } // namespace remoting |
| OLD | NEW |