| OLD | NEW |
| 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 // The path component is not used for host permissions, so we force it to | 1098 // The path component is not used for host permissions, so we force it to |
| 1099 // match all paths. | 1099 // match all paths. |
| 1100 pattern.set_path("/*"); | 1100 pattern.set_path("/*"); |
| 1101 | 1101 |
| 1102 host_permissions_.push_back(pattern); | 1102 host_permissions_.push_back(pattern); |
| 1103 } | 1103 } |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 if (source.HasKey(keys::kDefaultLocale)) { |
| 1107 if (!source.GetString(keys::kDefaultLocale, &default_locale_) || |
| 1108 default_locale_.empty()) { |
| 1109 *error = errors::kInvalidDefaultLocale; |
| 1110 return false; |
| 1111 } |
| 1112 } |
| 1113 |
| 1106 // Chrome URL overrides (optional) | 1114 // Chrome URL overrides (optional) |
| 1107 if (source.HasKey(keys::kChromeURLOverrides)) { | 1115 if (source.HasKey(keys::kChromeURLOverrides)) { |
| 1108 DictionaryValue* overrides; | 1116 DictionaryValue* overrides; |
| 1109 if (!source.GetDictionary(keys::kChromeURLOverrides, &overrides)) { | 1117 if (!source.GetDictionary(keys::kChromeURLOverrides, &overrides)) { |
| 1110 *error = errors::kInvalidChromeURLOverrides; | 1118 *error = errors::kInvalidChromeURLOverrides; |
| 1111 return false; | 1119 return false; |
| 1112 } | 1120 } |
| 1113 | 1121 |
| 1114 // Validate that the overrides are all strings | 1122 // Validate that the overrides are all strings |
| 1115 DictionaryValue::key_iterator iter = overrides->begin_keys(); | 1123 DictionaryValue::key_iterator iter = overrides->begin_keys(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 UserScript::PatternList::const_iterator pattern = | 1253 UserScript::PatternList::const_iterator pattern = |
| 1246 content_script->url_patterns().begin(); | 1254 content_script->url_patterns().begin(); |
| 1247 for (; pattern != content_script->url_patterns().end(); ++pattern) { | 1255 for (; pattern != content_script->url_patterns().end(); ++pattern) { |
| 1248 if (pattern->match_subdomains() && pattern->host().empty()) | 1256 if (pattern->match_subdomains() && pattern->host().empty()) |
| 1249 return true; | 1257 return true; |
| 1250 } | 1258 } |
| 1251 } | 1259 } |
| 1252 | 1260 |
| 1253 return false; | 1261 return false; |
| 1254 } | 1262 } |
| OLD | NEW |