| OLD | NEW |
| 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/desktop_environment.h" | 5 #include "remoting/host/desktop_environment.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "remoting/host/capturer.h" | 9 #include "remoting/host/capturer.h" |
| 10 #include "remoting/host/chromoting_host.h" | 10 #include "remoting/host/chromoting_host.h" |
| 11 #include "remoting/host/chromoting_host_context.h" | 11 #include "remoting/host/chromoting_host_context.h" |
| 12 #include "remoting/host/event_executor.h" | 12 #include "remoting/host/event_executor.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include "remoting/host/session_event_executor_win.h" | 15 #include "remoting/host/session_event_executor_win.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace remoting { | 18 namespace remoting { |
| 19 | 19 |
| 20 // static | 20 // static |
| 21 scoped_ptr<DesktopEnvironment> DesktopEnvironment::Create( | 21 scoped_ptr<DesktopEnvironment> DesktopEnvironment::Create( |
| 22 ChromotingHostContext* context) { | 22 ChromotingHostContext* context) { |
| 23 scoped_ptr<Capturer> capturer(Capturer::Create()); | 23 scoped_ptr<Capturer> capturer(Capturer::Create()); |
| 24 scoped_ptr<EventExecutor> event_executor = | 24 scoped_ptr<EventExecutor> event_executor = |
| 25 EventExecutor::Create(context->desktop_message_loop(), capturer.get()); | 25 EventExecutor::Create(context->desktop_message_loop(), |
| 26 context->ui_message_loop(), |
| 27 capturer.get()); |
| 26 | 28 |
| 27 if (capturer.get() == NULL || event_executor.get() == NULL) { | 29 if (capturer.get() == NULL || event_executor.get() == NULL) { |
| 28 LOG(ERROR) << "Unable to create DesktopEnvironment"; | 30 LOG(ERROR) << "Unable to create DesktopEnvironment"; |
| 29 return scoped_ptr<DesktopEnvironment>(); | 31 return scoped_ptr<DesktopEnvironment>(); |
| 30 } | 32 } |
| 31 | 33 |
| 32 return scoped_ptr<DesktopEnvironment>( | 34 return scoped_ptr<DesktopEnvironment>( |
| 33 new DesktopEnvironment(context, | 35 new DesktopEnvironment(context, |
| 34 capturer.Pass(), | 36 capturer.Pass(), |
| 35 event_executor.Pass())); | 37 event_executor.Pass())); |
| 36 } | 38 } |
| 37 | 39 |
| 38 // static | 40 // static |
| 39 scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService( | 41 scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService( |
| 40 ChromotingHostContext* context) { | 42 ChromotingHostContext* context) { |
| 41 scoped_ptr<Capturer> capturer(Capturer::Create()); | 43 scoped_ptr<Capturer> capturer(Capturer::Create()); |
| 42 scoped_ptr<EventExecutor> event_executor = | 44 scoped_ptr<EventExecutor> event_executor = |
| 43 EventExecutor::Create(context->desktop_message_loop(), capturer.get()); | 45 EventExecutor::Create(context->desktop_message_loop(), |
| 46 context->ui_message_loop(), |
| 47 capturer.get()); |
| 44 | 48 |
| 45 if (capturer.get() == NULL || event_executor.get() == NULL) { | 49 if (capturer.get() == NULL || event_executor.get() == NULL) { |
| 46 LOG(ERROR) << "Unable to create DesktopEnvironment"; | 50 LOG(ERROR) << "Unable to create DesktopEnvironment"; |
| 47 return scoped_ptr<DesktopEnvironment>(); | 51 return scoped_ptr<DesktopEnvironment>(); |
| 48 } | 52 } |
| 49 | 53 |
| 50 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
| 51 event_executor.reset(new SessionEventExecutorWin( | 55 event_executor.reset(new SessionEventExecutorWin( |
| 52 context->desktop_message_loop(), | 56 context->desktop_message_loop(), |
| 53 context->file_message_loop(), | 57 context->file_message_loop(), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 90 |
| 87 void DesktopEnvironment::OnSessionStarted() { | 91 void DesktopEnvironment::OnSessionStarted() { |
| 88 event_executor_->OnSessionStarted(); | 92 event_executor_->OnSessionStarted(); |
| 89 } | 93 } |
| 90 | 94 |
| 91 void DesktopEnvironment::OnSessionFinished() { | 95 void DesktopEnvironment::OnSessionFinished() { |
| 92 event_executor_->OnSessionFinished(); | 96 event_executor_->OnSessionFinished(); |
| 93 } | 97 } |
| 94 | 98 |
| 95 } // namespace remoting | 99 } // namespace remoting |
| OLD | NEW |