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

Unified Diff: chrome/browser/ui/webui/chrome_url_data_manager_backend.cc

Issue 6708093: Load devtools files from resources.pak rather than from disk take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: grd change to force rules to run Created 9 years, 9 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
« no previous file with comments | « chrome/browser/resources/component_extension_resources.grd ('k') | chrome/browser/ui/webui/devtools_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
index f9e1de27d40f4a67e334e79be295de7eab8b675f..cac96dc8abb3574bccd149394460867b9fca604c 100644
--- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
+++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
+#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/file_util.h"
#include "base/message_loop.h"
@@ -15,6 +16,7 @@
#include "chrome/browser/net/view_http_cache_job_factory.h"
#include "chrome/browser/ui/webui/shared_resources_data_source.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "content/browser/appcache/view_appcache_internals_job_factory.h"
#include "content/browser/browser_thread.h"
@@ -253,10 +255,13 @@ void ChromeURLDataManagerBackend::DataAvailable(RequestID request_id,
net::URLRequestJob* ChromeURLDataManagerBackend::Factory(
net::URLRequest* request,
const std::string& scheme) {
- // Try first with a file handler
- FilePath path;
- if (DevToolsJobFactory::IsSupportedURL(request->url(), &path))
- return DevToolsJobFactory::CreateJobForRequest(request, path);
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugDevTools)) {
+ // Try loading chrome-devtools:// files from disk.
+ FilePath path;
+ if (DevToolsJobFactory::IsSupportedURL(request->url(), &path))
+ return DevToolsJobFactory::CreateJobForRequest(request, path);
+ }
// Next check for chrome://view-http-cache/*, which uses its own job type.
if (ViewHttpCacheJobFactory::IsSupportedURL(request->url()))
« no previous file with comments | « chrome/browser/resources/component_extension_resources.grd ('k') | chrome/browser/ui/webui/devtools_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698