| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/tab_strip_controller.h" | 5 #import "chrome/browser/cocoa/tab_strip_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 // Release the tab contents controller so those views get destroyed. This | 624 // Release the tab contents controller so those views get destroyed. This |
| 625 // will remove all the tab content Cocoa views from the hierarchy. A | 625 // will remove all the tab content Cocoa views from the hierarchy. A |
| 626 // subsequent "select tab" notification will follow from the model. To | 626 // subsequent "select tab" notification will follow from the model. To |
| 627 // tell us what to swap in in its absence. | 627 // tell us what to swap in in its absence. |
| 628 [tabContentsArray_ removeObjectAtIndex:index]; | 628 [tabContentsArray_ removeObjectAtIndex:index]; |
| 629 | 629 |
| 630 // Remove the |index|th view from the tab strip | 630 // Remove the |index|th view from the tab strip |
| 631 NSView* tab = [self viewAtIndex:index]; | 631 NSView* tab = [self viewAtIndex:index]; |
| 632 [tab removeFromSuperview]; | 632 [tab removeFromSuperview]; |
| 633 | 633 |
| 634 // Clear the tab controller's target. |
| 635 // TODO(viettrungluu): [crbug.com/23829] Find a better way to handle the tab |
| 636 // controller's target. |
| 637 TabController* tabController = [tabArray_ objectAtIndex:index]; |
| 638 [tabController setTarget:nil]; |
| 639 |
| 634 if ([hoveredTab_ isEqual:tab]) { | 640 if ([hoveredTab_ isEqual:tab]) { |
| 635 hoveredTab_ = nil; | 641 hoveredTab_ = nil; |
| 636 } | 642 } |
| 637 | 643 |
| 638 NSValue *identifier = [NSValue valueWithPointer:tab]; | 644 NSValue *identifier = [NSValue valueWithPointer:tab]; |
| 639 [targetFrames_ removeObjectForKey:identifier]; | 645 [targetFrames_ removeObjectForKey:identifier]; |
| 640 | 646 |
| 641 // Once we're totally done with the tab, delete its controller | 647 // Once we're totally done with the tab, delete its controller |
| 642 [tabArray_ removeObjectAtIndex:index]; | 648 [tabArray_ removeObjectAtIndex:index]; |
| 643 | 649 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 BrowserWindowController* controller = | 985 BrowserWindowController* controller = |
| 980 (BrowserWindowController*)[[switchView_ window] windowController]; | 986 (BrowserWindowController*)[[switchView_ window] windowController]; |
| 981 DCHECK(index >= 0); | 987 DCHECK(index >= 0); |
| 982 if (index >= 0) { | 988 if (index >= 0) { |
| 983 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 989 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
| 984 } | 990 } |
| 985 } | 991 } |
| 986 | 992 |
| 987 | 993 |
| 988 @end | 994 @end |
| OLD | NEW |