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