OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 // 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_H_ | |
6 #define CHROME_BROWSER_REPOST_FORM_WARNING_H_ | |
7 | |
8 #include "chrome/common/notification_observer.h" | |
9 #include "chrome/views/dialog_delegate.h" | |
10 | |
11 class MessageBoxView; | |
12 class NavigationController; | |
13 namespace views { | |
14 class Window; | |
15 } | |
16 | |
17 class RepostFormWarningDialog : public views::DialogDelegate, | |
18 public NotificationObserver { | |
19 public: | |
20 // Creates and runs a message box which asks the user if they want to resend | |
21 // an HTTP POST. | |
22 static void RunRepostFormWarningDialog( | |
23 NavigationController* navigation_controller); | |
24 virtual ~RepostFormWarningDialog(); | |
25 | |
26 // views::DialogDelegate Methods: | |
27 virtual std::wstring GetWindowTitle() const; | |
28 virtual std::wstring GetDialogButtonLabel(DialogButton button) const; | |
29 virtual void WindowClosing(); | |
30 virtual bool Cancel(); | |
31 virtual bool Accept(); | |
32 | |
33 // views::WindowDelegate Methods: | |
34 virtual bool IsModal() const { return true; } | |
35 virtual views::View* GetContentsView(); | |
36 | |
37 private: | |
38 // Use RunRepostFormWarningDialog to use. | |
39 RepostFormWarningDialog(NavigationController* navigation_controller); | |
40 | |
41 // NotificationObserver implementation. | |
42 // Watch for a new load or a closed tab and dismiss the dialog if they occur. | |
43 virtual void Observe(NotificationType type, | |
44 const NotificationSource& source, | |
45 const NotificationDetails& details); | |
46 | |
47 // The message box view whose commands we handle. | |
48 MessageBoxView* message_box_view_; | |
49 | |
50 // Navigation controller, used to continue the reload. | |
51 NavigationController* navigation_controller_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningDialog); | |
54 }; | |
55 | |
56 #endif // CHROME_BROWSER_REPOST_FORM_WARNING_H_ | |
OLD | NEW |