[email protected] | ebbbb9f | 2011-03-09 13:16:14 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 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_REPOST_FORM_WARNING_CONTROLLER_H_ | ||||
6 | #define CHROME_BROWSER_REPOST_FORM_WARNING_CONTROLLER_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 8 | |
[email protected] | 49fd7e2 | 2011-11-21 16:52:21 | [diff] [blame] | 9 | #include "base/compiler_specific.h" |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 10 | #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 11 | |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 12 | class NavigationController; |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 13 | |
14 | // This class is used to continue or cancel a pending reload when the | ||||
15 | // repost form warning is shown. It is owned by the platform-dependent | ||||
[email protected] | b535bf1e | 2010-04-14 16:19:40 | [diff] [blame] | 16 | // |RepostFormWarning{Gtk,Mac,View}| classes. |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 17 | class RepostFormWarningController : public TabModalConfirmDialogDelegate { |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 18 | public: |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame^] | 19 | explicit RepostFormWarningController(content::WebContents* web_contents); |
[email protected] | b535bf1e | 2010-04-14 16:19:40 | [diff] [blame] | 20 | virtual ~RepostFormWarningController(); |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 21 | |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 22 | // TabModalConfirmDialogDelegate methods: |
23 | virtual string16 GetTitle() OVERRIDE; | ||||
24 | virtual string16 GetMessage() OVERRIDE; | ||||
25 | virtual string16 GetAcceptButtonTitle() OVERRIDE; | ||||
26 | #if defined(TOOLKIT_USES_GTK) | ||||
27 | virtual const char* GetAcceptButtonIcon() OVERRIDE; | ||||
28 | virtual const char* GetCancelButtonIcon() OVERRIDE; | ||||
29 | #endif // defined(TOOLKIT_USES_GTK) | ||||
30 | virtual void OnAccepted() OVERRIDE; | ||||
31 | virtual void OnCanceled() OVERRIDE; | ||||
[email protected] | 9d4984e | 2011-08-24 19:16:02 | [diff] [blame] | 32 | |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 33 | private: |
[email protected] | 43211582 | 2011-07-10 15:52:27 | [diff] [blame] | 34 | virtual void Observe(int type, |
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 35 | const content::NotificationSource& source, |
[email protected] | 49fd7e2 | 2011-11-21 16:52:21 | [diff] [blame] | 36 | const content::NotificationDetails& details) OVERRIDE; |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 37 | |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame^] | 38 | // Weak pointer; this dialog is cancelled when the WebContents is closed. |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 39 | NavigationController* navigation_controller_; |
[email protected] | 965bb09 | 2010-04-09 11:59:02 | [diff] [blame] | 40 | |
41 | DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController); | ||||
42 | }; | ||||
43 | |||||
44 | #endif // CHROME_BROWSER_REPOST_FORM_WARNING_CONTROLLER_H_ |