blob: 15bba70f27e9914c0f27b41eae89760b067f4ac2 [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]cdcb1dee2012-01-04 00:46:2012namespace content {
[email protected]67baffc82011-12-19 18:03:0713class NavigationController;
[email protected]cdcb1dee2012-01-04 00:46:2014}
[email protected]965bb092010-04-09 11:59:0215
16// This class is used to continue or cancel a pending reload when the
17// repost form warning is shown. It is owned by the platform-dependent
[email protected]b535bf1e2010-04-14 16:19:4018// |RepostFormWarning{Gtk,Mac,View}| classes.
[email protected]67baffc82011-12-19 18:03:0719class RepostFormWarningController : public TabModalConfirmDialogDelegate {
[email protected]965bb092010-04-09 11:59:0220 public:
[email protected]2a6bc3e2011-12-28 23:51:3321 explicit RepostFormWarningController(content::WebContents* web_contents);
[email protected]b535bf1e2010-04-14 16:19:4022 virtual ~RepostFormWarningController();
[email protected]965bb092010-04-09 11:59:0223
[email protected]67baffc82011-12-19 18:03:0724 // TabModalConfirmDialogDelegate methods:
25 virtual string16 GetTitle() OVERRIDE;
26 virtual string16 GetMessage() OVERRIDE;
27 virtual string16 GetAcceptButtonTitle() OVERRIDE;
28#if defined(TOOLKIT_USES_GTK)
29 virtual const char* GetAcceptButtonIcon() OVERRIDE;
30 virtual const char* GetCancelButtonIcon() OVERRIDE;
31#endif // defined(TOOLKIT_USES_GTK)
32 virtual void OnAccepted() OVERRIDE;
33 virtual void OnCanceled() OVERRIDE;
[email protected]9d4984e2011-08-24 19:16:0234
[email protected]965bb092010-04-09 11:59:0235 private:
[email protected]432115822011-07-10 15:52:2736 virtual void Observe(int type,
[email protected]6c2381d2011-10-19 02:52:5337 const content::NotificationSource& source,
[email protected]49fd7e22011-11-21 16:52:2138 const content::NotificationDetails& details) OVERRIDE;
[email protected]965bb092010-04-09 11:59:0239
[email protected]2a6bc3e2011-12-28 23:51:3340 // Weak pointer; this dialog is cancelled when the WebContents is closed.
[email protected]cdcb1dee2012-01-04 00:46:2041 content::NavigationController* navigation_controller_;
[email protected]965bb092010-04-09 11:59:0242
43 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningController);
44};
45
46#endif // CHROME_BROWSER_REPOST_FORM_WARNING_CONTROLLER_H_