OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "base/mac/cocoa_protocols.h" | 7 #import "base/mac/cocoa_protocols.h" |
8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
9 | 9 |
10 @class AnimatableView; | 10 @class AnimatableView; |
(...skipping 30 matching lines...) Expand all Loading... | |
41 // text views cannot conveniently be created in IB. The xib file contains | 41 // text views cannot conveniently be created in IB. The xib file contains |
42 // a text field |labelPlaceholder_| that's replaced by this text view |label_| | 42 // a text field |labelPlaceholder_| that's replaced by this text view |label_| |
43 // in -awakeFromNib. | 43 // in -awakeFromNib. |
44 scoped_nsobject<NSTextView> label_; | 44 scoped_nsobject<NSTextView> label_; |
45 }; | 45 }; |
46 | 46 |
47 // Initializes a new InfoBarController. | 47 // Initializes a new InfoBarController. |
48 - (id)initWithDelegate:(InfoBarDelegate*)delegate | 48 - (id)initWithDelegate:(InfoBarDelegate*)delegate |
49 owner:(TabContentsWrapper*)owner; | 49 owner:(TabContentsWrapper*)owner; |
50 | 50 |
51 // Returns true if the infobar is owned. If this is false, it is not safe to | |
52 // call any delegate functions, since they might attempt to access the owner. | |
53 - (bool)owned; | |
Robert Sesek
2011/09/22 16:49:56
This should be an Obj-C BOOL and be YES/NO instead
Peter Kasting
2011/09/22 21:55:25
Done.
| |
54 | |
51 // Called when someone clicks on the OK or Cancel buttons. Subclasses | 55 // Called when someone clicks on the OK or Cancel buttons. Subclasses |
52 // must override if they do not hide the buttons. | 56 // must override if they do not hide the buttons. |
53 - (void)ok:(id)sender; | 57 - (void)ok:(id)sender; |
54 - (void)cancel:(id)sender; | 58 - (void)cancel:(id)sender; |
55 | 59 |
56 // Called when someone clicks on the close button. Dismisses the | 60 // Asks the container controller to remove the infobar for this delegate. This |
57 // infobar without taking any action. | 61 // call will trigger a notification that starts the infobar animating closed. |
58 - (IBAction)dismiss:(id)sender; | 62 - (void)removeSelf; |
Robert Sesek
2011/09/22 16:49:56
This needs to stay part of the public header becau
Peter Kasting
2011/09/22 21:55:25
sail informed me that it was safe to move this to
Robert Sesek
2011/09/24 19:20:16
It's technically safe, but as some other entity is
Peter Kasting
2011/09/26 22:34:49
Done.
| |
59 | 63 |
60 // Returns a pointer to this controller's view, cast as an AnimatableView. | 64 // Returns a pointer to this controller's view, cast as an AnimatableView. |
61 - (AnimatableView*)animatableView; | 65 - (AnimatableView*)animatableView; |
62 | 66 |
63 // Open or animate open the infobar. | 67 // Open or animate open the infobar. |
64 - (void)open; | 68 - (void)open; |
65 - (void)animateOpen; | 69 - (void)animateOpen; |
66 | 70 |
67 // Close or animate close the infobar. | 71 // Close or animate close the infobar. |
68 - (void)close; | 72 - (void)close; |
(...skipping 28 matching lines...) Expand all Loading... | |
97 @end | 101 @end |
98 | 102 |
99 | 103 |
100 @interface ConfirmInfoBarController : InfoBarController | 104 @interface ConfirmInfoBarController : InfoBarController |
101 // Called when the OK and Cancel buttons are clicked. | 105 // Called when the OK and Cancel buttons are clicked. |
102 - (IBAction)ok:(id)sender; | 106 - (IBAction)ok:(id)sender; |
103 - (IBAction)cancel:(id)sender; | 107 - (IBAction)cancel:(id)sender; |
104 // Called when there is a click on the link in the infobar. | 108 // Called when there is a click on the link in the infobar. |
105 - (void)linkClicked; | 109 - (void)linkClicked; |
106 @end | 110 @end |
OLD | NEW |