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