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

Side by Side Diff: chrome/common/extensions/api/extension_api.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
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/common/extensions/extension.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/common/extensions/api/extension_api.h" 5 #include "chrome/common/extensions/api/extension_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 // Populate |url_matching_apis_|. 266 // Populate |url_matching_apis_|.
267 ListValue* matches = NULL; 267 ListValue* matches = NULL;
268 if (schema->GetList("matches", &matches)) { 268 if (schema->GetList("matches", &matches)) {
269 URLPatternSet pattern_set; 269 URLPatternSet pattern_set;
270 for (size_t i = 0; i < matches->GetSize(); ++i) { 270 for (size_t i = 0; i < matches->GetSize(); ++i) {
271 std::string pattern; 271 std::string pattern;
272 CHECK(matches->GetString(i, &pattern)); 272 CHECK(matches->GetString(i, &pattern));
273 pattern_set.AddPattern( 273 pattern_set.AddPattern(
274 URLPattern(UserScript::kValidUserScriptSchemes, pattern)); 274 URLPattern(UserScript::ValidUserScriptSchemes(), pattern));
275 } 275 }
276 url_matching_apis_[schema_namespace] = pattern_set; 276 url_matching_apis_[schema_namespace] = pattern_set;
277 } 277 }
278 278
279 // Populate feature maps. 279 // Populate feature maps.
280 // TODO(aa): Consider not storing features that can never run on the current 280 // TODO(aa): Consider not storing features that can never run on the current
281 // machine (e.g., because of platform restrictions). 281 // machine (e.g., because of platform restrictions).
282 bool uses_feature_system = false; 282 bool uses_feature_system = false;
283 schema->GetBoolean("uses_feature_system", &uses_feature_system); 283 schema->GetBoolean("uses_feature_system", &uses_feature_system);
284 if (!uses_feature_system) 284 if (!uses_feature_system)
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 787
788 void ExtensionAPI::LoadAllSchemas() { 788 void ExtensionAPI::LoadAllSchemas() {
789 while (unloaded_schemas_.size()) { 789 while (unloaded_schemas_.size()) {
790 std::map<std::string, base::StringPiece>::iterator it = 790 std::map<std::string, base::StringPiece>::iterator it =
791 unloaded_schemas_.begin(); 791 unloaded_schemas_.begin();
792 LoadSchema(it->first, it->second); 792 LoadSchema(it->first, it->second);
793 } 793 }
794 } 794 }
795 795
796 } // namespace extensions 796 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698