Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4297)

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h

Issue 10870094: Constrained window sheet controller (test patch) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h
diff --git a/chrome/browser/ui/cocoa/constrained_window/cw_alert.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h
similarity index 52%
rename from chrome/browser/ui/cocoa/constrained_window/cw_alert.h
rename to chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h
index 752394b0584abc161fbc3bca8cc5bb7bbf2afe5b..0c7f6d7018ed4d583c65638f7874cf3ee81b60f7 100644
--- a/chrome/browser/ui/cocoa/constrained_window/cw_alert.h
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h
@@ -2,11 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_
+#define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_
+
#import <Cocoa/Cocoa.h>
#include "base/memory/scoped_nsobject.h"
-@interface CWAlert : NSObject {
+// A custom alert suitable for displaying as a constrained window. Specialized
+// constrained windows should use this class instead of NSAlert.
+@interface ConstrainedWindowAlert : NSObject {
+ @private
scoped_nsobject<NSTextField> informativeTextField_;
scoped_nsobject<NSTextField> messageTextField_;
scoped_nsobject<NSView> accessoryView_;
@@ -22,11 +28,20 @@
@property(nonatomic, readonly) NSButton* closeButton;
@property(nonatomic, readonly) NSWindow* window;
+// Default initializer.
- (id)init;
+// Adds a button with the given |title|. Newly added buttons are positioned in
+// order from right to left.
- (void)addButtonWithTitle:(NSString*)title
- keyEquivalent:(NSString*)keyEquivalent;
+ keyEquivalent:(NSString*)keyEquivalent
+ target:(id)target
+ action:(SEL)action;
+// Lays out the controls in the alert. This should be called before the window
+// is displayed.
- (void)layout;
@end
+
+#endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_ALERT_H_

Powered by Google App Engine
This is Rietveld 408576698