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/installed_loader.h" | 5 #include "chrome/browser/extensions/installed_loader.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 base::ThreadRestrictions::ScopedAllowIO allow_io; | 135 base::ThreadRestrictions::ScopedAllowIO allow_io; |
136 | 136 |
137 std::string error; | 137 std::string error; |
138 scoped_refptr<const Extension> extension( | 138 scoped_refptr<const Extension> extension( |
139 extension_file_util::LoadExtension( | 139 extension_file_util::LoadExtension( |
140 info->extension_path, | 140 info->extension_path, |
141 info->extension_location, | 141 info->extension_location, |
142 GetCreationFlags(info), | 142 GetCreationFlags(info), |
143 &error)); | 143 &error)); |
144 | 144 |
145 if (extension.get()) { | 145 if (!extension.get()) { |
146 extensions_info->at(i)->extension_manifest.reset( | 146 extension_service_-> |
147 static_cast<DictionaryValue*>( | 147 ReportExtensionLoadError(info->extension_path, error, false); |
148 extension->manifest()->value()->DeepCopy())); | 148 continue; |
149 should_write_prefs = true; | |
150 } | 149 } |
| 150 |
| 151 extensions_info->at(i)->extension_manifest.reset( |
| 152 static_cast<DictionaryValue*>( |
| 153 extension->manifest()->value()->DeepCopy())); |
| 154 should_write_prefs = true; |
151 } | 155 } |
152 } | 156 } |
153 | 157 |
154 for (size_t i = 0; i < extensions_info->size(); ++i) { | 158 for (size_t i = 0; i < extensions_info->size(); ++i) { |
155 Load(*extensions_info->at(i), should_write_prefs); | 159 Load(*extensions_info->at(i), should_write_prefs); |
156 } | 160 } |
157 | 161 |
158 extension_service_->OnLoadedInstalledExtensions(); | 162 extension_service_->OnLoadedInstalledExtensions(); |
159 | 163 |
160 // The histograms Extensions.ManifestReload* allow us to validate | 164 // The histograms Extensions.ManifestReload* allow us to validate |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 295 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
292 flags |= Extension::ALLOW_FILE_ACCESS; | 296 flags |= Extension::ALLOW_FILE_ACCESS; |
293 if (extension_prefs_->IsFromWebStore(info->extension_id)) | 297 if (extension_prefs_->IsFromWebStore(info->extension_id)) |
294 flags |= Extension::FROM_WEBSTORE; | 298 flags |= Extension::FROM_WEBSTORE; |
295 if (extension_prefs_->IsFromBookmark(info->extension_id)) | 299 if (extension_prefs_->IsFromBookmark(info->extension_id)) |
296 flags |= Extension::FROM_BOOKMARK; | 300 flags |= Extension::FROM_BOOKMARK; |
297 return flags; | 301 return flags; |
298 } | 302 } |
299 | 303 |
300 } // namespace extensions | 304 } // namespace extensions |
OLD | NEW |