summaryrefslogtreecommitdiffstats
path: root/chrome/browser/js_before_unload_handler.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 19:34:38 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 19:34:38 +0000
commit7eb2300f13b081bcd0adcfe28202e82d1310f70d (patch)
tree167a8c0e9d494b1862cf0b575a9f3688f37c4d5f /chrome/browser/js_before_unload_handler.h
parent9660ddd38561758694488c7110a7edbeacb1b305 (diff)
downloadchromium_src-7eb2300f13b081bcd0adcfe28202e82d1310f70d.zip
chromium_src-7eb2300f13b081bcd0adcfe28202e82d1310f70d.tar.gz
chromium_src-7eb2300f13b081bcd0adcfe28202e82d1310f70d.tar.bz2
Allow porting of the JS message boxes. I split out the implementation into
platform-specific files, and have WebContents just use the platform-independent header that declares the creation functions. Review URL: http://codereview.chromium.org/19719 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/js_before_unload_handler.h')
-rw-r--r--chrome/browser/js_before_unload_handler.h43
1 files changed, 12 insertions, 31 deletions
diff --git a/chrome/browser/js_before_unload_handler.h b/chrome/browser/js_before_unload_handler.h
index bb75356..3d85a3c 100644
--- a/chrome/browser/js_before_unload_handler.h
+++ b/chrome/browser/js_before_unload_handler.h
@@ -2,35 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_H__
-#define CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_H__
-
-#include "chrome/browser/jsmessage_box_handler.h"
-
-class JavascriptBeforeUnloadHandler : public JavascriptMessageBoxHandler {
- public:
- // 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|.
- static void RunBeforeUnloadDialog(WebContents* web_contents,
- const std::wstring& message_text,
- IPC::Message* reply_msg);
- virtual ~JavascriptBeforeUnloadHandler() {}
-
- // views::DialogDelegate Methods:
- virtual std::wstring GetWindowTitle() const;
- virtual std::wstring GetDialogButtonLabel(DialogButton button) const;
-
- private:
- // Called from RunBeforeUnloadDialog. Calls JavascriptMessageBoxHandler's
- // constructor.
- JavascriptBeforeUnloadHandler(WebContents* web_contents,
- const std::wstring& message_text,
- IPC::Message* reply_msg);
-
- DISALLOW_EVIL_CONSTRUCTORS(JavascriptBeforeUnloadHandler);
-};
-
-#endif // CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_H__
+#ifndef CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_H_
+#define CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_H_
+
+// 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(WebContents* web_contents,
+ const std::wstring& message_text,
+ IPC::Message* reply_msg);
+
+#endif // CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_H_