content: convert form repost warning notification to WebContentsObserver usage

BUG=170921

Review URL: https://codereview.chromium.org/12378021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185618 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/repost_form_warning_controller.h b/chrome/browser/repost_form_warning_controller.h
index 4bf63b3..c6bf0341 100644
--- a/chrome/browser/repost_form_warning_controller.h
+++ b/chrome/browser/repost_form_warning_controller.h
@@ -7,19 +7,18 @@
 
 #include "base/compiler_specific.h"
 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
-
-namespace content {
-class NavigationController;
-}
+#include "content/public/browser/web_contents_observer.h"
 
 // This class is used to continue or cancel a pending reload when the
 // repost form warning is shown. It is owned by the platform-specific
 // |TabModalConfirmDialog{Gtk, Mac, Views, WebUI}| classes.
-class RepostFormWarningController : public TabModalConfirmDialogDelegate {
+class RepostFormWarningController : public TabModalConfirmDialogDelegate,
+                                    public content::WebContentsObserver {
  public:
   explicit RepostFormWarningController(content::WebContents* web_contents);
   virtual ~RepostFormWarningController();
 
+ private:
   // TabModalConfirmDialogDelegate methods:
   virtual string16 GetTitle() OVERRIDE;
   virtual string16 GetMessage() OVERRIDE;
@@ -31,13 +30,8 @@
   virtual void OnAccepted() OVERRIDE;
   virtual void OnCanceled() OVERRIDE;
 
- private:
-  virtual void Observe(int type,
-                       const content::NotificationSource& source,
-                       const content::NotificationDetails& details) OVERRIDE;
-
-  // Weak pointer; this dialog is cancelled when the WebContents is closed.
-  content::NavigationController* navigation_controller_;
+  // content::WebContentsObserver methods:
+  virtual void BeforeFormRepostWarningShow() OVERRIDE;
 
   DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController);
 };