summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc2
-rw-r--r--chrome/browser/autocomplete/history_url_provider.cc2
-rw-r--r--chrome/browser/jsmessage_box_handler.cc2
-rw-r--r--chrome/browser/printing/page_overlays.cc2
-rw-r--r--chrome/browser/printing/printed_document.cc2
-rw-r--r--chrome/browser/toolbar_model.cc2
-rw-r--r--chrome/browser/url_fixer_upper.cc2
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc2
-rw-r--r--chrome/browser/views/constrained_window_impl.cc2
-rw-r--r--chrome/browser/views/download_item_view.cc51
-rw-r--r--chrome/browser/views/download_tab_view.cc20
-rw-r--r--chrome/browser/views/password_manager_view.h2
-rw-r--r--chrome/browser/views/shelf_item_dialog.cc2
-rw-r--r--chrome/browser/views/status_bubble.cc2
-rw-r--r--chrome/common/common.scons2
-rw-r--r--chrome/common/common.vcproj4
-rw-r--r--chrome/common/gfx/text_elider.cc (renamed from chrome/common/gfx/url_elider.cc)31
-rw-r--r--chrome/common/gfx/text_elider.h (renamed from chrome/common/gfx/url_elider.h)13
-rw-r--r--chrome/common/gfx/text_elider_unittest.cc (renamed from chrome/common/gfx/url_elider_unittest.cc)46
-rw-r--r--chrome/test/unit/unit_tests.scons2
-rw-r--r--chrome/test/unit/unittests.vcproj4
-rw-r--r--chrome/views/label.cc2
-rw-r--r--chrome/views/tooltip_manager.cc2
23 files changed, 125 insertions, 76 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 603b0a9..4a49481 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/history_tab_ui.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/url_fixer_upper.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index cdbc82d..01293db 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/history/history_database.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/url_fixer_upper.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/sqlite_utils.h"
diff --git a/chrome/browser/jsmessage_box_handler.cc b/chrome/browser/jsmessage_box_handler.cc
index df740cc..e161d14 100644
--- a/chrome/browser/jsmessage_box_handler.cc
+++ b/chrome/browser/jsmessage_box_handler.cc
@@ -7,7 +7,7 @@
#include "chrome/browser/app_modal_dialog_queue.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/web_contents.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_types.h"
diff --git a/chrome/browser/printing/page_overlays.cc b/chrome/browser/printing/page_overlays.cc
index a02ed24..714f194 100644
--- a/chrome/browser/printing/page_overlays.cc
+++ b/chrome/browser/printing/page_overlays.cc
@@ -8,7 +8,7 @@
#include "base/string_util.h"
#include "chrome/browser/printing/printed_document.h"
#include "chrome/browser/printing/printed_page.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
namespace {
diff --git a/chrome/browser/printing/printed_document.cc b/chrome/browser/printing/printed_document.cc
index 466ff00..b5eecb3 100644
--- a/chrome/browser/printing/printed_document.cc
+++ b/chrome/browser/printing/printed_document.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/printing/units.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/gfx/emf.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/time_format.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/win_util.h"
diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc
index 9f83ed2..e2cf9a5 100644
--- a/chrome/browser/toolbar_model.cc
+++ b/chrome/browser/toolbar_model.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/navigation_entry.h"
#include "chrome/browser/ssl_error_info.h"
#include "chrome/browser/tab_contents.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
diff --git a/chrome/browser/url_fixer_upper.cc b/chrome/browser/url_fixer_upper.cc
index b903186..a62694d 100644
--- a/chrome/browser/url_fixer_upper.cc
+++ b/chrome/browser/url_fixer_upper.cc
@@ -10,7 +10,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_util.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "googleurl/src/gurl.h"
#include "googleurl/src/url_canon.h"
#include "googleurl/src/url_file.h"
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 3e514ba..66d1ccd 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -30,7 +30,7 @@
#include "chrome/browser/views/input_window.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/favicon_size.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_types.h"
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc
index a1da56c..d504585 100644
--- a/chrome/browser/views/constrained_window_impl.cc
+++ b/chrome/browser/views/constrained_window_impl.cc
@@ -19,7 +19,7 @@
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/gfx/path.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc
index 01efbd6..60a13f5 100644
--- a/chrome/browser/views/download_item_view.cc
+++ b/chrome/browser/views/download_item_view.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/views/download_shelf_view.h"
#include "chrome/common/gfx/chrome_canvas.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
@@ -455,47 +456,19 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) {
// Last value of x was the end of the right image, just before the button.
// Note that in dangerous mode we use a label (as the text is multi-line).
if (!IsDangerousMode()) {
- // Because just drawing the filename using DrawStringInt results in
- // Windows eliding the text and potentially chopping off the file
- // extension, we need to draw the file's name and extension separately.
-
- // Extract the file extension (if any).
- std::wstring extension = L"." +
- file_util::GetFileExtensionFromPath(download_->GetFileName());
- std::wstring rootname = file_util::GetFilenameWithoutExtensionFromPath(
- download_->GetFileName());
-
- // Figure out the width of the extension.
- int ext_width = 0;
- int file_width = 0;
- int h = 0;
- canvas->SizeStringInt(extension, font_, &ext_width, &h,
- ChromeCanvas::NO_ELLIPSIS);
- canvas->SizeStringInt(rootname, font_, &file_width, &h,
- ChromeCanvas::NO_ELLIPSIS);
-
- // If the extension is ridiculously long, truncate it.
- if (ext_width > kTextWidth / 2)
- ext_width = kTextWidth / 2;
-
- // Expand the extension width to fill any spare space so that
- // it is aligned to the right edge of the file.
- if (file_width < kTextWidth - ext_width)
- ext_width = kTextWidth - file_width;
+ std::wstring filename =
+ gfx::ElideFilename(download_->GetFileName(),
+ font_,
+ kTextWidth);
if (show_status_text_) {
int y = box_y_ + kVerticalPadding;
// Draw the file's name.
- canvas->DrawStringInt(rootname, font_, kFileNameColor,
+ canvas->DrawStringInt(filename, font_, kFileNameColor,
download_util::kSmallProgressIconSize, y,
- kTextWidth - ext_width, font_.height());
+ kTextWidth, font_.height());
- // Draw the file's extension.
- canvas->DrawStringInt(extension, font_, kFileNameColor,
- download_util::kSmallProgressIconSize +
- kTextWidth - ext_width, y,
- ext_width, font_.height());
y += font_.height() + kVerticalTextPadding;
canvas->DrawStringInt(status_text_, font_, kStatusColor,
@@ -505,15 +478,9 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) {
int y = box_y_ + (box_height_ - font_.height()) / 2;
// Draw the file's name.
- canvas->DrawStringInt(rootname, font_, kFileNameColor,
+ canvas->DrawStringInt(filename, font_, kFileNameColor,
download_util::kSmallProgressIconSize, y,
- kTextWidth - ext_width, font_.height());
-
- // Draw the file's extension.
- canvas->DrawStringInt(extension, font_, kFileNameColor,
- download_util::kSmallProgressIconSize +
- kTextWidth - ext_width, y,
- ext_width, font_.height());
+ kTextWidth, font_.height());
}
}
diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc
index 1098aa2..6736ff6 100644
--- a/chrome/browser/views/download_tab_view.cc
+++ b/chrome/browser/views/download_tab_view.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/user_metrics.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/stl_util-inl.h"
@@ -281,8 +282,13 @@ void DownloadItemTabView::LayoutComplete() {
parent_->big_icon_size() + kInfoPadding;
// File name and URL
- file_name_->SetText(model_->GetFileName());
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ ChromeFont font = rb.GetFont(ResourceBundle::WebFont);
+ file_name_->SetText(
+ gfx::ElideFilename(model_->GetFileName(), font, kFilenameSize));
+
gfx::Size file_name_size = file_name_->GetPreferredSize();
+
file_name_->SetBounds(dx, parent_->big_icon_offset(),
std::min(kFilenameSize,
static_cast<int>(file_name_size.width())),
@@ -331,7 +337,11 @@ void DownloadItemTabView::LayoutCancelled() {
parent_->big_icon_size() + kInfoPadding;
// File name and URL, truncated to show cancelled status
- file_name_->SetText(model_->GetFileName());
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ ChromeFont font = rb.GetFont(ResourceBundle::WebFont);
+ file_name_->SetText(gfx::ElideFilename(model_->GetFileName(),
+ font,
+ kFilenameSize));
gfx::Size file_name_size = file_name_->GetPreferredSize();
file_name_->SetBounds(dx, parent_->big_icon_offset(),
kFilenameSize - kProgressSize - kSpacer,
@@ -418,7 +428,11 @@ void DownloadItemTabView::LayoutInProgress() {
parent_->big_icon_size() + kInfoPadding;
// File name and URL, truncated to show progress status
- file_name_->SetText(model_->GetFileName());
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ ChromeFont font = rb.GetFont(ResourceBundle::WebFont);
+ file_name_->SetText(gfx::ElideFilename(model_->GetFileName(),
+ font,
+ kFilenameSize));
gfx::Size file_name_size = file_name_->GetPreferredSize();
file_name_->SetBounds(dx, parent_->big_icon_offset(),
kFilenameSize - kProgressSize - kSpacer,
diff --git a/chrome/browser/views/password_manager_view.h b/chrome/browser/views/password_manager_view.h
index 8f84aa1..1a02914 100644
--- a/chrome/browser/views/password_manager_view.h
+++ b/chrome/browser/views/password_manager_view.h
@@ -10,7 +10,7 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/stl_util-inl.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/views/dialog_delegate.h"
#include "chrome/views/label.h"
#include "chrome/views/native_button.h"
diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc
index 5ea98a3..f32ce79 100644
--- a/chrome/browser/views/shelf_item_dialog.cc
+++ b/chrome/browser/views/shelf_item_dialog.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/tab_contents.h"
#include "chrome/browser/url_fixer_upper.h"
#include "chrome/browser/views/standard_layout.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
diff --git a/chrome/browser/views/status_bubble.cc b/chrome/browser/views/status_bubble.cc
index 31c675f..526e9b3 100644
--- a/chrome/browser/views/status_bubble.cc
+++ b/chrome/browser/views/status_bubble.cc
@@ -11,7 +11,7 @@
#include "chrome/app/theme/theme_resources.h"
#include "chrome/common/animation.h"
#include "chrome/common/gfx/chrome_canvas.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/label.h"
diff --git a/chrome/common/common.scons b/chrome/common/common.scons
index 07a3519..d0c5466 100644
--- a/chrome/common/common.scons
+++ b/chrome/common/common.scons
@@ -84,7 +84,7 @@ if env['PLATFORM'] == 'win32':
'gfx/emf.cc',
'gfx/icon_util.cc',
'gfx/path.cc',
- 'gfx/url_elider.cc',
+ 'gfx/text_elider.cc',
'ipc_channel.cc',
'ipc_channel_proxy.cc',
'ipc_logging.cc',
diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj
index 5359cfbd..65706a8 100644
--- a/chrome/common/common.vcproj
+++ b/chrome/common/common.vcproj
@@ -205,11 +205,11 @@
>
</File>
<File
- RelativePath=".\gfx\url_elider.cc"
+ RelativePath=".\gfx\text_elider.cc"
>
</File>
<File
- RelativePath=".\gfx\url_elider.h"
+ RelativePath=".\gfx\text_elider.h"
>
</File>
<File
diff --git a/chrome/common/gfx/url_elider.cc b/chrome/common/gfx/text_elider.cc
index b930557..a3d1c5d 100644
--- a/chrome/common/gfx/url_elider.cc
+++ b/chrome/common/gfx/text_elider.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/file_util.h"
#include "base/string_util.h"
#include "chrome/common/gfx/chrome_font.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/views/label.h"
@@ -280,6 +281,34 @@ std::wstring ElideUrl(const GURL& url,
return ElideText(final_elided_url_string, font, available_pixel_width);
}
+std::wstring ElideFilename(const std::wstring& filename,
+ const ChromeFont& font,
+ int available_pixel_width) {
+ int full_width = font.GetStringWidth(filename);
+ if (full_width <= available_pixel_width)
+ return filename;
+
+ std::wstring extension =
+ file_util::GetFileExtensionFromPath(filename);
+ std::wstring rootname =
+ file_util::GetFilenameWithoutExtensionFromPath(filename);
+
+ if (rootname.empty() || extension.empty())
+ return ElideText(filename, font, available_pixel_width);
+
+ extension = L"." + extension;
+
+ int ext_width = font.GetStringWidth(extension);
+ int root_width = font.GetStringWidth(rootname);
+
+ // We may have trimmed the path.
+ if (root_width + ext_width <= available_pixel_width)
+ return rootname + extension;
+
+ int available_root_width = available_pixel_width - ext_width;
+ return gfx::ElideText(rootname, font, available_root_width) + extension;
+}
+
// This function adds an ellipsis at the end of the text if the text
// does not fit the given pixel width.
std::wstring ElideText(const std::wstring& text,
diff --git a/chrome/common/gfx/url_elider.h b/chrome/common/gfx/text_elider.h
index 83815f0..26872db 100644
--- a/chrome/common/gfx/url_elider.h
+++ b/chrome/common/gfx/text_elider.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_GFX_URL_ELIDER_H_
-#define CHROME_COMMON_GFX_URL_ELIDER_H_
+#ifndef CHROME_COMMON_GFX_TEXT_ELIDER_H_
+#define CHROME_COMMON_GFX_TEXT_ELIDER_H_
#include <unicode/coll.h>
#include <unicode/uchar.h>
@@ -32,6 +32,13 @@ std::wstring ElideText(const std::wstring& text,
const ChromeFont& font,
int available_pixel_width);
+// Elide a filename to fit a given pixel width, with an emphasis on not hiding
+// the extension unless we have to. If filename contains a path, the path will
+// be removed if filename doesn't fit into available_pixel_width.
+std::wstring ElideFilename(const std::wstring& filename,
+ const ChromeFont& font,
+ int available_pixel_width);
+
// SortedDisplayURL maintains a string from a URL suitable for display to the
// use. SortedDisplayURL also provides a function used for comparing two
// SortedDisplayURLs for use in visually ordering the SortedDisplayURLs.
@@ -66,4 +73,4 @@ class SortedDisplayURL {
} // namespace gfx.
-#endif // #ifndef CHROME_COMMON_GFX_URL_ELIDER_H_
+#endif // CHROME_COMMON_GFX_TEXT_ELIDER_H_
diff --git a/chrome/common/gfx/url_elider_unittest.cc b/chrome/common/gfx/text_elider_unittest.cc
index 82feb80..94be302 100644
--- a/chrome/common/gfx/url_elider_unittest.cc
+++ b/chrome/common/gfx/text_elider_unittest.cc
@@ -4,7 +4,7 @@
#include "base/string_util.h"
#include "chrome/common/gfx/chrome_font.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/views/label.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,7 +40,7 @@ void RunTest(Testcase* testcases, size_t num_testcases) {
} // namespace
// Test eliding of commonplace URLs.
-TEST(URLEliderTest, TestGeneralEliding) {
+TEST(TextEliderTest, TestGeneralEliding) {
const std::wstring kEllipsisStr(kEllipsis);
Testcase testcases[] = {
{"http://www.google.com/intl/en/ads/",
@@ -66,7 +66,7 @@ TEST(URLEliderTest, TestGeneralEliding) {
}
// Test eliding of empty strings, URLs with ports, passwords, queries, etc.
-TEST(URLEliderTest, TestMoreEliding) {
+TEST(TextEliderTest, TestMoreEliding) {
const std::wstring kEllipsisStr(kEllipsis);
Testcase testcases[] = {
{"http://www.google.com/foo?bar", L"http://www.google.com/foo?bar"},
@@ -104,7 +104,7 @@ TEST(URLEliderTest, TestMoreEliding) {
}
// Test eliding of file: URLs.
-TEST(URLEliderTest, TestFileURLEliding) {
+TEST(TextEliderTest, TestFileURLEliding) {
const std::wstring kEllipsisStr(kEllipsis);
Testcase testcases[] = {
{"file:///C:/path1/path2/path3/filename",
@@ -125,7 +125,39 @@ TEST(URLEliderTest, TestFileURLEliding) {
RunTest(testcases, arraysize(testcases));
}
-TEST(URLEliderTest, ElideTextLongStrings) {
+TEST(TextEliderTest, TestFilenameEliding) {
+ const std::wstring kEllipsisStr(kEllipsis);
+
+ WideTestcase testcases[] = {
+ {L"", L""},
+ {L".", L"."},
+ {L"filename.exe", L"filename.exe"},
+ {L".longext", L".longext"},
+ {L"pie", L"pie"},
+ {L"c:\\path\\filename.pie", L"filename.pie"},
+ {L"c:\\path\\longfilename.pie", L"long" + kEllipsisStr + L".pie"},
+ {L"http://path.com/filename.pie", L"filename.pie"},
+ {L"http://path.com/longfilename.pie", L"long" + kEllipsisStr + L".pie"},
+ {L"piesmashingtacularpants", L"pie" + kEllipsisStr},
+ {L".piesmashingtacularpants", L".pie" + kEllipsisStr},
+ {L"cheese.", L"cheese."},
+ {L"file name.longext", L"file" + kEllipsisStr + L".longext"},
+ {L"fil ename.longext", L"fil " + kEllipsisStr + L".longext"},
+ {L"filename.longext", L"file" + kEllipsisStr + L".longext"},
+ {L"filename.middleext.longext",
+ L"filename.mid" + kEllipsisStr + L".longext"}
+ };
+
+ static const ChromeFont font;
+ for (size_t i = 0; i < arraysize(testcases); ++i) {
+ const std::wstring filename(testcases[i].input);
+ EXPECT_EQ(testcases[i].output, ElideFilename(filename,
+ font,
+ font.GetStringWidth(testcases[i].output)));
+ }
+}
+
+TEST(TextEliderTest, ElideTextLongStrings) {
const std::wstring kEllipsisStr(kEllipsis);
std::wstring data_scheme(L"data:text/plain,");
@@ -163,13 +195,13 @@ TEST(URLEliderTest, ElideTextLongStrings) {
}
// Verifies display_url is set correctly.
-TEST(URLEliderTest, SortedDisplayURL) {
+TEST(TextEliderTest, SortedDisplayURL) {
gfx::SortedDisplayURL d_url(GURL("http://www.google.com/"), std::wstring());
EXPECT_EQ(L"http://www.google.com/", d_url.display_url());
}
// Verifies DisplayURL::Compare works correctly.
-TEST(URLEliderTest, SortedDisplayURLCompare) {
+TEST(TextEliderTest, SortedDisplayURLCompare) {
UErrorCode create_status = U_ZERO_ERROR;
scoped_ptr<Collator> collator(Collator::createInstance(create_status));
if (!U_SUCCESS(create_status))
diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons
index d01fd9a..df137a2 100644
--- a/chrome/test/unit/unit_tests.scons
+++ b/chrome/test/unit/unit_tests.scons
@@ -200,7 +200,7 @@ if env['PLATFORM'] == 'win32':
'$CHROME_DIR/common/chrome_plugin_unittest.cc',
'$CHROME_DIR/common/gfx/emf_unittest.cc',
'$CHROME_DIR/common/gfx/icon_util_unittest.cc',
- '$CHROME_DIR/common/gfx/url_elider_unittest.cc',
+ '$CHROME_DIR/common/gfx/text_elider_unittest.cc',
'$CHROME_DIR/common/ipc_message_unittest.cc',
'$CHROME_DIR/common/ipc_sync_channel_unittest.cc',
'$CHROME_DIR/common/ipc_sync_message_unittest.cc',
diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj
index 2c9a057..850fc8a 100644
--- a/chrome/test/unit/unittests.vcproj
+++ b/chrome/test/unit/unittests.vcproj
@@ -747,10 +747,10 @@
</File>
</Filter>
<Filter
- Name="TestURLElider"
+ Name="TestTextElider"
>
<File
- RelativePath="..\..\common\gfx\url_elider_unittest.cc"
+ RelativePath="..\..\common\gfx\text_elider_unittest.cc"
>
</File>
</Filter>
diff --git a/chrome/views/label.cc b/chrome/views/label.cc
index f543a2d..ed8de0f 100644
--- a/chrome/views/label.cc
+++ b/chrome/views/label.cc
@@ -11,7 +11,7 @@
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/gfx/insets.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/background.h"
diff --git a/chrome/views/tooltip_manager.cc b/chrome/views/tooltip_manager.cc
index 6da2245..ae842bf 100644
--- a/chrome/views/tooltip_manager.cc
+++ b/chrome/views/tooltip_manager.cc
@@ -8,7 +8,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "chrome/common/l10n_util.h"
-#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/win_util.h"
#include "chrome/views/root_view.h"
#include "chrome/views/tooltip_manager.h"