blob: a6185383640dafc37ddaa20a12c684b9c2a33662 [file] [log] [blame]
[email protected]ebbbb9f2011-03-09 13:16:141// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]965bb092010-04-09 11:59:022// 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]32b76ef2010-07-26 23:08:247#pragma once
[email protected]965bb092010-04-09 11:59:028
[email protected]6c2381d2011-10-19 02:52:539#include "content/public/browser/notification_observer.h"
10#include "content/public/browser/notification_registrar.h"
[email protected]965bb092010-04-09 11:59:0211
[email protected]5f9de5882011-09-30 23:36:2812class ConstrainedWindow;
[email protected]965bb092010-04-09 11:59:0213class TabContents;
14
15// This class is used to continue or cancel a pending reload when the
16// repost form warning is shown. It is owned by the platform-dependent
[email protected]b535bf1e2010-04-14 16:19:4017// |RepostFormWarning{Gtk,Mac,View}| classes.
[email protected]6c2381d2011-10-19 02:52:5318class RepostFormWarningController : public content::NotificationObserver {
[email protected]965bb092010-04-09 11:59:0219 public:
20 explicit RepostFormWarningController(TabContents* tab_contents);
[email protected]b535bf1e2010-04-14 16:19:4021 virtual ~RepostFormWarningController();
[email protected]965bb092010-04-09 11:59:0222
[email protected]965bb092010-04-09 11:59:0223 // Cancel the reload.
24 void Cancel();
25
26 // Continue the reload.
27 void Continue();
28
[email protected]9d4984e2011-08-24 19:16:0229 void set_window(ConstrainedWindow* window) { window_ = window; }
30
[email protected]965bb092010-04-09 11:59:0231 private:
[email protected]6c2381d2011-10-19 02:52:5332 // content::NotificationObserver implementation.
[email protected]965bb092010-04-09 11:59:0233 // Watch for a new load or a closed tab and dismiss the dialog if they occur.
[email protected]432115822011-07-10 15:52:2734 virtual void Observe(int type,
[email protected]6c2381d2011-10-19 02:52:5335 const content::NotificationSource& source,
36 const content::NotificationDetails& details);
[email protected]965bb092010-04-09 11:59:0237
38 // Close the warning dialog.
39 void CloseDialog();
40
[email protected]6c2381d2011-10-19 02:52:5341 content::NotificationRegistrar registrar_;
[email protected]965bb092010-04-09 11:59:0242
43 // Tab contents, used to continue the reload.
44 TabContents* tab_contents_;
45
46 ConstrainedWindow* window_;
47
48 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController);
49};
50
51#endif // CHROME_BROWSER_REPOST_FORM_WARNING_CONTROLLER_H_