OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/string16.h" |
11 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 class JavaScriptAppModalDialogDelegate; | 15 class ChromeJavaScriptDialogDelegate; |
15 class TabContents; | 16 class TabContents; |
16 class Profile; | 17 class Profile; |
17 | 18 |
18 // Creates and runs a Javascript Message Box dialog. | 19 // Creates and runs a Javascript Message Box dialog. |
19 // The dialog type is specified within |dialog_flags|, the | 20 // The dialog type is specified within |dialog_flags|, the |
20 // default static display text is in |message_text| and if the dialog box is | 21 // default static display text is in |message_text| and if the dialog box is |
21 // a user input prompt() box, the default text for the text field is in | 22 // a user input prompt() box, the default text for the text field is in |
22 // |default_prompt_text|. The result of the operation is returned using | 23 // |default_prompt_text|. The result of the operation is returned using |
23 // |reply_msg|. | 24 // |reply_msg|. TODO(avi): Remove Profile from this call; http://crbug.com/84601 |
24 void RunJavascriptMessageBox(Profile* profile, | 25 void RunJavascriptDialogImpl(Profile* profile, |
25 JavaScriptAppModalDialogDelegate* delegate, | 26 ChromeJavaScriptDialogDelegate* delegate, |
26 const GURL& frame_url, | 27 const GURL& frame_url, |
27 int dialog_flags, | 28 int dialog_flags, |
28 const std::wstring& message_text, | 29 const string16& message_text, |
29 const std::wstring& default_prompt_text, | 30 const string16& default_prompt_text, |
30 bool display_suppress_checkbox, | 31 bool display_suppress_checkbox, |
31 IPC::Message* reply_msg); | 32 IPC::Message* reply_msg); |
32 | 33 |
33 // This will display a modal dialog box with a header and footer asking the | 34 // This will display a modal dialog box with a header and footer asking the |
34 // the user if they wish to navigate away from a page, with additional text | 35 // the user if they wish to navigate away from a page, with additional text |
35 // |message_text| between the header and footer. The users response is | 36 // |message_text| between the header and footer. The user's response is |
36 // returned to the renderer using |reply_msg|. | 37 // returned to the renderer using |reply_msg|. |
37 void RunBeforeUnloadDialog(TabContents* tab_contents, | 38 void RunBeforeUnloadDialogImpl(ChromeJavaScriptDialogDelegate* delegate, |
38 const std::wstring& message_text, | 39 const string16& message_text, |
39 IPC::Message* reply_msg); | 40 IPC::Message* reply_msg); |
40 | 41 |
41 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ | 42 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ |
OLD | NEW |