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

Unified Diff: chrome/browser/cocoa/infobar_controller.h

Issue 155494: First cut at infobars on Mac. These are not expected to be... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 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/cocoa/infobar_controller.h
===================================================================
--- chrome/browser/cocoa/infobar_controller.h (revision 0)
+++ chrome/browser/cocoa/infobar_controller.h (revision 0)
@@ -0,0 +1,63 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import <Cocoa/Cocoa.h>
+
+@class InfoBarContainerController;
+class InfoBarDelegate;
+
+// A controller for an infobar in the browser window. There is one
+// controller per infobar view. The base InfoBarController is able to
+// draw an icon, a text message, and a close button. Subclasses can
+// override addAdditionalControls to customize the UI.
+@interface InfoBarController : NSViewController {
+ @private
+ InfoBarContainerController* containerController_; // weak, owns us
+
+ @protected
+ InfoBarDelegate* delegate_; // weak
+ IBOutlet NSImageView* image_;
+ IBOutlet NSTextField* label_;
+ IBOutlet NSButton* closeButton_;
+};
+
+// Initializes a new InfoBarController.
+- (id)initWithDelegate:(InfoBarDelegate*)delegate;
+
+// Dismisses the infobar without taking any action.
+- (IBAction)dismiss:(id)sender;
+
+// Subclasses can override this method to add additional controls to
+// the infobar view. This method is called by awakeFromNib. The
+// default implementation does nothing.
+- (void)addAdditionalControls;
+
+@property(assign, nonatomic) InfoBarContainerController* containerController;
+@property(readonly) InfoBarDelegate* delegate;
+
+@end
+
+/////////////////////////////////////////////////////////////////////////
+// InfoBarController subclasses, one for each InfoBarDelegate
+// subclass. Each of these subclasses overrides addAdditionalControls to
+// configure its view as necessary.
+
+@interface AlertInfoBarController : InfoBarController {
+}
+@end
+
+
+@interface LinkInfoBarController : InfoBarController {
+}
+// Called when there is a click on the link in the infobar.
+- (void)linkClicked;
+@end
+
+
+@interface ConfirmInfoBarController : InfoBarController {
+}
+// Called when the ok and cancel buttons are clicked.
+- (IBAction)ok:(id)sender;
+- (IBAction)cancel:(id)sender;
+@end
Property changes on: chrome/browser/cocoa/infobar_controller.h
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cocoa/infobar_container_controller_unittest.mm ('k') | chrome/browser/cocoa/infobar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698