| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/it2me_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" | |
| 10 #include "remoting/host/client_session_control.h" | 9 #include "remoting/host/client_session_control.h" |
| 11 #include "remoting/host/desktop_resizer.h" | |
| 12 #include "remoting/host/host_window.h" | 10 #include "remoting/host/host_window.h" |
| 13 #include "remoting/host/resizing_host_observer.h" | 11 #include "remoting/host/host_window_proxy.h" |
| 14 #include "remoting/host/screen_controls.h" | |
| 15 #include "remoting/host/ui_strings.h" | 12 #include "remoting/host/ui_strings.h" |
| 16 | 13 |
| 17 namespace remoting { | 14 namespace remoting { |
| 18 | 15 |
| 19 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() { | 16 It2MeDesktopEnvironment::~It2MeDesktopEnvironment() { |
| 20 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 17 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 21 } | 18 } |
| 22 | 19 |
| 23 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { | 20 It2MeDesktopEnvironment::It2MeDesktopEnvironment( |
| 24 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
| 25 | |
| 26 return scoped_ptr<ScreenControls>( | |
| 27 new ResizingHostObserver(DesktopResizer::Create())); | |
| 28 } | |
| 29 | |
| 30 scoped_ptr<media::ScreenCapturer> | |
| 31 Me2MeDesktopEnvironment::CreateVideoCapturer() { | |
| 32 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
| 33 | |
| 34 #if defined(OS_LINUX) | |
| 35 return media::ScreenCapturer::CreateWithXDamage(true); | |
| 36 #else // !defined(OS_LINUX) | |
| 37 return media::ScreenCapturer::Create(); | |
| 38 #endif // !defined(OS_LINUX) | |
| 39 } | |
| 40 | |
| 41 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( | |
| 42 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 21 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 43 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 22 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 44 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 23 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 45 base::WeakPtr<ClientSessionControl> client_session_control, | 24 base::WeakPtr<ClientSessionControl> client_session_control, |
| 46 const UiStrings* ui_strings) | 25 const UiStrings* ui_strings) |
| 47 : BasicDesktopEnvironment(caller_task_runner, | 26 : BasicDesktopEnvironment(caller_task_runner, |
| 48 input_task_runner, | 27 input_task_runner, |
| 49 ui_task_runner, | 28 ui_task_runner, |
| 50 client_session_control, | 29 client_session_control, |
| 51 ui_strings) { | 30 ui_strings) { |
| 52 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 31 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 32 |
| 33 // Create the Continue window. |
| 34 continue_window_ = HostWindow::CreateContinueWindow(*ui_strings); |
| 35 continue_window_.reset(new HostWindowProxy( |
| 36 caller_task_runner, |
| 37 ui_task_runner, |
| 38 continue_window_.Pass())); |
| 39 continue_window_->Start(client_session_control); |
| 53 } | 40 } |
| 54 | 41 |
| 55 Me2MeDesktopEnvironmentFactory::Me2MeDesktopEnvironmentFactory( | 42 It2MeDesktopEnvironmentFactory::It2MeDesktopEnvironmentFactory( |
| 56 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 43 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 57 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 44 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 58 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 45 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 59 const UiStrings& ui_strings) | 46 const UiStrings& ui_strings) |
| 60 : BasicDesktopEnvironmentFactory(caller_task_runner, | 47 : BasicDesktopEnvironmentFactory(caller_task_runner, |
| 61 input_task_runner, | 48 input_task_runner, |
| 62 ui_task_runner, | 49 ui_task_runner, |
| 63 ui_strings) { | 50 ui_strings) { |
| 64 } | 51 } |
| 65 | 52 |
| 66 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() { | 53 It2MeDesktopEnvironmentFactory::~It2MeDesktopEnvironmentFactory() { |
| 67 } | 54 } |
| 68 | 55 |
| 69 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create( | 56 scoped_ptr<DesktopEnvironment> It2MeDesktopEnvironmentFactory::Create( |
| 70 base::WeakPtr<ClientSessionControl> client_session_control) { | 57 base::WeakPtr<ClientSessionControl> client_session_control) { |
| 71 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 58 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 72 | 59 |
| 73 return scoped_ptr<DesktopEnvironment>( | 60 return scoped_ptr<DesktopEnvironment>( |
| 74 new Me2MeDesktopEnvironment(caller_task_runner(), | 61 new It2MeDesktopEnvironment(caller_task_runner(), |
| 75 input_task_runner(), | 62 input_task_runner(), |
| 76 ui_task_runner(), | 63 ui_task_runner(), |
| 77 client_session_control, | 64 client_session_control, |
| 78 &ui_strings())); | 65 &ui_strings())); |
| 79 } | 66 } |
| 80 | 67 |
| 81 } // namespace remoting | 68 } // namespace remoting |
| OLD | NEW |