summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-01 23:36:17 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-01 23:36:17 +0000
commit8654b68fc30d155e907b842cf82e47cb2b550081 (patch)
treef6cc9f7502abf6e3428128bfee85cd7c15d87082 /chrome
parent1e65ff4bdcc0ed16eed329bd3590c6b592dec391 (diff)
downloadchromium_src-8654b68fc30d155e907b842cf82e47cb2b550081.zip
chromium_src-8654b68fc30d155e907b842cf82e47cb2b550081.tar.gz
chromium_src-8654b68fc30d155e907b842cf82e47cb2b550081.tar.bz2
Rollback r4382 because I'm daft (submitted the wrong thing)
TBR=ben git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/navigation_controller.cc4
-rw-r--r--chrome/browser/navigation_entry.cc10
-rw-r--r--chrome/browser/navigation_entry.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/navigation_controller.cc b/chrome/browser/navigation_controller.cc
index 51beace..77d5269 100644
--- a/chrome/browser/navigation_controller.cc
+++ b/chrome/browser/navigation_controller.cc
@@ -491,6 +491,10 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
std::wstring(), transition);
entry->set_display_url(url);
entry->set_user_typed_url(url);
+ if (url.SchemeIsFile()) {
+ entry->set_title(file_util::GetFilenameFromPath(UTF8ToWide(url.host() +
+ url.path())));
+ }
return entry;
}
diff --git a/chrome/browser/navigation_entry.cc b/chrome/browser/navigation_entry.cc
index 18992d6..f7ed6c6 100644
--- a/chrome/browser/navigation_entry.cc
+++ b/chrome/browser/navigation_entry.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/navigation_entry.h"
#include "chrome/common/resource_bundle.h"
-#include "net/base/escape.h"
// Use this to get a new unique ID for a NavigationEntry during construction.
// The returned ID is guaranteed to be nonzero (which is the "no ID" indicator).
@@ -59,12 +58,7 @@ NavigationEntry::NavigationEntry(TabContentsType type,
}
const std::wstring& NavigationEntry::GetTitleForDisplay() {
- if (title_.empty()) {
- std::string filename = url_.ExtractFileName();
- title_ = UTF8ToWide(filename.empty() ?
- url_.spec() :
- UnescapeURLComponent(filename, UnescapeRule::SPACES |
- UnescapeRule::URL_SPECIAL_CHARS));
- }
+ if (title_.empty())
+ return url_as_string_;
return title_;
} \ No newline at end of file
diff --git a/chrome/browser/navigation_entry.h b/chrome/browser/navigation_entry.h
index 4b21f9f..f5ab7f6 100644
--- a/chrome/browser/navigation_entry.h
+++ b/chrome/browser/navigation_entry.h
@@ -220,6 +220,7 @@ class NavigationEntry {
// the user.
void set_url(const GURL& url) {
url_ = url;
+ url_as_string_ = UTF8ToWide(url_.spec());
}
const GURL& url() const {
return url_;
@@ -372,6 +373,7 @@ class NavigationEntry {
GURL url_;
GURL referrer_;
+ std::wstring url_as_string_;
GURL display_url_;
std::wstring title_;
FaviconStatus favicon_;