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

Side by Side Diff: remoting/host/me2me_desktop_environment.cc

Issue 12594009: Converted LocalInputMonitor into a SessionController instance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/me2me_desktop_environment.h" 5 #include "remoting/host/me2me_desktop_environment.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/video/capture/screen/screen_capturer.h" 8 #include "media/video/capture/screen/screen_capturer.h"
9 #include "remoting/host/audio_capturer.h" 9 #include "remoting/host/audio_capturer.h"
10 #include "remoting/host/desktop_resizer.h" 10 #include "remoting/host/desktop_resizer.h"
11 #include "remoting/host/event_executor.h" 11 #include "remoting/host/event_executor.h"
12 #include "remoting/host/local_input_monitor.h"
12 #include "remoting/host/resizing_host_observer.h" 13 #include "remoting/host/resizing_host_observer.h"
13 #include "remoting/host/session_controller.h" 14 #include "remoting/host/session_controller.h"
15 #include "remoting/host/session_controller_list.h"
14 16
15 namespace remoting { 17 namespace remoting {
16 18
17 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() { 19 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() {
18 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 20 DCHECK(caller_task_runner()->BelongsToCurrentThread());
19 } 21 }
20 22
21 scoped_ptr<SessionController> 23 scoped_ptr<SessionController>
22 Me2MeDesktopEnvironment::CreateSessionController( 24 Me2MeDesktopEnvironment::CreateSessionController(
23 const std::string& client_jid, 25 const std::string& client_jid,
24 SessionController::Delegate* delegate) { 26 SessionController::Delegate* delegate) {
25 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 27 DCHECK(caller_task_runner()->BelongsToCurrentThread());
26 28
27 scoped_ptr<SessionController> session_controller( 29 scoped_ptr<SessionControllerList> controllers(new SessionControllerList());
30
31 // Create the session controller handling the resize-to-client events.
32 scoped_ptr<SessionController> resizing_host_observer(
28 new ResizingHostObserver(DesktopResizer::Create())); 33 new ResizingHostObserver(DesktopResizer::Create()));
29 return session_controller.Pass(); 34 controllers->AddController(resizing_host_observer.Pass());
35
36 // Create the local input monitor.
37 scoped_ptr<LocalInputMonitor> local_input_monitor =
38 LocalInputMonitor::Create(caller_task_runner(),
39 input_task_runner(),
40 ui_task_runner(),
41 delegate);
42 controllers->AddController(local_input_monitor.PassAs<SessionController>());
43
44 return controllers.PassAs<SessionController>();
30 } 45 }
31 46
32 scoped_ptr<media::ScreenCapturer> 47 scoped_ptr<media::ScreenCapturer>
33 Me2MeDesktopEnvironment::CreateVideoCapturer() { 48 Me2MeDesktopEnvironment::CreateVideoCapturer() {
34 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 49 DCHECK(caller_task_runner()->BelongsToCurrentThread());
35 50
36 #if defined(OS_LINUX) 51 #if defined(OS_LINUX)
37 return media::ScreenCapturer::CreateWithXDamage(true); 52 return media::ScreenCapturer::CreateWithXDamage(true);
38 #else // !defined(OS_LINUX) 53 #else // !defined(OS_LINUX)
39 return media::ScreenCapturer::Create(); 54 return media::ScreenCapturer::Create();
(...skipping 25 matching lines...) Expand all
65 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create() { 80 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create() {
66 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 81 DCHECK(caller_task_runner()->BelongsToCurrentThread());
67 82
68 return scoped_ptr<DesktopEnvironment>( 83 return scoped_ptr<DesktopEnvironment>(
69 new Me2MeDesktopEnvironment(caller_task_runner(), 84 new Me2MeDesktopEnvironment(caller_task_runner(),
70 input_task_runner(), 85 input_task_runner(),
71 ui_task_runner())); 86 ui_task_runner()));
72 } 87 }
73 88
74 } // namespace remoting 89 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698