summaryrefslogtreecommitdiffstats
path: root/remoting/host/host_stub_fake.cc
blob: 895b21a3ce3d069e547ab336eb27dd11a20a9214 (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
// Copyright (c) 2010 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.

#include "base/task.h"
#include "remoting/host/chromoting_host.h"
#include "remoting/host/host_stub_fake.h"
#include "remoting/proto/auth.pb.h"
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/connection_to_client.h"

namespace remoting {

HostStubFake::HostStubFake(ChromotingHost* host)
    : host_(host) {
}

void HostStubFake::SuggestResolution(
    const protocol::SuggestResolutionRequest* msg, Task* done) {
  done->Run();
  delete done;
}

void HostStubFake::BeginSessionRequest(
    const protocol::LocalLoginCredentials* credentials, Task* done) {
  done->Run();
  delete done;

  protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus();
  status->set_success(true);
  host_->connection_to_client()->client_stub()->BeginSessionResponse(
      status, new DeleteTask<protocol::LocalLoginStatus>(status));
  host_->LocalLoginSucceeded();
}

}  // namespace remoting