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

Side by Side Diff: chrome/browser/dom_ui/chrome_url_data_manager.cc

Issue 2855021: Revert 50761 - Move the files in resources/shared/ into resources.pak... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/dom_ui/shared_resources_data_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 5 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/singleton.h" 12 #include "base/singleton.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/thread.h" 14 #include "base/thread.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #if defined(OS_WIN) 16 #if defined(OS_WIN)
17 #include "base/win_util.h" 17 #include "base/win_util.h"
18 #endif 18 #endif
19 #include "chrome/browser/appcache/view_appcache_internals_job_factory.h" 19 #include "chrome/browser/appcache/view_appcache_internals_job_factory.h"
20 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/chrome_thread.h" 21 #include "chrome/browser/chrome_thread.h"
22 #include "chrome/browser/dom_ui/shared_resources_data_source.h"
23 #include "chrome/browser/net/chrome_url_request_context.h" 22 #include "chrome/browser/net/chrome_url_request_context.h"
24 #include "chrome/browser/net/view_http_cache_job_factory.h" 23 #include "chrome/browser/net/view_http_cache_job_factory.h"
25 #include "chrome/common/chrome_paths.h" 24 #include "chrome/common/chrome_paths.h"
26 #include "chrome/common/ref_counted_util.h" 25 #include "chrome/common/ref_counted_util.h"
27 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
28 #include "googleurl/src/url_util.h" 27 #include "googleurl/src/url_util.h"
29 #include "grit/platform_locale_settings.h" 28 #include "grit/platform_locale_settings.h"
30 #include "net/base/io_buffer.h" 29 #include "net/base/io_buffer.h"
31 #include "net/base/net_errors.h" 30 #include "net/base/net_errors.h"
32 #include "net/url_request/url_request.h" 31 #include "net/url_request/url_request.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 DISALLOW_COPY_AND_ASSIGN(URLRequestChromeFileJob); 91 DISALLOW_COPY_AND_ASSIGN(URLRequestChromeFileJob);
93 }; 92 };
94 93
95 void RegisterURLRequestChromeJob() { 94 void RegisterURLRequestChromeJob() {
96 FilePath inspector_dir; 95 FilePath inspector_dir;
97 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { 96 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) {
98 Singleton<ChromeURLDataManager>()->AddFileSource( 97 Singleton<ChromeURLDataManager>()->AddFileSource(
99 chrome::kChromeUIDevToolsHost, inspector_dir); 98 chrome::kChromeUIDevToolsHost, inspector_dir);
100 } 99 }
101 100
102 SharedResourcesDataSource::Register(); 101 // Set up the chrome://resources/ source.
102 FilePath resources_dir;
103 if (PathService::Get(chrome::DIR_SHARED_RESOURCES, &resources_dir)) {
104 Singleton<ChromeURLDataManager>()->AddFileSource(
105 chrome::kChromeUIResourcesHost, resources_dir);
106 }
107
103 URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, 108 URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme,
104 &ChromeURLDataManager::Factory); 109 &ChromeURLDataManager::Factory);
105 } 110 }
106 111
107 void UnregisterURLRequestChromeJob() { 112 void UnregisterURLRequestChromeJob() {
108 FilePath inspector_dir; 113 FilePath inspector_dir;
109 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { 114 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) {
110 Singleton<ChromeURLDataManager>()->RemoveFileSource( 115 Singleton<ChromeURLDataManager>()->RemoveFileSource(
111 chrome::kChromeUIDevToolsHost); 116 chrome::kChromeUIDevToolsHost);
112 } 117 }
118
119 FilePath resources_dir;
120 if (PathService::Get(chrome::DIR_SHARED_RESOURCES, &resources_dir)) {
121 Singleton<ChromeURLDataManager>()->RemoveFileSource(
122 chrome::kChromeUIResourcesHost);
123 }
113 } 124 }
114 125
115 // static 126 // static
116 void ChromeURLDataManager::URLToRequest(const GURL& url, 127 void ChromeURLDataManager::URLToRequest(const GURL& url,
117 std::string* source_name, 128 std::string* source_name,
118 std::string* path) { 129 std::string* path) {
119 DCHECK(url.SchemeIs(chrome::kChromeUIScheme)); 130 DCHECK(url.SchemeIs(chrome::kChromeUIScheme));
120 131
121 if (!url.is_valid()) { 132 if (!url.is_valid()) {
122 NOTREACHED(); 133 NOTREACHED();
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 net::ERR_INVALID_URL)); 413 net::ERR_INVALID_URL));
403 } 414 }
404 } 415 }
405 416
406 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, 417 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request,
407 const FilePath& path) 418 const FilePath& path)
408 : URLRequestFileJob(request, path) { 419 : URLRequestFileJob(request, path) {
409 } 420 }
410 421
411 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } 422 URLRequestChromeFileJob::~URLRequestChromeFileJob() { }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/shared_resources_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698