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

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

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate original pickle order; add scripts clause to content_script_chrome_url_invalid.json to av… Created 7 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 unified diff | Download patch | Annotate | Revision Log
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/browser/extensions/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 script->set_name_space(value); 110 script->set_name_space(value);
111 } else if (GetDeclarationValue(line, kNameDeclaration, &value)) { 111 } else if (GetDeclarationValue(line, kNameDeclaration, &value)) {
112 script->set_name(value); 112 script->set_name(value);
113 } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) { 113 } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) {
114 Version version(value); 114 Version version(value);
115 if (version.IsValid()) 115 if (version.IsValid())
116 script->set_version(version.GetString()); 116 script->set_version(version.GetString());
117 } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) { 117 } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) {
118 script->set_description(value); 118 script->set_description(value);
119 } else if (GetDeclarationValue(line, kMatchDeclaration, &value)) { 119 } else if (GetDeclarationValue(line, kMatchDeclaration, &value)) {
120 URLPattern pattern(UserScript::kValidUserScriptSchemes); 120 URLPattern pattern(UserScript::ValidUserScriptSchemes());
121 if (URLPattern::PARSE_SUCCESS != pattern.Parse(value)) 121 if (URLPattern::PARSE_SUCCESS != pattern.Parse(value))
122 return false; 122 return false;
123 script->add_url_pattern(pattern); 123 script->add_url_pattern(pattern);
124 } else if (GetDeclarationValue(line, kExcludeMatchDeclaration, &value)) { 124 } else if (GetDeclarationValue(line, kExcludeMatchDeclaration, &value)) {
125 URLPattern exclude(UserScript::kValidUserScriptSchemes); 125 URLPattern exclude(UserScript::ValidUserScriptSchemes());
126 if (URLPattern::PARSE_SUCCESS != exclude.Parse(value)) 126 if (URLPattern::PARSE_SUCCESS != exclude.Parse(value))
127 return false; 127 return false;
128 script->add_exclude_url_pattern(exclude); 128 script->add_exclude_url_pattern(exclude);
129 } else if (GetDeclarationValue(line, kRunAtDeclaration, &value)) { 129 } else if (GetDeclarationValue(line, kRunAtDeclaration, &value)) {
130 if (value == kRunAtDocumentStartValue) 130 if (value == kRunAtDocumentStartValue)
131 script->set_run_location(UserScript::DOCUMENT_START); 131 script->set_run_location(UserScript::DOCUMENT_START);
132 else if (value == kRunAtDocumentEndValue) 132 else if (value == kRunAtDocumentEndValue)
133 script->set_run_location(UserScript::DOCUMENT_END); 133 script->set_run_location(UserScript::DOCUMENT_END);
134 else if (value == kRunAtDocumentIdleValue) 134 else if (value == kRunAtDocumentIdleValue)
135 script->set_run_location(UserScript::DOCUMENT_IDLE); 135 script->set_run_location(UserScript::DOCUMENT_IDLE);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 434
435 base::SharedMemoryHandle handle_for_process; 435 base::SharedMemoryHandle handle_for_process;
436 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 436 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
437 return; // This can legitimately fail if the renderer asserts at startup. 437 return; // This can legitimately fail if the renderer asserts at startup.
438 438
439 if (base::SharedMemory::IsHandleValid(handle_for_process)) 439 if (base::SharedMemory::IsHandleValid(handle_for_process))
440 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); 440 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process));
441 } 441 }
442 442
443 } // namespace extensions 443 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/ui/startup/bad_flags_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698