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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 526012: Merge 32345 - Parse messages.json in ExtensionUnpacker (like we do for manife... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 10 years, 11 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/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 } 1151 }
1152 1152
1153 // The path component is not used for host permissions, so we force it to 1153 // The path component is not used for host permissions, so we force it to
1154 // match all paths. 1154 // match all paths.
1155 pattern.set_path("/*"); 1155 pattern.set_path("/*");
1156 1156
1157 host_permissions_.push_back(pattern); 1157 host_permissions_.push_back(pattern);
1158 } 1158 }
1159 } 1159 }
1160 1160
1161 if (source.HasKey(keys::kDefaultLocale)) {
1162 if (!source.GetString(keys::kDefaultLocale, &default_locale_) ||
1163 default_locale_.empty()) {
1164 *error = errors::kInvalidDefaultLocale;
1165 return false;
1166 }
1167 }
1168
1161 // Chrome URL overrides (optional) 1169 // Chrome URL overrides (optional)
1162 if (source.HasKey(keys::kChromeURLOverrides)) { 1170 if (source.HasKey(keys::kChromeURLOverrides)) {
1163 DictionaryValue* overrides; 1171 DictionaryValue* overrides;
1164 if (!source.GetDictionary(keys::kChromeURLOverrides, &overrides)) { 1172 if (!source.GetDictionary(keys::kChromeURLOverrides, &overrides)) {
1165 *error = errors::kInvalidChromeURLOverrides; 1173 *error = errors::kInvalidChromeURLOverrides;
1166 return false; 1174 return false;
1167 } 1175 }
1168 1176
1169 // Validate that the overrides are all strings 1177 // Validate that the overrides are all strings
1170 DictionaryValue::key_iterator iter = overrides->begin_keys(); 1178 DictionaryValue::key_iterator iter = overrides->begin_keys();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 UserScript::PatternList::const_iterator pattern = 1308 UserScript::PatternList::const_iterator pattern =
1301 content_script->url_patterns().begin(); 1309 content_script->url_patterns().begin();
1302 for (; pattern != content_script->url_patterns().end(); ++pattern) { 1310 for (; pattern != content_script->url_patterns().end(); ++pattern) {
1303 if (pattern->match_subdomains() && pattern->host().empty()) 1311 if (pattern->match_subdomains() && pattern->host().empty())
1304 return true; 1312 return true;
1305 } 1313 }
1306 } 1314 }
1307 1315
1308 return false; 1316 return false;
1309 } 1317 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698