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

Unified Diff: chrome/browser/ui/views/tabs/base_tab.cc

Issue 7067007: Remove prefix eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/title_prefix_matcher_unittest.cc ('k') | chrome/browser/ui/views/tabs/base_tab_strip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/base_tab.cc
===================================================================
--- chrome/browser/ui/views/tabs/base_tab.cc (revision 86295)
+++ chrome/browser/ui/views/tabs/base_tab.cc (working copy)
@@ -10,7 +10,6 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "chrome/browser/ui/title_prefix_matcher.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/tabs/tab_controller.h"
#include "chrome/common/chrome_switches.h"
@@ -475,8 +474,6 @@
// Paint the Title.
const gfx::Rect& title_bounds = GetTitleBounds();
string16 title = data().title;
- bool should_truncate = false;
- int prefix_length = 0;
if (title.empty()) {
title = data().loading ?
@@ -484,25 +481,12 @@
TabContentsWrapper::GetDefaultTitle();
} else {
Browser::FormatTitleForDisplay(&title);
- // If we'll need to truncate, check if we should also truncate
- // a common prefix, but only if there is enough room for it.
- // We arbitrarily choose to request enough room for 6 average chars.
- should_truncate =
- data().common_prefix_length > TitlePrefixMatcher::kMinElidingLength &&
- font_->GetExpectedTextWidth(6) < title_bounds.width() &&
- font_->GetStringWidth(title) > title_bounds.width();
- prefix_length = data().common_prefix_length -
- TitlePrefixMatcher::kCommonCharsToShow;
}
#if defined(OS_WIN)
canvas->AsCanvasSkia()->DrawFadeTruncatingString(title,
Peter Kasting 2011/05/23 23:06:43 Nit: I think we should also simplify this API. Le
sail 2011/05/23 23:25:36 Sounds good. I'll send that out separately. I'm tr
- should_truncate ? gfx::CanvasSkia::TruncateFadeHeadAndTail :
- gfx::CanvasSkia::TruncateFadeTail,
- prefix_length, *font_, title_color, title_bounds);
+ gfx::CanvasSkia::TruncateFadeTail, 0, *font_, title_color, title_bounds);
#else
- if (should_truncate)
- title.replace(0, prefix_length, UTF8ToUTF16(ui::kEllipsis));
canvas->DrawStringInt(title, *font_, title_color,
title_bounds.x(), title_bounds.y(),
title_bounds.width(), title_bounds.height());
« no previous file with comments | « chrome/browser/ui/title_prefix_matcher_unittest.cc ('k') | chrome/browser/ui/views/tabs/base_tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698