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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_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/tabs/tab_strip_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // constructed. 565 // constructed.
566 if (existingTabCount) { 566 if (existingTabCount) {
567 [self performSelectorOnMainThread:@selector(layoutTabs) 567 [self performSelectorOnMainThread:@selector(layoutTabs)
568 withObject:nil 568 withObject:nil
569 waitUntilDone:NO]; 569 waitUntilDone:NO];
570 } 570 }
571 } 571 }
572 return self; 572 return self;
573 } 573 }
574 574
575 - (void)browserWillBeDestroyed {
576 browser_ = nullptr;
577 }
578
575 - (void)dealloc { 579 - (void)dealloc {
576 [tabStripView_ setController:nil]; 580 [tabStripView_ setController:nil];
tapted 2015/07/06 07:26:18 Doing this for all the controlled views in other c
jackhou1 2015/07/07 03:27:27 I've just done this for things that might retain t
577 581
578 if (trackingArea_.get()) 582 if (trackingArea_.get())
579 [tabStripView_ removeTrackingArea:trackingArea_.get()]; 583 [tabStripView_ removeTrackingArea:trackingArea_.get()];
580 584
581 [newTabButton_ removeTrackingArea:newTabTrackingArea_.get()]; 585 [newTabButton_ removeTrackingArea:newTabTrackingArea_.get()];
582 // Invalidate all closing animations so they don't call back to us after 586 // Invalidate all closing animations so they don't call back to us after
583 // we're gone. 587 // we're gone.
584 for (TabController* controller in closingControllers_.get()) { 588 for (TabController* controller in closingControllers_.get()) {
585 NSView* view = [controller view]; 589 NSView* view = [controller view];
586 [[[view animationForKey:@"frameOrigin"] delegate] invalidate]; 590 [[[view animationForKey:@"frameOrigin"] delegate] invalidate];
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
2277 forButtonState:image_button_cell::kHoverStateBackground]; 2281 forButtonState:image_button_cell::kHoverStateBackground];
2278 } else { 2282 } else {
2279 [[newTabButton_ cell] setImage:nil 2283 [[newTabButton_ cell] setImage:nil
2280 forButtonState:image_button_cell::kDefaultStateBackground]; 2284 forButtonState:image_button_cell::kDefaultStateBackground];
2281 [[newTabButton_ cell] setImage:nil 2285 [[newTabButton_ cell] setImage:nil
2282 forButtonState:image_button_cell::kHoverStateBackground]; 2286 forButtonState:image_button_cell::kHoverStateBackground];
2283 } 2287 }
2284 } 2288 }
2285 2289
2286 @end 2290 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698