summaryrefslogtreecommitdiffstats
path: root/chrome/test/webdriver/commands/title_command.cc
blob: 544aaa605d6148f41aa7cad40c8a5657da15280e (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
// 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 <string>

#include "base/utf_string_conversions.h"
#include "chrome/test/webdriver/commands/title_command.h"

namespace webdriver {

void TitleCommand::ExecuteGet(Response* const response) {
  std::wstring title;
  if (!tab_->GetTabTitle(&title)) {
    SET_WEBDRIVER_ERROR(response, "GetTabTitle failed", kInternalServerError);
    return;
  }

  response->set_value(new StringValue(WideToUTF16(title)));
  response->set_status(kSuccess);
}

}  // namespace webdriver