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/logging.h"
8 #include "base/strings/utf_string_conversions.h"
10 using content::WebContents
;
11 using content::WebUIMessageHandler
;
16 TestWebDialogDelegate::TestWebDialogDelegate(const GURL
& url
)
17 : url_(url
), size_(400, 400), did_delete_(nullptr) {
20 TestWebDialogDelegate::~TestWebDialogDelegate() {
27 void TestWebDialogDelegate::SetDeleteOnClosedAndObserve(
28 bool* destroy_observer
) {
29 CHECK(destroy_observer
);
30 did_delete_
= destroy_observer
;
33 ModalType
TestWebDialogDelegate::GetDialogModalType() const {
34 return MODAL_TYPE_WINDOW
;
37 base::string16
TestWebDialogDelegate::GetDialogTitle() const {
38 return base::UTF8ToUTF16("Test");
41 GURL
TestWebDialogDelegate::GetDialogContentURL() const {
45 void TestWebDialogDelegate::GetWebUIMessageHandlers(
46 std::vector
<WebUIMessageHandler
*>* handlers
) const {
49 void TestWebDialogDelegate::GetDialogSize(gfx::Size
* size
) const {
53 std::string
TestWebDialogDelegate::GetDialogArgs() const {
57 void TestWebDialogDelegate::OnDialogClosed(const std::string
& json_retval
) {
62 void TestWebDialogDelegate::OnCloseContents(WebContents
* source
,
63 bool* out_close_dialog
) {
64 *out_close_dialog
= true;
67 bool TestWebDialogDelegate::ShouldShowDialogTitle() const {