Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4798)

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_controller.mm

Issue 6688050: Mac: Elides the beginning of tab titles that have common prefixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_controller.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_controller.mm
===================================================================
--- chrome/browser/ui/cocoa/tabs/tab_controller.mm (revision 78685)
+++ chrome/browser/ui/cocoa/tabs/tab_controller.mm (working copy)
@@ -12,6 +12,7 @@
#import "chrome/browser/ui/cocoa/themed_window.h"
#import "chrome/common/extensions/extension.h"
#include "grit/generated_resources.h"
+#import "third_party/GTM/AppKit/GTMFadeTruncatingTextFieldCell.h"
#include "ui/base/l10n/l10n_util_mac.h"
@implementation TabController
@@ -310,4 +311,13 @@
return NO;
}
+- (void)setTitleCommonPrefixLength:(NSUInteger)length {
+ DCHECK([[titleView_ cell] isKindOfClass:
+ [GTMFadeTruncatingTextFieldCell class]]);
+ GTMFadeTruncatingTextFieldCell* cell = [titleView_ cell];
+ [cell setDesiredCharactersToTruncateFromHead:length];
+ [cell setTruncateMode:length > 0 ? GTMFadeTruncatingHeadAndTail :
+ GTMFadeTruncatingTail];
+}
+
@end
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_controller.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698