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

Side by Side Diff: chrome/common/extensions/features/simple_feature.cc

Issue 13604005: Prevent chrome.app JSON schema from loading on every page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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/common/extensions/features/simple_feature.h" 5 #include "chrome/common/extensions/features/simple_feature.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 void ParseURLPatterns(const DictionaryValue* value, 138 void ParseURLPatterns(const DictionaryValue* value,
139 const std::string& key, 139 const std::string& key,
140 URLPatternSet* set) { 140 URLPatternSet* set) {
141 const ListValue* matches = NULL; 141 const ListValue* matches = NULL;
142 if (value->GetList(key, &matches)) { 142 if (value->GetList(key, &matches)) {
143 for (size_t i = 0; i < matches->GetSize(); ++i) { 143 for (size_t i = 0; i < matches->GetSize(); ++i) {
144 std::string pattern; 144 std::string pattern;
145 CHECK(matches->GetString(i, &pattern)); 145 CHECK(matches->GetString(i, &pattern));
146 set->AddPattern(URLPattern(URLPattern::SCHEME_ALL, pattern)); 146 set->AddPattern(
147 URLPattern(UserScript::ValidUserScriptSchemes(), pattern));
147 } 148 }
148 } 149 }
149 } 150 }
150 151
151 // Gets a human-readable name for the given extension type. 152 // Gets a human-readable name for the given extension type.
152 std::string GetDisplayTypeName(Manifest::Type type) { 153 std::string GetDisplayTypeName(Manifest::Type type) {
153 switch (type) { 154 switch (type) {
154 case Manifest::TYPE_UNKNOWN: 155 case Manifest::TYPE_UNKNOWN:
155 return "unknown"; 156 return "unknown";
156 case Manifest::TYPE_EXTENSION: 157 case Manifest::TYPE_EXTENSION:
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 DCHECK(id_hash.length() == base::kSHA1Length); 438 DCHECK(id_hash.length() == base::kSHA1Length);
438 const std::string hexencoded_id_hash = base::HexEncode(id_hash.c_str(), 439 const std::string hexencoded_id_hash = base::HexEncode(id_hash.c_str(),
439 id_hash.length()); 440 id_hash.length());
440 if (whitelist_.find(hexencoded_id_hash) != whitelist_.end()) 441 if (whitelist_.find(hexencoded_id_hash) != whitelist_.end())
441 return true; 442 return true;
442 443
443 return false; 444 return false;
444 } 445 }
445 446
446 } // namespace extensions 447 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698