Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / web_dialogs / test / test_web_dialog_delegate.cc
blobcf3e65902f92f7dfec34a5c1399705576857ef62
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.
5 #include "ui/web_dialogs/test/test_web_dialog_delegate.h"
7 #include "base/strings/utf_string_conversions.h"
9 using content::WebContents;
10 using content::WebUIMessageHandler;
12 namespace ui {
13 namespace test {
15 TestWebDialogDelegate::TestWebDialogDelegate(const GURL& url)
16 : url_(url),
17 size_(400, 400) {
20 TestWebDialogDelegate::~TestWebDialogDelegate() {
23 ModalType TestWebDialogDelegate::GetDialogModalType() const {
24 return MODAL_TYPE_WINDOW;
27 base::string16 TestWebDialogDelegate::GetDialogTitle() const {
28 return base::UTF8ToUTF16("Test");
31 GURL TestWebDialogDelegate::GetDialogContentURL() const {
32 return url_;
35 void TestWebDialogDelegate::GetWebUIMessageHandlers(
36 std::vector<WebUIMessageHandler*>* handlers) const {
39 void TestWebDialogDelegate::GetDialogSize(gfx::Size* size) const {
40 *size = size_;
43 std::string TestWebDialogDelegate::GetDialogArgs() const {
44 return std::string();
47 void TestWebDialogDelegate::OnDialogClosed(const std::string& json_retval) {
50 void TestWebDialogDelegate::OnCloseContents(WebContents* source,
51 bool* out_close_dialog) {
52 if (out_close_dialog)
53 *out_close_dialog = true;
56 bool TestWebDialogDelegate::ShouldShowDialogTitle() const {
57 return true;
60 } // namespace test
61 } // namespace ui