| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ | 5 #ifndef CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ |
| 6 #define CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ | 6 #define CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/browser/cocoa/constrained_window_mac.h" | 11 #include "chrome/browser/cocoa/constrained_window_mac.h" |
| 12 | 12 |
| 13 class RepostFormWarningController; | 13 class RepostFormWarningController; |
| 14 | 14 |
| 15 // Displays a dialog that warns the user that they are about to resubmit | 15 // Displays a dialog that warns the user that they are about to resubmit |
| 16 // a form. To show the dialog, call the |Create| method. It will open the | 16 // a form. To show the dialog, call the |Create| method. It will open the |
| 17 // dialog and then delete itself when the user dismisses the dialog. | 17 // dialog and then delete itself when the user dismisses the dialog. |
| 18 class RepostFormWarningMac : public ConstrainedDialogDelegate { | 18 class RepostFormWarningMac : public ConstrainedDialogDelegate { |
| 19 public: | 19 public: |
| 20 // Convenience method that creates a new |RepostFormWarningController| and | 20 // Convenience method that creates a new |RepostFormWarningController| and |
| 21 // then a new |RepostFormWarningMac| from that. | 21 // then a new |RepostFormWarningMac| from that. |
| 22 static RepostFormWarningMac* Create(NSWindow* parent, | 22 static RepostFormWarningMac* Create(NSWindow* parent, |
| 23 TabContents* tab_contents); | 23 TabContents* tab_contents); |
| 24 | 24 |
| 25 RepostFormWarningMac(NSWindow* parent, | 25 RepostFormWarningMac(NSWindow* parent, |
| 26 RepostFormWarningController* controller); | 26 RepostFormWarningController* controller); |
| 27 | 27 |
| 28 // ConstrainedWindowDelegateMacSystemSheet methods: | 28 // ConstrainedWindowDelegateMacSystemSheet methods: |
| 29 virtual void DeleteDelegate(); | 29 virtual void DeleteDelegate(); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 virtual ~RepostFormWarningMac(); | 32 virtual ~RepostFormWarningMac(); |
| 33 | 33 |
| 34 // Close the sheet. | 34 scoped_ptr<RepostFormWarningController> controller_; |
| 35 void Dismiss(); | |
| 36 | 35 |
| 37 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningMac); | 36 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningMac); |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 #endif // CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ | 39 #endif // CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ |
| OLD | NEW |