summaryrefslogtreecommitdiffstats
path: root/chrome/browser/remoting/setup_flow_start_host_step.h
blob: 2780ad77ac7de9f5d6f3d9674e0041df71463011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_REMOTING_SETUP_FLOW_START_HOST_STEP_H_
#define CHROME_BROWSER_REMOTING_SETUP_FLOW_START_HOST_STEP_H_

#include "chrome/browser/remoting/setup_flow.h"
#include "chrome/browser/service/service_process_control.h"
#include "chrome/common/net/gaia/gaia_auth_consumer.h"
#include "chrome/common/net/gaia/gaia_auth_fetcher.h"

namespace remoting {

// SetupFlowStartHostStep is the final step in the remoting setup
// flow. It starts the chromoting hosts and then requests current
// state to verify that it was started successfully.
class SetupFlowStartHostStep : public SetupFlowStepBase,
                               public ServiceProcessControl::MessageHandler {
 public:
  SetupFlowStartHostStep();
  virtual ~SetupFlowStartHostStep();

  // SetupFlowStep implementation.
  virtual void HandleMessage(const std::string& message, const Value* arg);
  virtual void Cancel();

  // ServiceProcessControl::MessageHandler interface
  virtual void OnRemotingHostInfo(
      const remoting::ChromotingHostInfo& host_info);

 protected:
  virtual void DoStart();

 private:
  void RequestStatus();

  ScopedRunnableMethodFactory<SetupFlowStartHostStep> task_factory_;
  ServiceProcessControl* process_control_;
  bool status_requested_;

  DISALLOW_COPY_AND_ASSIGN(SetupFlowStartHostStep);
};

class SetupFlowStartHostErrorStep : public SetupFlowErrorStepBase {
 public:
  SetupFlowStartHostErrorStep();
  virtual ~SetupFlowStartHostErrorStep();

 protected:
  virtual string16 GetErrorMessage();
  virtual void Retry();

 private:
  DISALLOW_COPY_AND_ASSIGN(SetupFlowStartHostErrorStep);
};

}  // namespace remoting

#endif  // CHROME_BROWSER_REMOTING_SETUP_FLOW_START_HOST_STEP_H_