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

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

Issue 6783015: Improvements to tab title prefix eliding as per email discussions. (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 80442)
+++ chrome/browser/ui/cocoa/tabs/tab_controller.mm (working copy)
@@ -9,6 +9,7 @@
#import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h"
#import "chrome/browser/ui/cocoa/tabs/tab_view.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
+#include "chrome/browser/ui/title_prefix_matcher.h"
#import "chrome/common/extensions/extension.h"
#include "grit/generated_resources.h"
#import "third_party/GTM/AppKit/GTMFadeTruncatingTextFieldCell.h"
@@ -22,6 +23,7 @@
@synthesize mini = mini_;
@synthesize pinned = pinned_;
@synthesize target = target_;
+@synthesize url = url_;
@synthesize iconView = iconView_;
@synthesize titleView = titleView_;
@synthesize closeButton = closeButton_;
@@ -308,9 +310,10 @@
DCHECK([[titleView_ cell] isKindOfClass:
[GTMFadeTruncatingTextFieldCell class]]);
GTMFadeTruncatingTextFieldCell* cell = [titleView_ cell];
- [cell setDesiredCharactersToTruncateFromHead:length];
- [cell setTruncateMode:length > 0 ? GTMFadeTruncatingHeadAndTail :
- GTMFadeTruncatingTail];
+ [cell setDesiredCharactersToTruncateFromHead:length -
+ TitlePrefixMatcher::kCommonCharsToShow];
+ [cell setTruncateMode:length > TitlePrefixMatcher::kMinElidingLength ?
+ 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