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

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

Issue 13212009: Made DesktopEnvironment responsible for creation of the disconnect window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux & Mac. Created 7 years, 8 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 "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "media/video/capture/screen/screen_capturer.h" 9 #include "media/video/capture/screen/screen_capturer.h"
10 #include "remoting/host/client_session_control.h" 10 #include "remoting/host/client_session_control.h"
11 #include "remoting/host/desktop_resizer.h" 11 #include "remoting/host/desktop_resizer.h"
12 #include "remoting/host/host_window.h"
12 #include "remoting/host/resizing_host_observer.h" 13 #include "remoting/host/resizing_host_observer.h"
13 #include "remoting/host/screen_controls.h" 14 #include "remoting/host/screen_controls.h"
15 #include "remoting/host/ui_strings.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<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { 23 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() {
22 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 24 DCHECK(caller_task_runner()->BelongsToCurrentThread());
23 25
24 return scoped_ptr<ScreenControls>( 26 return scoped_ptr<ScreenControls>(
25 new ResizingHostObserver(DesktopResizer::Create())); 27 new ResizingHostObserver(DesktopResizer::Create()));
26 } 28 }
27 29
28 scoped_ptr<media::ScreenCapturer> 30 scoped_ptr<media::ScreenCapturer>
29 Me2MeDesktopEnvironment::CreateVideoCapturer() { 31 Me2MeDesktopEnvironment::CreateVideoCapturer() {
30 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 32 DCHECK(caller_task_runner()->BelongsToCurrentThread());
31 33
32 #if defined(OS_LINUX) 34 #if defined(OS_LINUX)
33 return media::ScreenCapturer::CreateWithXDamage(true); 35 return media::ScreenCapturer::CreateWithXDamage(true);
34 #else // !defined(OS_LINUX) 36 #else // !defined(OS_LINUX)
35 return media::ScreenCapturer::Create(); 37 return media::ScreenCapturer::Create();
36 #endif // !defined(OS_LINUX) 38 #endif // !defined(OS_LINUX)
37 } 39 }
38 40
39 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( 41 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment(
40 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 42 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
41 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 43 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
42 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 44 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
43 base::WeakPtr<ClientSessionControl> client_session_control) 45 base::WeakPtr<ClientSessionControl> client_session_control,
46 const UiStrings* ui_strings)
44 : BasicDesktopEnvironment(caller_task_runner, 47 : BasicDesktopEnvironment(caller_task_runner,
45 input_task_runner, 48 input_task_runner,
46 ui_task_runner, 49 ui_task_runner,
47 client_session_control) { 50 client_session_control,
51 ui_strings) {
48 DCHECK(caller_task_runner->BelongsToCurrentThread()); 52 DCHECK(caller_task_runner->BelongsToCurrentThread());
49 } 53 }
50 54
51 Me2MeDesktopEnvironmentFactory::Me2MeDesktopEnvironmentFactory( 55 Me2MeDesktopEnvironmentFactory::Me2MeDesktopEnvironmentFactory(
52 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 56 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
53 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 57 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
54 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 58 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
59 const UiStrings& ui_strings)
55 : BasicDesktopEnvironmentFactory(caller_task_runner, 60 : BasicDesktopEnvironmentFactory(caller_task_runner,
56 input_task_runner, 61 input_task_runner,
57 ui_task_runner) { 62 ui_task_runner,
63 ui_strings) {
58 } 64 }
59 65
60 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() { 66 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() {
61 } 67 }
62 68
63 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create( 69 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create(
64 base::WeakPtr<ClientSessionControl> client_session_control) { 70 base::WeakPtr<ClientSessionControl> client_session_control) {
65 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 71 DCHECK(caller_task_runner()->BelongsToCurrentThread());
66 72
67 return scoped_ptr<DesktopEnvironment>( 73 return scoped_ptr<DesktopEnvironment>(
68 new Me2MeDesktopEnvironment(caller_task_runner(), 74 new Me2MeDesktopEnvironment(caller_task_runner(),
69 input_task_runner(), 75 input_task_runner(),
70 ui_task_runner(), 76 ui_task_runner(),
71 client_session_control)); 77 client_session_control,
78 &ui_strings()));
72 } 79 }
73 80
74 } // namespace remoting 81 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698