summaryrefslogtreecommitdiffstats
path: root/chrome/browser/message_box_handler.h
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:32:14 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:32:14 +0000
commit12f74a94c21e19c74208dacf1dc5ef46f8a27f53 (patch)
treed10fe102066ab8b0a437b18ffc70aa228d02ba4e /chrome/browser/message_box_handler.h
parent225c8f507421a2eff2ed7a900104431d04ed7e5e (diff)
downloadchromium_src-12f74a94c21e19c74208dacf1dc5ef46f8a27f53.zip
chromium_src-12f74a94c21e19c74208dacf1dc5ef46f8a27f53.tar.gz
chromium_src-12f74a94c21e19c74208dacf1dc5ef46f8a27f53.tar.bz2
Refactored out JS specific part of modal dialog stack into its own class, exposed cookie/storage prompt as a modal dialog.
BUG=32719 TEST=none, requires Darin to hook this with his code. Review URL: http://codereview.chromium.org/560030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/message_box_handler.h')
-rw-r--r--chrome/browser/message_box_handler.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/chrome/browser/message_box_handler.h b/chrome/browser/message_box_handler.h
new file mode 100644
index 0000000..d7382bb
--- /dev/null
+++ b/chrome/browser/message_box_handler.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MESSAGE_BOX_HANDLER_H_
+#define CHROME_BROWSER_MESSAGE_BOX_HANDLER_H_
+
+#include <string>
+
+#include "chrome/browser/browsing_data_local_storage_helper.h"
+#include "googleurl/src/gurl.h"
+#include "ipc/ipc_message.h"
+#include "net/base/cookie_monster.h"
+
+class CookiePromptModalDialogDelegate;
+class GURL;
+class JavaScriptMessageBoxClient;
+class TabContents;
+
+// Creates and runs a Javascript Message Box dialog.
+// The dialog type is specified within |dialog_flags|, the
+// default static display text is in |message_text| and if the dialog box is
+// a user input prompt() box, the default text for the text field is in
+// |default_prompt_text|. The result of the operation is returned using
+// |reply_msg|.
+void RunJavascriptMessageBox(JavaScriptMessageBoxClient* client,
+ const GURL& frame_url,
+ int dialog_flags,
+ const std::wstring& message_text,
+ const std::wstring& default_prompt_text,
+ bool display_suppress_checkbox,
+ IPC::Message* reply_msg);
+
+// This will display a modal dialog box with a header and footer asking the
+// the user if they wish to navigate away from a page, with additional text
+// |message_text| between the header and footer. The users response is
+// returned to the renderer using |reply_msg|.
+void RunBeforeUnloadDialog(TabContents* tab_contents,
+ const std::wstring& message_text,
+ IPC::Message* reply_msg);
+
+// TODO(zelidrag): bug 32719, implement these modal dialogs on Linux and Mac.
+#if defined(OS_WIN)
+// This will display a modal dialog box with cookie information asking
+// user to accept or reject the cookie. The caller should pass |delegate|
+// that will handle the reply from the dialog.
+void RunCookiePrompt(TabContents* tab_contents,
+ const GURL& url,
+ const std::string& cookie_line,
+ CookiePromptModalDialogDelegate* delegate);
+
+// This will display a modal dialog box with local storage information asking
+// user to accept or reject it. The caller should pass |delegate|
+// that will handle the reply from the dialog.
+void RunLocalStoragePrompt(
+ TabContents* tab_contents,
+ const BrowsingDataLocalStorageHelper::LocalStorageInfo& local_storage_info,
+ CookiePromptModalDialogDelegate* delegate);
+#endif
+
+#endif // CHROME_BROWSER_MESSAGE_BOX_HANDLER_H_
+