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 "chrome/browser/ui/cocoa/infobars/infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // Called when someone clicks on the close button. | 107 // Called when someone clicks on the close button. |
108 - (void)dismiss:(id)sender { | 108 - (void)dismiss:(id)sender { |
109 if (![self isOwned]) | 109 if (![self isOwned]) |
110 return; | 110 return; |
111 [self delegate]->InfoBarDismissed(); | 111 [self delegate]->InfoBarDismissed(); |
112 [self removeSelf]; | 112 [self removeSelf]; |
113 } | 113 } |
114 | 114 |
115 - (void)removeSelf { | 115 - (void)removeSelf { |
116 infobar_->RemoveSelfCocoa(); | 116 infobar_->RemoveSelf(); |
117 } | 117 } |
118 | 118 |
119 - (void)addAdditionalControls { | 119 - (void)addAdditionalControls { |
120 // Default implementation does nothing. | 120 // Default implementation does nothing. |
121 } | 121 } |
122 | 122 |
123 - (void)infobarWillClose { | 123 - (void)infobarWillClose { |
124 } | 124 } |
125 | 125 |
126 - (void)removeButtons { | 126 - (void)removeButtons { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 label_.reset([[HyperlinkTextView alloc] | 171 label_.reset([[HyperlinkTextView alloc] |
172 initWithFrame:[labelPlaceholder_ frame]]); | 172 initWithFrame:[labelPlaceholder_ frame]]); |
173 [label_.get() setAutoresizingMask:[labelPlaceholder_ autoresizingMask]]; | 173 [label_.get() setAutoresizingMask:[labelPlaceholder_ autoresizingMask]]; |
174 [[labelPlaceholder_ superview] | 174 [[labelPlaceholder_ superview] |
175 replaceSubview:labelPlaceholder_ with:label_.get()]; | 175 replaceSubview:labelPlaceholder_ with:label_.get()]; |
176 labelPlaceholder_ = nil; // Now released. | 176 labelPlaceholder_ = nil; // Now released. |
177 [label_.get() setDelegate:self]; | 177 [label_.get() setDelegate:self]; |
178 } | 178 } |
179 | 179 |
180 @end | 180 @end |
OLD | NEW |