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

Side by Side Diff: chrome/renderer/extensions/user_script_slave.cc

Issue 15950011: content: Move kViewSourceScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « chrome/browser/ui/singleton_tabs.cc ('k') | chrome_frame/chrome_active_document.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/extensions/user_script_slave.h" 5 #include "chrome/renderer/extensions/user_script_slave.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 return GURL(data_source->request().url()); 257 return GURL(data_source->request().url());
258 } 258 }
259 259
260 void UserScriptSlave::InjectScripts(WebFrame* frame, 260 void UserScriptSlave::InjectScripts(WebFrame* frame,
261 UserScript::RunLocation location) { 261 UserScript::RunLocation location) {
262 GURL data_source_url = GetDataSourceURLForFrame(frame); 262 GURL data_source_url = GetDataSourceURLForFrame(frame);
263 if (data_source_url.is_empty()) 263 if (data_source_url.is_empty())
264 return; 264 return;
265 265
266 if (frame->isViewSourceModeEnabled()) 266 if (frame->isViewSourceModeEnabled())
267 data_source_url = GURL(chrome::kViewSourceScheme + std::string(":") + 267 data_source_url = GURL(content::kViewSourceScheme + std::string(":") +
268 data_source_url.spec()); 268 data_source_url.spec());
269 269
270 PerfTimer timer; 270 PerfTimer timer;
271 int num_css = 0; 271 int num_css = 0;
272 int num_scripts = 0; 272 int num_scripts = 0;
273 273
274 ExecutingScriptsMap extensions_executing_scripts; 274 ExecutingScriptsMap extensions_executing_scripts;
275 275
276 for (size_t i = 0; i < scripts_.size(); ++i) { 276 for (size_t i = 0; i < scripts_.size(); ++i) {
277 std::vector<WebScriptSource> sources; 277 std::vector<WebScriptSource> sources;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } else if (location == UserScript::DOCUMENT_IDLE) { 379 } else if (location == UserScript::DOCUMENT_IDLE) {
380 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); 380 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts);
381 if (num_scripts) 381 if (num_scripts)
382 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); 382 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed());
383 } else { 383 } else {
384 NOTREACHED(); 384 NOTREACHED();
385 } 385 }
386 } 386 }
387 387
388 } // namespace extensions 388 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/singleton_tabs.cc ('k') | chrome_frame/chrome_active_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698