#ifndef REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_
#define REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "remoting/host/desktop_environment.h"
namespace remoting {
class GnubbyAuthHandler;
class BasicDesktopEnvironment : public DesktopEnvironment {
public:
virtual ~BasicDesktopEnvironment();
virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE;
virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE;
virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE;
virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE;
virtual std::string GetCapabilities() const OVERRIDE;
virtual void SetCapabilities(const std::string& capabilities) OVERRIDE;
virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler(
protocol::ClientStub* client_stub) OVERRIDE;
protected:
friend class BasicDesktopEnvironmentFactory;
BasicDesktopEnvironment(
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const {
return caller_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const {
return input_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const {
return ui_task_runner_;
}
private:
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment);
};
class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
public:
BasicDesktopEnvironmentFactory(
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
virtual ~BasicDesktopEnvironmentFactory();
virtual bool SupportsAudioCapture() const OVERRIDE;
protected:
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const {
return caller_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const {
return input_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const {
return ui_task_runner_;
}
private:
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory);
};
}
#endif