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/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 Loading... |
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)dealloc { | 575 - (void)browserWillBeDestroyed { |
576 [tabStripView_ setController:nil]; | 576 [tabStripView_ setController:nil]; |
577 | 577 |
578 if (trackingArea_.get()) | 578 if (trackingArea_.get()) |
579 [tabStripView_ removeTrackingArea:trackingArea_.get()]; | 579 [tabStripView_ removeTrackingArea:trackingArea_.get()]; |
580 | 580 |
581 [newTabButton_ removeTrackingArea:newTabTrackingArea_.get()]; | 581 [newTabButton_ removeTrackingArea:newTabTrackingArea_.get()]; |
582 // Invalidate all closing animations so they don't call back to us after | 582 // Invalidate all closing animations so they don't call back to us after |
583 // we're gone. | 583 // we're gone. |
584 for (TabController* controller in closingControllers_.get()) { | 584 for (TabController* controller in closingControllers_.get()) { |
585 NSView* view = [controller view]; | 585 NSView* view = [controller view]; |
586 [[[view animationForKey:@"frameOrigin"] delegate] invalidate]; | 586 [[[view animationForKey:@"frameOrigin"] delegate] invalidate]; |
587 } | 587 } |
588 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 588 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
589 [super dealloc]; | 589 |
| 590 browser_ = nullptr; |
590 } | 591 } |
591 | 592 |
592 + (CGFloat)defaultTabHeight { | 593 + (CGFloat)defaultTabHeight { |
593 return [TabController defaultTabHeight]; | 594 return [TabController defaultTabHeight]; |
594 } | 595 } |
595 | 596 |
596 + (CGFloat)defaultLeftIndentForControls { | 597 + (CGFloat)defaultLeftIndentForControls { |
597 // Default indentation leaves enough room so tabs don't overlap with the | 598 // Default indentation leaves enough room so tabs don't overlap with the |
598 // window controls. | 599 // window controls. |
599 return 70.0; | 600 return 70.0; |
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 forButtonState:image_button_cell::kHoverStateBackground]; | 2278 forButtonState:image_button_cell::kHoverStateBackground]; |
2278 } else { | 2279 } else { |
2279 [[newTabButton_ cell] setImage:nil | 2280 [[newTabButton_ cell] setImage:nil |
2280 forButtonState:image_button_cell::kDefaultStateBackground]; | 2281 forButtonState:image_button_cell::kDefaultStateBackground]; |
2281 [[newTabButton_ cell] setImage:nil | 2282 [[newTabButton_ cell] setImage:nil |
2282 forButtonState:image_button_cell::kHoverStateBackground]; | 2283 forButtonState:image_button_cell::kHoverStateBackground]; |
2283 } | 2284 } |
2284 } | 2285 } |
2285 | 2286 |
2286 @end | 2287 @end |
OLD | NEW |