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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_controller.mm

Issue 8698016: Remove InfoBarDelegate::InfoBarClosed(), delete InfoBars directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cancelling changes. Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tab_contents/confirm_infobar_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/logging.h" // for NOTREACHED() 7 #include "base/logging.h" // for NOTREACHED()
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/infobars/infobar_tab_helper.h" 10 #include "chrome/browser/infobars/infobar_tab_helper.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 replaceSubview:labelPlaceholder_ with:label_.get()]; 229 replaceSubview:labelPlaceholder_ with:label_.get()];
230 labelPlaceholder_ = nil; // Now released. 230 labelPlaceholder_ = nil; // Now released.
231 [label_.get() setDelegate:self]; 231 [label_.get() setDelegate:self];
232 } 232 }
233 233
234 - (void)cleanUpAfterAnimation:(BOOL)finished { 234 - (void)cleanUpAfterAnimation:(BOOL)finished {
235 // Don't need to do any cleanup if the bar was animating open. 235 // Don't need to do any cleanup if the bar was animating open.
236 if (!infoBarClosing_) 236 if (!infoBarClosing_)
237 return; 237 return;
238 238
239 // Notify the delegate that the infobar was closed. The delegate will delete 239 // Notify the delegate that the infobar was closed.
240 // itself as a result of InfoBarClosed(), so we null out its pointer.
241 if (delegate_) { 240 if (delegate_) {
242 delegate_->InfoBarClosed(); 241 delete delegate_;
243 delegate_ = NULL; 242 delegate_ = NULL;
244 } 243 }
245 244
246 // If the animation ran to completion, then we need to remove ourselves from 245 // If the animation ran to completion, then we need to remove ourselves from
247 // the container. If the animation was interrupted, then the container will 246 // the container. If the animation was interrupted, then the container will
248 // take care of removing us. 247 // take care of removing us.
249 // TODO(rohitrao): UGH! This works for now, but should be cleaner. 248 // TODO(rohitrao): UGH! This works for now, but should be cleaner.
250 if (finished) 249 if (finished)
251 [containerController_ removeController:self]; 250 [containerController_ removeController:self];
252 } 251 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 LinkInfoBarController* controller = 455 LinkInfoBarController* controller =
457 [[LinkInfoBarController alloc] initWithDelegate:this owner:owner]; 456 [[LinkInfoBarController alloc] initWithDelegate:this owner:owner];
458 return new InfoBar(controller, this); 457 return new InfoBar(controller, this);
459 } 458 }
460 459
461 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { 460 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) {
462 ConfirmInfoBarController* controller = 461 ConfirmInfoBarController* controller =
463 [[ConfirmInfoBarController alloc] initWithDelegate:this owner:owner]; 462 [[ConfirmInfoBarController alloc] initWithDelegate:this owner:owner];
464 return new InfoBar(controller, this); 463 return new InfoBar(controller, this);
465 } 464 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/confirm_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698