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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 // in motion. | 1506 // in motion. |
1507 - (void)tabDetachedWithContents:(content::WebContents*)contents | 1507 - (void)tabDetachedWithContents:(content::WebContents*)contents |
1508 atIndex:(NSInteger)modelIndex { | 1508 atIndex:(NSInteger)modelIndex { |
1509 // Take closing tabs into account. | 1509 // Take closing tabs into account. |
1510 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1510 NSInteger index = [self indexFromModelIndex:modelIndex]; |
1511 | 1511 |
1512 // Cancel any pending tab transition. | 1512 // Cancel any pending tab transition. |
1513 hoverTabSelector_->CancelTabTransition(); | 1513 hoverTabSelector_->CancelTabTransition(); |
1514 | 1514 |
1515 TabController* tab = [tabArray_ objectAtIndex:index]; | 1515 TabController* tab = [tabArray_ objectAtIndex:index]; |
1516 if (tabStripModel_->count() > 0 && !tabStripModel_->closing_all()) { | 1516 if (tabStripModel_->count() > 0) { |
1517 [self startClosingTabWithAnimation:tab]; | 1517 [self startClosingTabWithAnimation:tab]; |
1518 [self layoutTabs]; | 1518 [self layoutTabs]; |
1519 } else { | 1519 } else { |
1520 // Don't remove the tab, as that makes the window look jarring without any | 1520 // Don't remove the tab, as that makes the window look jarring without any |
1521 // tabs. Instead, simply mark it as closing to prevent the tab from | 1521 // tabs. Instead, simply mark it as closing to prevent the tab from |
1522 // generating any drags or selections. | 1522 // generating any drags or selections. |
1523 [[tab tabView] setClosing:YES]; | 1523 [[tab tabView] setClosing:YES]; |
1524 } | 1524 } |
1525 | 1525 |
1526 [delegate_ onTabDetachedWithContents:contents]; | 1526 [delegate_ onTabDetachedWithContents:contents]; |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2389 for (int i = 0; i < tabStripModel_->count(); i++) { | 2389 for (int i = 0; i < tabStripModel_->count(); i++) { |
2390 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; | 2390 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; |
2391 } | 2391 } |
2392 } | 2392 } |
2393 | 2393 |
2394 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { | 2394 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { |
2395 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; | 2395 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; |
2396 } | 2396 } |
2397 | 2397 |
2398 @end | 2398 @end |
OLD | NEW |