OLD | NEW |
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/browser/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 for (RegisteredComponentExtensions::iterator it = | 138 for (RegisteredComponentExtensions::iterator it = |
139 component_extensions_.begin(); | 139 component_extensions_.begin(); |
140 it != component_extensions_.end(); ++it) { | 140 it != component_extensions_.end(); ++it) { |
141 Load(*it); | 141 Load(*it); |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 base::DictionaryValue* ComponentLoader::ParseManifest( | 145 base::DictionaryValue* ComponentLoader::ParseManifest( |
146 const std::string& manifest_contents) const { | 146 const std::string& manifest_contents) const { |
147 JSONStringValueSerializer serializer(manifest_contents); | 147 JSONStringValueDeserializer deserializer(manifest_contents); |
148 scoped_ptr<base::Value> manifest(serializer.Deserialize(NULL, NULL)); | 148 scoped_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); |
149 | 149 |
150 if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) { | 150 if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) { |
151 LOG(ERROR) << "Failed to parse extension manifest."; | 151 LOG(ERROR) << "Failed to parse extension manifest."; |
152 return NULL; | 152 return NULL; |
153 } | 153 } |
154 // Transfer ownership to the caller. | 154 // Transfer ownership to the caller. |
155 return static_cast<base::DictionaryValue*>(manifest.release()); | 155 return static_cast<base::DictionaryValue*>(manifest.release()); |
156 } | 156 } |
157 | 157 |
158 void ComponentLoader::ClearAllRegistered() { | 158 void ComponentLoader::ClearAllRegistered() { |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 672 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
673 storage::FileSystemContext* file_system_context = | 673 storage::FileSystemContext* file_system_context = |
674 content::BrowserContext::GetStoragePartitionForSite( | 674 content::BrowserContext::GetStoragePartitionForSite( |
675 off_the_record_context, site)->GetFileSystemContext(); | 675 off_the_record_context, site)->GetFileSystemContext(); |
676 file_system_context->EnableTemporaryFileSystemInIncognito(); | 676 file_system_context->EnableTemporaryFileSystemInIncognito(); |
677 } | 677 } |
678 #endif | 678 #endif |
679 } | 679 } |
680 | 680 |
681 } // namespace extensions | 681 } // namespace extensions |
OLD | NEW |