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
3// found in the LICENSE file.
4
5#ifndef REMOTING_HOST_CURTAIN_MODE_H_
6#define REMOTING_HOST_CURTAIN_MODE_H_
7
8#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "base/memory/ref_counted.h"
11#include "base/memory/scoped_ptr.h"
12#include "base/memory/weak_ptr.h"
13
14namespace base {
15class SingleThreadTaskRunner;
16}  // namespace base
17
18namespace remoting {
19
20class ClientSessionControl;
21
22class CurtainMode {
23 public:
24  virtual ~CurtainMode() {}
25
26  // Creates a platform-specific curtain mode implementation object that
27  // "curtains" the current session making sure it is not accessible from
28  // the local console. |client_session_control| can be used to drop
29  // the connection in the case if the session re-connects to the local console
30  // in mid-flight.
31  static scoped_ptr<CurtainMode> Create(
32      scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
33      scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
34      base::WeakPtr<ClientSessionControl> client_session_control);
35
36  // Activates the curtain mode. Returns true if successful.
37  virtual bool Activate() = 0;
38
39 protected:
40  CurtainMode() {}
41
42 private:
43  DISALLOW_COPY_AND_ASSIGN(CurtainMode);
44};
45
46}  // namespace remoting
47
48#endif
49