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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_shelf_controller.mm

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dealloc override. Created 5 years, 5 months 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
OLDNEW
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/download/download_shelf_controller.h" 5 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/download/download_stats.h" 9 #include "chrome/browser/download/download_stats.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 [[self view] setFrame:frame]; 110 [[self view] setFrame:frame];
111 111
112 downloadItemControllers_.reset([[NSMutableArray alloc] init]); 112 downloadItemControllers_.reset([[NSMutableArray alloc] init]);
113 113
114 bridge_.reset(new DownloadShelfMac(browser, self)); 114 bridge_.reset(new DownloadShelfMac(browser, self));
115 navigator_ = browser; 115 navigator_ = browser;
116 } 116 }
117 return self; 117 return self;
118 } 118 }
119 119
120 - (void)browserWillBeDestroyed {
tapted 2015/07/06 07:26:18 should come after dealloc (init[WithFoo] and deall
jackhou1 2015/07/07 03:27:27 Done.
121 navigator_ = nullptr;
122 }
123
120 - (void)awakeFromNib { 124 - (void)awakeFromNib {
121 DCHECK(hoverCloseButton_); 125 DCHECK(hoverCloseButton_);
122 126
123 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; 127 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
124 [[self animatableView] setResizeDelegate:resizeDelegate_]; 128 [[self animatableView] setResizeDelegate:resizeDelegate_];
125 [[self view] setPostsFrameChangedNotifications:YES]; 129 [[self view] setPostsFrameChangedNotifications:YES];
126 [defaultCenter addObserver:self 130 [defaultCenter addObserver:self
127 selector:@selector(viewFrameDidChange:) 131 selector:@selector(viewFrameDidChange:)
128 name:NSViewFrameDidChangeNotification 132 name:NSViewFrameDidChangeNotification
129 object:[self view]]; 133 object:[self view]];
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 508 }
505 509
506 // Set the tracking off to create a new tracking area for the control. 510 // Set the tracking off to create a new tracking area for the control.
507 // When changing the bounds/frame on a HoverButton, the tracking isn't updated 511 // When changing the bounds/frame on a HoverButton, the tracking isn't updated
508 // correctly, it needs to be turned off and back on. 512 // correctly, it needs to be turned off and back on.
509 [hoverCloseButton_ setTrackingEnabled:NO]; 513 [hoverCloseButton_ setTrackingEnabled:NO];
510 [hoverCloseButton_ setFrame:bounds]; 514 [hoverCloseButton_ setFrame:bounds];
511 [hoverCloseButton_ setTrackingEnabled:YES]; 515 [hoverCloseButton_ setTrackingEnabled:YES];
512 } 516 }
513 @end 517 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698