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

Unified Diff: remoting/host/desktop_environment_fake.cc

Issue 11761019: Tiny little refactoring of DesktopEnvironment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/desktop_environment_fake.h ('k') | remoting/host/desktop_session_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_environment_fake.cc
diff --git a/remoting/host/desktop_environment_fake.cc b/remoting/host/desktop_environment_fake.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d914dc7b6b045af65ac520ad187a988a69c3cd6a
--- /dev/null
+++ b/remoting/host/desktop_environment_fake.cc
@@ -0,0 +1,87 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/desktop_environment_fake.h"
+
+#include "base/single_thread_task_runner.h"
+#include "remoting/capturer/video_frame_capturer_fake.h"
+#include "remoting/codec/audio_encoder.h"
+#include "remoting/codec/video_encoder.h"
+#include "remoting/host/video_scheduler.h"
+
+namespace remoting {
+
+DesktopEnvironmentFake::DesktopEnvironmentFake(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner)
+ : caller_task_runner_(caller_task_runner) {
+}
+
+DesktopEnvironmentFake::~DesktopEnvironmentFake() {
+ // Stop the video scheduler and clear references to the client's stubs.
+ if (video_scheduler_.get()) {
+ video_scheduler_->Stop();
+ video_scheduler_ = NULL;
+ }
+}
+
+void DesktopEnvironmentFake::InjectClipboardEvent(
+ const protocol::ClipboardEvent& event) {
+}
+
+void DesktopEnvironmentFake::InjectKeyEvent(const protocol::KeyEvent& event) {
+}
+
+void DesktopEnvironmentFake::InjectMouseEvent(
+ const protocol::MouseEvent& event) {
+}
+
+void DesktopEnvironmentFake::StartAudio(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
+ scoped_ptr<AudioEncoder> audio_encoder,
+ protocol::AudioStub* audio_stub) {
+}
+
+void DesktopEnvironmentFake::PauseAudio(bool pause) {
+}
+
+void DesktopEnvironmentFake::StartInput(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
+ protocol::ClipboardStub* clipboard_stub) {
+}
+
+void DesktopEnvironmentFake::StartVideo(
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
+ scoped_ptr<VideoEncoder> video_encoder,
+ protocol::CursorShapeStub* cursor_shape_stub,
+ protocol::VideoStub* video_stub) {
+ DCHECK(!video_scheduler_.get());
+
+ // Create a fake video capturer that generates artificial image for testing
+ // purpose.
+ scoped_ptr<VideoFrameCapturer> video_capturer(new VideoFrameCapturerFake());
+
+ // Create and start video scheduler. The |cursor_shape_stub| and |video_stub|
+ // references are cleared by ~LocalDesktopEnvironment().
+ video_scheduler_ = VideoScheduler::Create(capture_task_runner,
+ encode_task_runner,
+ caller_task_runner_,
+ video_capturer.Pass(),
+ video_encoder.Pass(),
+ cursor_shape_stub,
+ video_stub);
+}
+
+SkISize DesktopEnvironmentFake::GetScreenSize() const {
+ return SkISize::Make(0, 0);
+}
+
+void DesktopEnvironmentFake::PauseVideo(bool pause) {
+}
+
+void DesktopEnvironmentFake::UpdateSequenceNumber(int64 sequence_number) {
+}
+
+} // namespace remoting
« no previous file with comments | « remoting/host/desktop_environment_fake.h ('k') | remoting/host/desktop_session_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698