OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ | |
6 #define CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 | |
10 #include "base/scoped_nsobject.h" | |
11 #include "chrome/common/notification_registrar.h" | |
12 | |
13 class NavigationController; | |
14 class RepostFormWarningMac; | |
15 | |
16 @interface RepostDelegate : NSObject { | |
pink (ping after 24hrs)
2009/11/02 17:36:19
class needs a comment. Does this really need to be
Nico
2009/11/02 18:05:16
Done.
| |
17 RepostFormWarningMac* warning_; // weak, owns us. | |
18 } | |
19 - (id)initWithWarning:(RepostFormWarningMac*)warning; | |
20 - (void)alertDidEnd:(NSAlert*)alert | |
21 returnCode:(int)returnCode | |
22 contextInfo:(void*)contextInfo; | |
23 @end | |
24 | |
25 class RepostFormWarningMac : public NotificationObserver { | |
pink (ping after 24hrs)
2009/11/02 17:36:19
class needs a comment. Especially needs to mention
Nico
2009/11/02 18:05:16
Done.
| |
26 public: | |
27 RepostFormWarningMac(NSWindow* parent, | |
28 NavigationController* navigation_controller); | |
29 virtual ~RepostFormWarningMac(); | |
30 | |
31 void Confirm(); | |
32 void Cancel(); | |
33 | |
34 private: | |
35 // NotificationObserver implementation. | |
36 // Watch for a new load or a closed tab and dismiss the dialog if they occur. | |
37 virtual void Observe(NotificationType type, | |
38 const NotificationSource& source, | |
39 const NotificationDetails& details); | |
40 | |
41 // Close the sheet. This will only be done once, even if Destroy is called | |
42 // multiple times (eg, from both Confirm and Observe.) | |
43 void Destroy(); | |
44 | |
45 NotificationRegistrar registrar_; | |
46 | |
47 // Navigation controller, used to continue the reload. | |
48 NavigationController* navigation_controller_; | |
49 | |
50 scoped_nsobject<NSAlert> alert_; | |
51 | |
52 scoped_nsobject<RepostDelegate> delegate_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningMac); | |
55 }; | |
56 | |
57 #endif // CHROME_BROWSER_COCOA_REPOST_FORM_WARNING_MAC_H_ | |
OLD | NEW |