summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 00:01:05 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 00:01:05 +0000
commit8a5bef943be8ec1654bcbb952b5b67c818f8900e (patch)
tree19e3fbe8dfad5807166990d8848a04204d44655a /chrome/browser/extensions
parent7acb2fab4276e34fe442971243064758bcecb162 (diff)
downloadchromium_src-8a5bef943be8ec1654bcbb952b5b67c818f8900e.zip
chromium_src-8a5bef943be8ec1654bcbb952b5b67c818f8900e.tar.gz
chromium_src-8a5bef943be8ec1654bcbb952b5b67c818f8900e.tar.bz2
Cleanup the file path normalization extension_protocol.
I had hackily put in forward slashes, but now that there's a normalization method for filepath, I'm using it. Review URL: http://codereview.chromium.org/2833032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension_protocols.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 83ef404..8422a58 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -98,10 +98,7 @@ static URLRequestJob* CreateExtensionURLRequestJob(URLRequest* request,
FilePath relative_path = directory_path.BaseName().Append(
extension_file_util::ExtensionURLToRelativeFilePath(request->url()));
#if defined(OS_WIN)
- // TODO(tc): This is a hack, we should normalize paths another way.
- FilePath::StringType path = relative_path.value();
- std::replace(path.begin(), path.end(), '\\', '/');
- relative_path = FilePath(path);
+ relative_path = relative_path.NormalizeWindowsPathSeparators();
#endif
// TODO(tc): Make a map of FilePath -> resource ids so we don't have to
@@ -110,6 +107,9 @@ static URLRequestJob* CreateExtensionURLRequestJob(URLRequest* request,
for (size_t i = 0; i < kBookmarkManagerResourcesSize; ++i) {
FilePath bm_resource_path =
FilePath().AppendASCII(kBookmarkManagerResources[i].name);
+#if defined(OS_WIN)
+ bm_resource_path = bm_resource_path.NormalizeWindowsPathSeparators();
+#endif
if (relative_path == bm_resource_path) {
return new URLRequestResourceBundleJob(request, relative_path,
kBookmarkManagerResources[i].value);