| Index: chrome/browser/repost_form_warning_controller.h
|
| diff --git a/chrome/browser/repost_form_warning_controller.h b/chrome/browser/repost_form_warning_controller.h
|
| index 7b8114ac4a7b76eb1bf37d75afad54fdcf3ec078..395de1675dc968ba48351dc797f679dda2a7e4eb 100644
|
| --- a/chrome/browser/repost_form_warning_controller.h
|
| +++ b/chrome/browser/repost_form_warning_controller.h
|
| @@ -7,44 +7,37 @@
|
| #pragma once
|
|
|
| #include "base/compiler_specific.h"
|
| -#include "content/public/browser/notification_observer.h"
|
| -#include "content/public/browser/notification_registrar.h"
|
| +#include "chrome/browser/ui/tab_modal_dialog_delegate.h"
|
|
|
| -class ConstrainedWindow;
|
| +class NavigationController;
|
| class TabContents;
|
|
|
| // This class is used to continue or cancel a pending reload when the
|
| // repost form warning is shown. It is owned by the platform-dependent
|
| // |RepostFormWarning{Gtk,Mac,View}| classes.
|
| -class RepostFormWarningController : public content::NotificationObserver {
|
| +class RepostFormWarningController : public TabModalDialogDelegate {
|
| public:
|
| explicit RepostFormWarningController(TabContents* tab_contents);
|
| virtual ~RepostFormWarningController();
|
|
|
| - // Cancel the reload.
|
| - void Cancel();
|
| -
|
| - // Continue the reload.
|
| - void Continue();
|
| -
|
| - void set_window(ConstrainedWindow* window) { window_ = window; }
|
| + // TabModalDialogDelegate methods:
|
| + virtual string16 GetTitle() OVERRIDE;
|
| + virtual string16 GetMessage() OVERRIDE;
|
| + virtual string16 GetAcceptButtonTitle() OVERRIDE;
|
| +#if defined(TOOLKIT_USES_GTK)
|
| + virtual const char* GetAcceptButtonIcon() OVERRIDE;
|
| + virtual const char* GetCancelButtonTitleIcon() OVERRIDE;
|
| +#endif // defined(TOOLKIT_USES_GTK)
|
| + virtual void OnAccepted() OVERRIDE;
|
| + virtual void OnCanceled() OVERRIDE;
|
|
|
| private:
|
| - // content::NotificationObserver implementation.
|
| - // Watch for a new load or a closed tab and dismiss the dialog if they occur.
|
| virtual void Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) OVERRIDE;
|
|
|
| - // Close the warning dialog.
|
| - void CloseDialog();
|
| -
|
| - content::NotificationRegistrar registrar_;
|
| -
|
| - // Tab contents, used to continue the reload.
|
| - TabContents* tab_contents_;
|
| -
|
| - ConstrainedWindow* window_;
|
| + // Weak pointer; this dialog is cancelled when the TabContents is closed.
|
| + NavigationController* navigation_controller_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController);
|
| };
|
|
|