blob: ea693e904c31c0f15dd00bd412a960ecf6013659 [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]49fd7e22011-11-21 16:52:219#include "base/compiler_specific.h"
[email protected]67baffc82011-12-19 18:03:0710#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
[email protected]965bb092010-04-09 11:59:0211
[email protected]67baffc82011-12-19 18:03:0712class NavigationController;
[email protected]965bb092010-04-09 11:59:0213
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]b535bf1e2010-04-14 16:19:4016// |RepostFormWarning{Gtk,Mac,View}| classes.
[email protected]67baffc82011-12-19 18:03:0717class RepostFormWarningController : public TabModalConfirmDialogDelegate {
[email protected]965bb092010-04-09 11:59:0218 public:
[email protected]2a6bc3e2011-12-28 23:51:3319 explicit RepostFormWarningController(content::WebContents* web_contents);
[email protected]b535bf1e2010-04-14 16:19:4020 virtual ~RepostFormWarningController();
[email protected]965bb092010-04-09 11:59:0221
[email protected]67baffc82011-12-19 18:03:0722 // 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]9d4984e2011-08-24 19:16:0232
[email protected]965bb092010-04-09 11:59:0233 private:
[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,
[email protected]49fd7e22011-11-21 16:52:2136 const content::NotificationDetails& details) OVERRIDE;
[email protected]965bb092010-04-09 11:59:0237
[email protected]2a6bc3e2011-12-28 23:51:3338 // Weak pointer; this dialog is cancelled when the WebContents is closed.
[email protected]67baffc82011-12-19 18:03:0739 NavigationController* navigation_controller_;
[email protected]965bb092010-04-09 11:59:0240
41 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController);
42};
43
44#endif // CHROME_BROWSER_REPOST_FORM_WARNING_CONTROLLER_H_