| 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 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2199 givesIndex:&index | 2199 givesIndex:&index |
| 2200 disposition:&disposition | 2200 disposition:&disposition |
| 2201 activateTab:YES]; | 2201 activateTab:YES]; |
| 2202 | 2202 |
| 2203 NSPoint arrowPos = NSMakePoint(0, arrowBaseY); | 2203 NSPoint arrowPos = NSMakePoint(0, arrowBaseY); |
| 2204 if (index == -1) { | 2204 if (index == -1) { |
| 2205 // Append a tab at the end. | 2205 // Append a tab at the end. |
| 2206 DCHECK(disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB); | 2206 DCHECK(disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB); |
| 2207 NSInteger lastIndex = [tabArray_ count] - 1; | 2207 NSInteger lastIndex = [tabArray_ count] - 1; |
| 2208 NSRect overRect = [[[tabArray_ objectAtIndex:lastIndex] view] frame]; | 2208 NSRect overRect = [[[tabArray_ objectAtIndex:lastIndex] view] frame]; |
| 2209 arrowPos.x = overRect.origin.x + overRect.size.width - kTabOverlap / 2.0; | 2209 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |
| 2210 arrowPos.x = NSMinX(overRect) + kTabOverlap / 2.0; |
| 2211 } else { |
| 2212 arrowPos.x = NSMaxX(overRect) - kTabOverlap / 2.0; |
| 2213 } |
| 2210 } else { | 2214 } else { |
| 2211 NSRect overRect = [[[tabArray_ objectAtIndex:index] view] frame]; | 2215 NSRect overRect = [[[tabArray_ objectAtIndex:index] view] frame]; |
| 2212 switch (disposition) { | 2216 switch (disposition) { |
| 2213 case WindowOpenDisposition::NEW_FOREGROUND_TAB: | 2217 case WindowOpenDisposition::NEW_FOREGROUND_TAB: |
| 2214 // Insert tab (to the left of the given tab). | 2218 // Insert tab (before the given tab). |
| 2215 arrowPos.x = overRect.origin.x + kTabOverlap / 2.0; | 2219 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |
| 2220 arrowPos.x = NSMaxX(overRect) - kTabOverlap / 2.0; |
| 2221 } else { |
| 2222 arrowPos.x = NSMinX(overRect) + kTabOverlap / 2.0; |
| 2223 } |
| 2216 break; | 2224 break; |
| 2217 case WindowOpenDisposition::CURRENT_TAB: | 2225 case WindowOpenDisposition::CURRENT_TAB: |
| 2218 // Overwrite the given tab. | 2226 // Overwrite the given tab. |
| 2219 arrowPos.x = overRect.origin.x + overRect.size.width / 2.0; | 2227 arrowPos.x = overRect.origin.x + overRect.size.width / 2.0; |
| 2220 break; | 2228 break; |
| 2221 default: | 2229 default: |
| 2222 NOTREACHED(); | 2230 NOTREACHED(); |
| 2223 } | 2231 } |
| 2224 } | 2232 } |
| 2225 | 2233 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2409 for (int i = 0; i < tabStripModel_->count(); i++) { | 2417 for (int i = 0; i < tabStripModel_->count(); i++) { |
| 2410 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; | 2418 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; |
| 2411 } | 2419 } |
| 2412 } | 2420 } |
| 2413 | 2421 |
| 2414 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { | 2422 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { |
| 2415 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; | 2423 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; |
| 2416 } | 2424 } |
| 2417 | 2425 |
| 2418 @end | 2426 @end |
| OLD | NEW |