OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/test_html_dialog_ui_delegate.h" | 5 #include "chrome/browser/ui/webui/test_web_dialog_delegate.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 | 8 |
9 using content::WebContents; | 9 using content::WebContents; |
10 using content::WebUIMessageHandler; | 10 using content::WebUIMessageHandler; |
11 | 11 |
12 namespace test { | 12 namespace test { |
13 | 13 |
14 TestHtmlDialogUIDelegate::TestHtmlDialogUIDelegate(const GURL& url) | 14 TestWebDialogDelegate::TestWebDialogDelegate(const GURL& url) |
15 : url_(url), | 15 : url_(url), |
16 size_(400, 400) { | 16 size_(400, 400) { |
17 } | 17 } |
18 | 18 |
19 TestHtmlDialogUIDelegate::~TestHtmlDialogUIDelegate() { | 19 TestWebDialogDelegate::~TestWebDialogDelegate() { |
20 } | 20 } |
21 | 21 |
22 ui::ModalType TestHtmlDialogUIDelegate::GetDialogModalType() const { | 22 ui::ModalType TestWebDialogDelegate::GetDialogModalType() const { |
23 return ui::MODAL_TYPE_WINDOW; | 23 return ui::MODAL_TYPE_WINDOW; |
24 } | 24 } |
25 | 25 |
26 string16 TestHtmlDialogUIDelegate::GetDialogTitle() const { | 26 string16 TestWebDialogDelegate::GetDialogTitle() const { |
27 return UTF8ToUTF16("Test"); | 27 return UTF8ToUTF16("Test"); |
28 } | 28 } |
29 | 29 |
30 GURL TestHtmlDialogUIDelegate::GetDialogContentURL() const { | 30 GURL TestWebDialogDelegate::GetDialogContentURL() const { |
31 return url_; | 31 return url_; |
32 } | 32 } |
33 | 33 |
34 void TestHtmlDialogUIDelegate::GetWebUIMessageHandlers( | 34 void TestWebDialogDelegate::GetWebUIMessageHandlers( |
35 std::vector<WebUIMessageHandler*>* handlers) const { | 35 std::vector<WebUIMessageHandler*>* handlers) const { |
36 } | 36 } |
37 | 37 |
38 void TestHtmlDialogUIDelegate::GetDialogSize(gfx::Size* size) const { | 38 void TestWebDialogDelegate::GetDialogSize(gfx::Size* size) const { |
39 *size = size_; | 39 *size = size_; |
40 } | 40 } |
41 | 41 |
42 std::string TestHtmlDialogUIDelegate::GetDialogArgs() const { | 42 std::string TestWebDialogDelegate::GetDialogArgs() const { |
43 return std::string(); | 43 return std::string(); |
44 } | 44 } |
45 | 45 |
46 void TestHtmlDialogUIDelegate::OnDialogClosed(const std::string& json_retval) { | 46 void TestWebDialogDelegate::OnDialogClosed(const std::string& json_retval) { |
47 } | 47 } |
48 | 48 |
49 void TestHtmlDialogUIDelegate::OnCloseContents(WebContents* source, | 49 void TestWebDialogDelegate::OnCloseContents(WebContents* source, |
50 bool* out_close_dialog) { | 50 bool* out_close_dialog) { |
51 if (out_close_dialog) | 51 if (out_close_dialog) |
52 *out_close_dialog = true; | 52 *out_close_dialog = true; |
53 } | 53 } |
54 | 54 |
55 bool TestHtmlDialogUIDelegate::ShouldShowDialogTitle() const { | 55 bool TestWebDialogDelegate::ShouldShowDialogTitle() const { |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
59 } // namespace test | 59 } // namespace test |
OLD | NEW |