| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/mac/mac_util.h" | 5 #include "base/mac/mac_util.h" |
| 6 #include "chrome/browser/accessibility/browser_accessibility_state.h" | 6 #include "chrome/browser/accessibility/browser_accessibility_state.h" |
| 7 #import "chrome/browser/themes/browser_theme_provider.h" | 7 #import "chrome/browser/themes/browser_theme_provider.h" |
| 8 #import "chrome/browser/ui/cocoa/menu_controller.h" | 8 #import "chrome/browser/ui/cocoa/menu_controller.h" |
| 9 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" | 9 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h" | 10 #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h" |
| 11 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" | 11 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
| 12 #import "chrome/browser/ui/cocoa/themed_window.h" | 12 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 13 #import "chrome/common/extensions/extension.h" | 13 #import "chrome/common/extensions/extension.h" |
| 14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 15 #import "third_party/GTM/AppKit/GTMFadeTruncatingTextFieldCell.h" |
| 15 #include "ui/base/l10n/l10n_util_mac.h" | 16 #include "ui/base/l10n/l10n_util_mac.h" |
| 16 | 17 |
| 17 @implementation TabController | 18 @implementation TabController |
| 18 | 19 |
| 19 @synthesize action = action_; | 20 @synthesize action = action_; |
| 20 @synthesize app = app_; | 21 @synthesize app = app_; |
| 21 @synthesize loadingState = loadingState_; | 22 @synthesize loadingState = loadingState_; |
| 22 @synthesize mini = mini_; | 23 @synthesize mini = mini_; |
| 23 @synthesize pinned = pinned_; | 24 @synthesize pinned = pinned_; |
| 24 @synthesize target = target_; | 25 @synthesize target = target_; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 304 |
| 304 // Called by the tabs to determine whether we are in rapid (tab) closure mode. | 305 // Called by the tabs to determine whether we are in rapid (tab) closure mode. |
| 305 - (BOOL)inRapidClosureMode { | 306 - (BOOL)inRapidClosureMode { |
| 306 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) { | 307 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) { |
| 307 return [[self target] performSelector:@selector(inRapidClosureMode)] ? | 308 return [[self target] performSelector:@selector(inRapidClosureMode)] ? |
| 308 YES : NO; | 309 YES : NO; |
| 309 } | 310 } |
| 310 return NO; | 311 return NO; |
| 311 } | 312 } |
| 312 | 313 |
| 314 - (void)setTitleCommonPrefixLength:(NSUInteger)length { |
| 315 DCHECK([[titleView_ cell] isKindOfClass: |
| 316 [GTMFadeTruncatingTextFieldCell class]]); |
| 317 GTMFadeTruncatingTextFieldCell* cell = [titleView_ cell]; |
| 318 [cell setDesiredCharactersToTruncateFromHead:length]; |
| 319 [cell setTruncateMode:length > 0 ? GTMFadeTruncatingHeadAndTail : |
| 320 GTMFadeTruncatingTail]; |
| 321 } |
| 322 |
| 313 @end | 323 @end |
| OLD | NEW |