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#include "ui/web_dialogs/test/test_web_dialog_delegate.h"
6
7#include "base/strings/utf_string_conversions.h"
8
9using content::WebContents;
10using content::WebUIMessageHandler;
11
12namespace ui {
13namespace test {
14
15TestWebDialogDelegate::TestWebDialogDelegate(const GURL& url)
16    : url_(url),
17      size_(400, 400) {
18}
19
20TestWebDialogDelegate::~TestWebDialogDelegate() {
21}
22
23ModalType TestWebDialogDelegate::GetDialogModalType() const {
24  return MODAL_TYPE_WINDOW;
25}
26
27base::string16 TestWebDialogDelegate::GetDialogTitle() const {
28  return base::UTF8ToUTF16("Test");
29}
30
31GURL TestWebDialogDelegate::GetDialogContentURL() const {
32  return url_;
33}
34
35void TestWebDialogDelegate::GetWebUIMessageHandlers(
36    std::vector<WebUIMessageHandler*>* handlers) const {
37}
38
39void TestWebDialogDelegate::GetDialogSize(gfx::Size* size) const {
40  *size = size_;
41}
42
43std::string TestWebDialogDelegate::GetDialogArgs() const {
44  return std::string();
45}
46
47void TestWebDialogDelegate::OnDialogClosed(const std::string& json_retval) {
48}
49
50void TestWebDialogDelegate::OnCloseContents(WebContents* source,
51    bool* out_close_dialog) {
52  if (out_close_dialog)
53    *out_close_dialog = true;
54}
55
56bool TestWebDialogDelegate::ShouldShowDialogTitle() const {
57  return true;
58}
59
60}  // namespace test
61}  // namespace ui
62