| 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 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_FACTORY_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_FACTORY_H_ |
| 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_FACTORY_H_ | 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_FACTORY_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" |
| 9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 11 | 14 |
| 12 namespace base { | 15 namespace base { |
| 13 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 14 } // namespace base | 17 } // namespace base |
| 15 | 18 |
| 16 namespace remoting { | 19 namespace remoting { |
| 17 | 20 |
| 18 class DesktopEnvironment; | 21 class DesktopEnvironment; |
| 19 | 22 |
| 20 class DesktopEnvironmentFactory { | 23 class DesktopEnvironmentFactory { |
| 21 public: | 24 public: |
| 22 DesktopEnvironmentFactory( | 25 explicit DesktopEnvironmentFactory( |
| 23 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 26 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner); |
| 24 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | |
| 25 virtual ~DesktopEnvironmentFactory(); | 27 virtual ~DesktopEnvironmentFactory(); |
| 26 | 28 |
| 27 // Creates an instance of |DesktopEnvironment|. | 29 // Creates an instance of |DesktopEnvironment|. |disconnect_callback| is |
| 28 virtual scoped_ptr<DesktopEnvironment> Create(); | 30 // cached by the created DesktopEnvironment and can be invoked later to |
| 31 // disconnect the client session. |
| 32 virtual scoped_ptr<DesktopEnvironment> Create( |
| 33 const std::string& client_jid, |
| 34 const base::Closure& disconnect_callback); |
| 29 | 35 |
| 30 // Returns |true| if created |DesktopEnvironment| instances support audio | 36 // Returns |true| if created |DesktopEnvironment| instances support audio |
| 31 // capture. | 37 // capture. |
| 32 virtual bool SupportsAudioCapture() const; | 38 virtual bool SupportsAudioCapture() const; |
| 33 | 39 |
| 34 protected: | 40 protected: |
| 35 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 41 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() { |
| 36 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 42 return caller_task_runner_; |
| 43 } |
| 44 |
| 45 private: |
| 46 // Task runner on which public methods of this class should be called. |
| 47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 37 | 48 |
| 38 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironmentFactory); | 49 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironmentFactory); |
| 39 }; | 50 }; |
| 40 | 51 |
| 41 } // namespace remoting | 52 } // namespace remoting |
| 42 | 53 |
| 43 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_FACTORY_H_ | 54 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_FACTORY_H_ |
| OLD | NEW |