| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 | 8 |
| 9 @class AnimatableView; | 9 @class AnimatableView; |
| 10 @protocol InfoBarContainer; | 10 @protocol InfoBarContainer; |
| 11 class InfoBarDelegate; | 11 class InfoBarDelegate; |
| 12 class InfoBarService; | 12 class InfoBarService; |
| 13 @class InfoBarGradientView; | 13 @class InfoBarGradientView; |
| 14 | 14 |
| 15 // A controller for an infobar in the browser window. There is one | 15 // A controller for an infobar in the browser window. There is one |
| 16 // controller per infobar view. The base InfoBarController is able to | 16 // controller per infobar view. The base InfoBarController is able to |
| 17 // draw an icon, a text message, and a close button. Subclasses can | 17 // draw an icon, a text message, and a close button. Subclasses can |
| (...skipping 14 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // In rare instances, it can be possible for |delegate_| to delete itself | 33 // In rare instances, it can be possible for |delegate_| to delete itself |
| 34 // while this controller is still alive. Always check |delegate_| against | 34 // while this controller is still alive. Always check |delegate_| against |
| 35 // NULL before using it. | 35 // NULL before using it. |
| 36 InfoBarDelegate* delegate_; // weak, can be NULL | 36 InfoBarDelegate* delegate_; // weak, can be NULL |
| 37 | 37 |
| 38 // Text fields don't work as well with embedded links as text views, but | 38 // Text fields don't work as well with embedded links as text views, but |
| 39 // text views cannot conveniently be created in IB. The xib file contains | 39 // text views cannot conveniently be created in IB. The xib file contains |
| 40 // a text field |labelPlaceholder_| that's replaced by this text view |label_| | 40 // a text field |labelPlaceholder_| that's replaced by this text view |label_| |
| 41 // in -awakeFromNib. | 41 // in -awakeFromNib. |
| 42 scoped_nsobject<NSTextView> label_; | 42 base::scoped_nsobject<NSTextView> label_; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // Initializes a new InfoBarController. | 45 // Initializes a new InfoBarController. |
| 46 - (id)initWithDelegate:(InfoBarDelegate*)delegate | 46 - (id)initWithDelegate:(InfoBarDelegate*)delegate |
| 47 owner:(InfoBarService*)owner; | 47 owner:(InfoBarService*)owner; |
| 48 | 48 |
| 49 // Returns YES if the infobar is owned. If this is NO, it is not safe to call | 49 // Returns YES if the infobar is owned. If this is NO, it is not safe to call |
| 50 // any delegate functions, since they might attempt to access the owner. Code | 50 // any delegate functions, since they might attempt to access the owner. Code |
| 51 // should generally just do nothing at all in this case (once we're closing, all | 51 // should generally just do nothing at all in this case (once we're closing, all |
| 52 // controls can safely just go dead). | 52 // controls can safely just go dead). |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 - (void)disablePopUpMenu:(NSMenu*)menu; | 104 - (void)disablePopUpMenu:(NSMenu*)menu; |
| 105 @end | 105 @end |
| 106 | 106 |
| 107 ///////////////////////////////////////////////////////////////////////// | 107 ///////////////////////////////////////////////////////////////////////// |
| 108 // InfoBarController subclasses, one for each InfoBarDelegate | 108 // InfoBarController subclasses, one for each InfoBarDelegate |
| 109 // subclass. Each of these subclasses overrides addAdditionalControls to | 109 // subclass. Each of these subclasses overrides addAdditionalControls to |
| 110 // configure its view as necessary. | 110 // configure its view as necessary. |
| 111 | 111 |
| 112 | 112 |
| 113 | 113 |
| OLD | NEW |