| Index: content/browser/tab_contents/navigation_entry.cc
|
| diff --git a/content/browser/tab_contents/navigation_entry.cc b/content/browser/tab_contents/navigation_entry.cc
|
| index ec35a9f12325e2d990d939f97232ea0f2face00a..535f46314957e4bb483059a92c0d2893af3c1cb8 100644
|
| --- a/content/browser/tab_contents/navigation_entry.cc
|
| +++ b/content/browser/tab_contents/navigation_entry.cc
|
| @@ -94,6 +94,14 @@ const string16& NavigationEntry::GetTitleForDisplay(
|
| } else if (!url_.is_empty()) {
|
| title = net::FormatUrl(url_, languages);
|
| }
|
| +
|
| + // For file:// URLs use the filename as the title, not the full path.
|
| + if (url_.SchemeIsFile()) {
|
| + string16::size_type slashpos = title.rfind('/');
|
| + if (slashpos != string16::npos)
|
| + title = title.substr(slashpos + 1);
|
| + }
|
| +
|
| ui::ElideString(title, chrome::kMaxTitleChars, &cached_display_title_);
|
| return cached_display_title_;
|
| }
|
|
|