Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2384 !LoadPageAction(error) || | 2384 !LoadPageAction(error) || |
| 2385 !LoadSystemIndicator(api_permissions, error) || | 2385 !LoadSystemIndicator(api_permissions, error) || |
| 2386 !LoadIncognitoMode(error) || | 2386 !LoadIncognitoMode(error) || |
| 2387 !LoadContentSecurityPolicy(error)) | 2387 !LoadContentSecurityPolicy(error)) |
| 2388 return false; | 2388 return false; |
| 2389 | 2389 |
| 2390 return true; | 2390 return true; |
| 2391 } | 2391 } |
| 2392 | 2392 |
| 2393 bool Extension::LoadManifestHandlerFeatures(string16* error) { | 2393 bool Extension::LoadManifestHandlerFeatures(string16* error) { |
| 2394 std::vector<std::string> keys = ManifestHandler::GetKeys(); | 2394 std::set<ManifestHandler*> handlers = |
| 2395 for (size_t i = 0; i < keys.size(); ++i) { | 2395 ManifestHandler::GetHandlers(manifest()); |
|
Matt Perry
2013/01/29 00:58:47
Rather than returning a temporary set that the cal
Yoyo Zhou
2013/01/29 04:32:42
Sure.
| |
| 2396 Value* value = NULL; | 2396 for (std::set<ManifestHandler*>::iterator it = handlers.begin(); |
| 2397 if (!manifest_->Get(keys[i], &value)) { | 2397 it != handlers.end(); ++it) { |
| 2398 if (!ManifestHandler::Get(keys[i])->HasNoKey(this, error)) | 2398 if (!(*it)->Parse(this, error)) |
| 2399 return false; | |
| 2400 } else if (!ManifestHandler::Get(keys[i])->Parse(value, this, error)) { | |
| 2401 return false; | 2399 return false; |
| 2402 } | |
| 2403 } | 2400 } |
| 2404 return true; | 2401 return true; |
| 2405 } | 2402 } |
| 2406 | 2403 |
| 2407 bool Extension::LoadContentScripts(string16* error) { | 2404 bool Extension::LoadContentScripts(string16* error) { |
| 2408 if (!manifest_->HasKey(keys::kContentScripts)) | 2405 if (!manifest_->HasKey(keys::kContentScripts)) |
| 2409 return true; | 2406 return true; |
| 2410 ListValue* list_value; | 2407 ListValue* list_value; |
| 2411 if (!manifest_->GetList(keys::kContentScripts, &list_value)) { | 2408 if (!manifest_->GetList(keys::kContentScripts, &list_value)) { |
| 2412 *error = ASCIIToUTF16(errors::kInvalidContentScriptsList); | 2409 *error = ASCIIToUTF16(errors::kInvalidContentScriptsList); |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3142 | 3139 |
| 3143 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3140 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3144 const Extension* extension, | 3141 const Extension* extension, |
| 3145 const PermissionSet* permissions, | 3142 const PermissionSet* permissions, |
| 3146 Reason reason) | 3143 Reason reason) |
| 3147 : reason(reason), | 3144 : reason(reason), |
| 3148 extension(extension), | 3145 extension(extension), |
| 3149 permissions(permissions) {} | 3146 permissions(permissions) {} |
| 3150 | 3147 |
| 3151 } // namespace extensions | 3148 } // namespace extensions |
| OLD | NEW |