blob: 2c1bcff4c40f7ed8611caa18f85806650bfde41a [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]299425b2011-03-02 07:45:209#include "content/browser/tab_contents/constrained_window.h"
[email protected]ebbbb9f2011-03-09 13:16:1410#include "content/common/notification_observer.h"
11#include "content/common/notification_registrar.h"
[email protected]965bb092010-04-09 11:59:0212
[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]965bb092010-04-09 11:59:0218class RepostFormWarningController : public NotificationObserver {
19 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
23 // Show the warning dialog.
24 void Show(ConstrainedWindowDelegate* window_delegate);
25
26 // Cancel the reload.
27 void Cancel();
28
29 // Continue the reload.
30 void Continue();
31
32 private:
[email protected]965bb092010-04-09 11:59:0233 // NotificationObserver implementation.
34 // Watch for a new load or a closed tab and dismiss the dialog if they occur.
[email protected]432115822011-07-10 15:52:2735 virtual void Observe(int type,
[email protected]78994ab02010-12-08 18:06:4436 const NotificationSource& source,
37 const NotificationDetails& details);
[email protected]965bb092010-04-09 11:59:0238
39 // Close the warning dialog.
40 void CloseDialog();
41
42 NotificationRegistrar registrar_;
43
44 // Tab contents, used to continue the reload.
45 TabContents* tab_contents_;
46
47 ConstrainedWindow* window_;
48
49 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController);
50};
51
52#endif // CHROME_BROWSER_REPOST_FORM_WARNING_CONTROLLER_H_