Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: chrome/browser/extensions/extension_protocols.cc

Issue 256022: Loads local resources from current locale subtree if available, if not it fal... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_protocols.cc
===================================================================
--- chrome/browser/extensions/extension_protocols.cc (revision 28272)
+++ chrome/browser/extensions/extension_protocols.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/string_util.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/url_constants.h"
#include "googleurl/src/url_util.h"
#include "net/base/net_util.h"
@@ -26,10 +27,10 @@
return NULL;
}
- std::string resource = request->url().path();
- FilePath path = Extension::GetResourcePath(directory_path, resource);
+ ExtensionResource resource =
+ Extension::GetResource(directory_path, request->url().path());
- return new URLRequestFileJob(request, path);
+ return new URLRequestFileJob(request, resource.GetFilePath());
}
// Factory registered with URLRequest to create URLRequestJobs for
@@ -41,10 +42,11 @@
// chrome-user-script:/user-script-name.user.js
FilePath directory_path = context->user_script_dir_path();
- std::string resource = request->url().path();
- FilePath path = Extension::GetResourcePath(directory_path, resource);
- return new URLRequestFileJob(request, path);
+ ExtensionResource resource =
+ Extension::GetResource(directory_path, request->url().path());
+
+ return new URLRequestFileJob(request, resource.GetFilePath());
}
void RegisterExtensionProtocols() {
« no previous file with comments | « chrome/browser/extensions/extension_l10n_util_unittest.cc ('k') | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698