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

Unified Diff: remoting/host/local_desktop_environment.h

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/ipc_event_executor.cc ('k') | remoting/host/local_desktop_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/local_desktop_environment.h
diff --git a/remoting/host/local_desktop_environment.h b/remoting/host/local_desktop_environment.h
new file mode 100644
index 0000000000000000000000000000000000000000..c93830ee83f10d20b5fbfef6bc3c890e006d88dc
--- /dev/null
+++ b/remoting/host/local_desktop_environment.h
@@ -0,0 +1,91 @@
+// 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.
+
+#ifndef REMOTING_HOST_LOCAL_DESKTOP_ENVIRONMENT_H_
+#define REMOTING_HOST_LOCAL_DESKTOP_ENVIRONMENT_H_
+
+#include "remoting/host/desktop_environment.h"
+
+#include "base/basictypes.h"
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
+namespace remoting {
+
+class AudioScheduler;
+class EventExecutor;
+class VideoScheduler;
+
+// Provides a way to capture audio/video and inject input events to the local
+// console.
+class LocalDesktopEnvironment : public DesktopEnvironment {
+ public:
+ // Callback prototype that is invoked to create an instance of the event
+ // executor.
+ typedef base::Callback<scoped_ptr<EventExecutor>(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)>
+ CreateEventExecutorCallback;
+
+ LocalDesktopEnvironment(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ const CreateEventExecutorCallback& create_event_executor_callback);
+ virtual ~LocalDesktopEnvironment();
+
+ // protocol::ClipboardStub implementation.
+ virtual void InjectClipboardEvent(
+ const protocol::ClipboardEvent& event) OVERRIDE;
+
+ // protocol::InputStub implementation.
+ virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
+ virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
+
+ // DesktopEnvironment implementation.
+ virtual void StartAudio(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
+ scoped_ptr<AudioEncoder> audio_encoder,
+ protocol::AudioStub* audio_stub) OVERRIDE;
+ virtual void PauseAudio(bool pause) OVERRIDE;
+ virtual void StartInput(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
+ protocol::ClipboardStub* clipboard_stub) OVERRIDE;
+ virtual void 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) OVERRIDE;
+ virtual SkISize GetScreenSize() const OVERRIDE;
+ virtual void PauseVideo(bool pause) OVERRIDE;
+ virtual void UpdateSequenceNumber(int64 sequence_number) OVERRIDE;
+
+ private:
+ // Task runner on which public methods of this class should be called.
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
+
+ // Schedulers for audio and video capture.
+ scoped_refptr<AudioScheduler> audio_scheduler_;
+ scoped_refptr<VideoScheduler> video_scheduler_;
+
+ // Factory for weak pointers to the client clipboard stub.
+ scoped_ptr<base::WeakPtrFactory<protocol::ClipboardStub> > clipboard_factory_;
+
+ // Invoked create an instance of the event executor.
+ CreateEventExecutorCallback create_event_executor_callback_;
+
+ // Executes input and clipboard events received from the client.
+ scoped_ptr<EventExecutor> event_executor_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalDesktopEnvironment);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_LOCAL_DESKTOP_ENVIRONMENT_H_
« no previous file with comments | « remoting/host/ipc_event_executor.cc ('k') | remoting/host/local_desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698