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 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 @class InfoBarContainerController; |
| 8 class InfoBarDelegate; |
| 9 |
| 10 // A controller for an infobar in the browser window. There is one |
| 11 // controller per infobar view. The base InfoBarController is able to |
| 12 // draw an icon, a text message, and a close button. Subclasses can |
| 13 // override addAdditionalControls to customize the UI. |
| 14 @interface InfoBarController : NSViewController { |
| 15 @private |
| 16 InfoBarContainerController* containerController_; // weak, owns us |
| 17 |
| 18 @protected |
| 19 InfoBarDelegate* delegate_; // weak |
| 20 IBOutlet NSImageView* image_; |
| 21 IBOutlet NSTextField* label_; |
| 22 IBOutlet NSButton* closeButton_; |
| 23 }; |
| 24 |
| 25 // Initializes a new InfoBarController. |
| 26 - (id)initWithDelegate:(InfoBarDelegate*)delegate; |
| 27 |
| 28 // Dismisses the infobar without taking any action. |
| 29 - (IBAction)dismiss:(id)sender; |
| 30 |
| 31 // Subclasses can override this method to add additional controls to |
| 32 // the infobar view. This method is called by awakeFromNib. The |
| 33 // default implementation does nothing. |
| 34 - (void)addAdditionalControls; |
| 35 |
| 36 @property(assign, nonatomic) InfoBarContainerController* containerController; |
| 37 @property(readonly) InfoBarDelegate* delegate; |
| 38 |
| 39 @end |
| 40 |
| 41 ///////////////////////////////////////////////////////////////////////// |
| 42 // InfoBarController subclasses, one for each InfoBarDelegate |
| 43 // subclass. Each of these subclasses overrides addAdditionalControls to |
| 44 // configure its view as necessary. |
| 45 |
| 46 @interface AlertInfoBarController : InfoBarController { |
| 47 } |
| 48 @end |
| 49 |
| 50 |
| 51 @interface LinkInfoBarController : InfoBarController { |
| 52 } |
| 53 // Called when there is a click on the link in the infobar. |
| 54 - (void)linkClicked; |
| 55 @end |
| 56 |
| 57 |
| 58 @interface ConfirmInfoBarController : InfoBarController { |
| 59 } |
| 60 // Called when the ok and cancel buttons are clicked. |
| 61 - (IBAction)ok:(id)sender; |
| 62 - (IBAction)cancel:(id)sender; |
| 63 @end |
OLD | NEW |