| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_JS_BEFORE_UNLOAD_HANDLER_WIN_H_ | 5 #ifndef CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_WIN_H_ |
| 6 #define CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_WIN_H_ | 6 #define CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_WIN_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/jsmessage_box_handler_win.h" | 8 #include "chrome/browser/jsmessage_box_handler_win.h" |
| 9 | 9 |
| 10 class WebContents; | 10 class WebContents; |
| 11 | 11 |
| 12 class JavascriptBeforeUnloadHandler : public JavascriptMessageBoxHandler { | 12 class JavascriptBeforeUnloadHandler : public JavascriptMessageBoxHandler { |
| 13 public: | 13 public: |
| 14 // Cross-platform code should use RunBeforeUnloadDialog. | 14 // Cross-platform code should use RunBeforeUnloadDialog. |
| 15 JavascriptBeforeUnloadHandler(WebContents* web_contents, | 15 JavascriptBeforeUnloadHandler(WebContents* web_contents, |
| 16 const GURL& frame_url, |
| 16 const std::wstring& message_text, | 17 const std::wstring& message_text, |
| 17 IPC::Message* reply_msg); | 18 IPC::Message* reply_msg); |
| 18 virtual ~JavascriptBeforeUnloadHandler() {} | 19 virtual ~JavascriptBeforeUnloadHandler() {} |
| 19 | 20 |
| 20 // views::DialogDelegate Methods: | 21 // views::DialogDelegate Methods: |
| 21 virtual std::wstring GetWindowTitle() const; | 22 virtual std::wstring GetWindowTitle() const; |
| 22 virtual std::wstring GetDialogButtonLabel(DialogButton button) const; | 23 virtual std::wstring GetDialogButtonLabel(DialogButton button) const; |
| 23 | 24 |
| 24 private: | 25 private: |
| 25 DISALLOW_COPY_AND_ASSIGN(JavascriptBeforeUnloadHandler); | 26 DISALLOW_COPY_AND_ASSIGN(JavascriptBeforeUnloadHandler); |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 #endif // CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_WIN_H_ | 29 #endif // CHROME_BROWSER_JS_BEFORE_UNLOAD_HANDLER_WIN_H_ |
| OLD | NEW |