| 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 namespace content { |
| 10 class JavaScriptDialogCreator; |
| 11 } |
| 10 | 12 |
| 11 #include "ipc/ipc_message.h" | 13 // Returns a JavaScriptDialogCreator that creates real dialogs. |
| 12 | 14 content::JavaScriptDialogCreator* GetJavaScriptDialogCreatorInstance(); |
| 13 class GURL; | |
| 14 class JavaScriptAppModalDialogDelegate; | |
| 15 class TabContents; | |
| 16 class Profile; | |
| 17 | |
| 18 // Creates and runs a Javascript Message Box dialog. | |
| 19 // 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 // 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 // |reply_msg|. | |
| 24 void RunJavascriptMessageBox(Profile* profile, | |
| 25 JavaScriptAppModalDialogDelegate* delegate, | |
| 26 const GURL& frame_url, | |
| 27 int dialog_flags, | |
| 28 const std::wstring& message_text, | |
| 29 const std::wstring& default_prompt_text, | |
| 30 bool display_suppress_checkbox, | |
| 31 IPC::Message* reply_msg); | |
| 32 | |
| 33 // 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 // |message_text| between the header and footer. The users response is | |
| 36 // returned to the renderer using |reply_msg|. | |
| 37 void RunBeforeUnloadDialog(TabContents* tab_contents, | |
| 38 const std::wstring& message_text, | |
| 39 IPC::Message* reply_msg); | |
| 40 | 15 |
| 41 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ | 16 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ |
| OLD | NEW |