diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 23:19:02 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 23:19:02 +0000 |
commit | 8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f (patch) | |
tree | 0a6a1df23fc78afc64a8b8c4382792a2f7c7a06d /chrome | |
parent | 5d48cfa886921a239ef130f9e0204c324510f3c9 (diff) | |
download | chromium_src-8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f.zip chromium_src-8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f.tar.gz chromium_src-8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f.tar.bz2 |
Deprecate more old filepath functions.
These still exist on Windows due to being used by the installer,
but by moving them into the Windows-only block we prevent them
from being used in new code.
BUG=24672
Review URL: http://codereview.chromium.org/2861042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 6efd343..5b0e157 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -255,10 +255,15 @@ NavigationEntry* NavigationController::CreateNavigationEntry( entry->set_user_typed_url(url); entry->set_update_virtual_url_with_url(reverse_on_redirect); if (url.SchemeIsFile()) { + // Use the filename as the title, not the full path. + // We need to call FormatUrl() to perform URL de-escaping; + // it's a bit ugly to grab the filename out of the resulting string. std::wstring languages = UTF8ToWide(profile->GetPrefs()->GetString( prefs::kAcceptLanguages)); - entry->set_title(WideToUTF16Hack( - file_util::GetFilenameFromPath(net::FormatUrl(url, languages)))); + std::wstring formatted = net::FormatUrl(url, languages); + std::wstring filename = + FilePath::FromWStringHack(formatted).BaseName().ToWStringHack(); + entry->set_title(WideToUTF16Hack(filename)); } return entry; } |