#ifndef CLOUD_PRINT_SERVICE_SERVICE_LISTENER_H_
#define CLOUD_PRINT_SERVICE_SERVICE_LISTENER_H_
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "ipc/ipc_listener.h"
namespace base {
class Thread;
}
namespace IPC {
class Channel;
}
class ServiceListener : public IPC::Listener {
public:
explicit ServiceListener(const base::FilePath& user_data_dir);
virtual ~ServiceListener();
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
private:
void Disconnect();
void Connect();
scoped_ptr<base::Thread> ipc_thread_;
scoped_ptr<IPC::Channel> channel_;
base::FilePath user_data_dir_;
};
#endif