OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_ |
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_ | 6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 | 11 |
12 // This class implements an alert that has a constrained window look and feel | 12 // This class implements an alert that has a constrained window look and feel |
13 // (close button on top right, WebUI style buttons, etc...). The alert can be | 13 // (close button on top right, WebUI style buttons, etc...). The alert can be |
14 // shown by using the window accessor and calling -[window orderFont:]. Normally | 14 // shown by using the window accessor and calling -[window orderFont:]. Normally |
15 // this would be done by ConstrainedWindowSheetController. | 15 // this would be done by ConstrainedWindowSheetController. |
16 @interface ConstrainedWindowAlert : NSObject { | 16 @interface ConstrainedWindowAlert : NSObject { |
17 @private | 17 @private |
18 scoped_nsobject<NSTextField> informativeTextField_; | 18 base::scoped_nsobject<NSTextField> informativeTextField_; |
19 scoped_nsobject<NSTextField> messageTextField_; | 19 base::scoped_nsobject<NSTextField> messageTextField_; |
20 scoped_nsobject<NSView> accessoryView_; | 20 base::scoped_nsobject<NSView> accessoryView_; |
21 scoped_nsobject<NSMutableArray> buttons_; | 21 base::scoped_nsobject<NSMutableArray> buttons_; |
22 scoped_nsobject<NSButton> closeButton_; | 22 base::scoped_nsobject<NSButton> closeButton_; |
23 scoped_nsobject<NSWindow> window_; | 23 base::scoped_nsobject<NSWindow> window_; |
24 } | 24 } |
25 | 25 |
26 @property(nonatomic, copy) NSString* informativeText; | 26 @property(nonatomic, copy) NSString* informativeText; |
27 @property(nonatomic, copy) NSString* messageText; | 27 @property(nonatomic, copy) NSString* messageText; |
28 @property(nonatomic, retain) NSView* accessoryView; | 28 @property(nonatomic, retain) NSView* accessoryView; |
29 @property(nonatomic, readonly) NSArray* buttons; | 29 @property(nonatomic, readonly) NSArray* buttons; |
30 @property(nonatomic, readonly) NSButton* closeButton; | 30 @property(nonatomic, readonly) NSButton* closeButton; |
31 @property(nonatomic, readonly) NSWindow* window; | 31 @property(nonatomic, readonly) NSWindow* window; |
32 | 32 |
33 // Default initializer. | 33 // Default initializer. |
34 - (id)init; | 34 - (id)init; |
35 | 35 |
36 // Adds a button with the given |title|. Newly added buttons are positioned in | 36 // Adds a button with the given |title|. Newly added buttons are positioned in |
37 // order from right to left. | 37 // order from right to left. |
38 - (void)addButtonWithTitle:(NSString*)title | 38 - (void)addButtonWithTitle:(NSString*)title |
39 keyEquivalent:(NSString*)keyEquivalent | 39 keyEquivalent:(NSString*)keyEquivalent |
40 target:(id)target | 40 target:(id)target |
41 action:(SEL)action; | 41 action:(SEL)action; |
42 | 42 |
43 // Lays out the controls in the alert. This should be called before the window | 43 // Lays out the controls in the alert. This should be called before the window |
44 // is displayed. | 44 // is displayed. |
45 - (void)layout; | 45 - (void)layout; |
46 | 46 |
47 @end | 47 @end |
48 | 48 |
49 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H
_ | 49 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H
_ |
OLD | NEW |