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

Side by Side Diff: chrome/browser/extensions/user_script_master.cc

Issue 63011: Monster FilePath patch! (Closed)
Patch Set: sync with trunk Created 11 years, 8 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
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/history/redirect_uitest.cc » ('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) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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/extensions/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 file_util::FileEnumerator enumerator(script_dir, false, 149 file_util::FileEnumerator enumerator(script_dir, false,
150 file_util::FileEnumerator::FILES, 150 file_util::FileEnumerator::FILES,
151 FILE_PATH_LITERAL("*.user.js")); 151 FILE_PATH_LITERAL("*.user.js"));
152 for (FilePath file = enumerator.Next(); !file.value().empty(); 152 for (FilePath file = enumerator.Next(); !file.value().empty();
153 file = enumerator.Next()) { 153 file = enumerator.Next()) {
154 result->push_back(UserScript()); 154 result->push_back(UserScript());
155 UserScript& user_script = result->back(); 155 UserScript& user_script = result->back();
156 // Push single js file in this UserScript. 156 // Push single js file in this UserScript.
157 GURL url(std::string(chrome::kUserScriptScheme) + ":/" + 157 GURL url(std::string(chrome::kUserScriptScheme) + ":/" +
158 net::FilePathToFileURL(file.ToWStringHack()).ExtractFileName()); 158 net::FilePathToFileURL(file).ExtractFileName());
159 user_script.js_scripts().push_back(UserScript::File(file, url)); 159 user_script.js_scripts().push_back(UserScript::File(file, url));
160 UserScript::File& script_file = user_script.js_scripts().back(); 160 UserScript::File& script_file = user_script.js_scripts().back();
161 LoadScriptContent(&script_file); 161 LoadScriptContent(&script_file);
162 ParseMetadataHeader(script_file.GetContent(), &user_script); 162 ParseMetadataHeader(script_file.GetContent(), &user_script);
163 } 163 }
164 } 164 }
165 } 165 }
166 166
167 static void LoadLoneScripts(UserScriptList* lone_scripts) { 167 static void LoadLoneScripts(UserScriptList* lone_scripts) {
168 for (size_t i = 0; i < lone_scripts->size(); ++i) { 168 for (size_t i = 0; i < lone_scripts->size(); ++i) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 StartScan(); 309 StartScan();
310 } 310 }
311 311
312 void UserScriptMaster::StartScan() { 312 void UserScriptMaster::StartScan() {
313 if (!script_reloader_) 313 if (!script_reloader_)
314 script_reloader_ = new ScriptReloader(this); 314 script_reloader_ = new ScriptReloader(this);
315 315
316 script_reloader_->StartScan(worker_loop_, user_script_dir_, lone_scripts_); 316 script_reloader_->StartScan(worker_loop_, user_script_dir_, lone_scripts_);
317 } 317 }
OLDNEW
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/history/redirect_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698