1// Copyright (c) 2010 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#ifndef 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 8 9#include <string> 10 11#include "ipc/ipc_message.h" 12 13class GURL; 14class JavaScriptAppModalDialogDelegate; 15class TabContents; 16class 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|. 24void 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|. 37void RunBeforeUnloadDialog(TabContents* tab_contents, 38 const std::wstring& message_text, 39 IPC::Message* reply_msg); 40 41#endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_MESSAGE_BOX_HANDLER_H_ 42