| 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/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 extension_prefs_->GetInstalledExtensionsInfo()); | 145 extension_prefs_->GetInstalledExtensionsInfo()); |
| 146 | 146 |
| 147 std::vector<int> reload_reason_counts(NUM_MANIFEST_RELOAD_REASONS, 0); | 147 std::vector<int> reload_reason_counts(NUM_MANIFEST_RELOAD_REASONS, 0); |
| 148 bool should_write_prefs = false; | 148 bool should_write_prefs = false; |
| 149 int update_count = 0; | 149 int update_count = 0; |
| 150 | 150 |
| 151 for (size_t i = 0; i < extensions_info->size(); ++i) { | 151 for (size_t i = 0; i < extensions_info->size(); ++i) { |
| 152 ExtensionInfo* info = extensions_info->at(i).get(); | 152 ExtensionInfo* info = extensions_info->at(i).get(); |
| 153 | 153 |
| 154 scoped_ptr<ExtensionInfo> pending_update( | 154 scoped_ptr<ExtensionInfo> pending_update( |
| 155 extension_prefs_->GetIdleInstallInfo(info->extension_id)); | 155 extension_prefs_->GetDelayedInstallInfo(info->extension_id)); |
| 156 if (pending_update) { | 156 if (pending_update) { |
| 157 if (!extension_prefs_->FinishIdleInstallInfo(info->extension_id)) | 157 if (!extension_prefs_->FinishDelayedInstallInfo(info->extension_id)) |
| 158 NOTREACHED(); | 158 NOTREACHED(); |
| 159 | 159 |
| 160 Version old_version; | 160 Version old_version; |
| 161 if (info->extension_manifest) { | 161 if (info->extension_manifest) { |
| 162 std::string version_str; | 162 std::string version_str; |
| 163 if (info->extension_manifest->GetString( | 163 if (info->extension_manifest->GetString( |
| 164 extension_manifest_keys::kVersion, &version_str)) { | 164 extension_manifest_keys::kVersion, &version_str)) { |
| 165 old_version = Version(version_str); | 165 old_version = Version(version_str); |
| 166 } | 166 } |
| 167 } | 167 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 365 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
| 366 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 366 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
| 367 if (info->extension_location != Extension::LOAD) | 367 if (info->extension_location != Extension::LOAD) |
| 368 flags |= Extension::REQUIRE_KEY; | 368 flags |= Extension::REQUIRE_KEY; |
| 369 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 369 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
| 370 flags |= Extension::ALLOW_FILE_ACCESS; | 370 flags |= Extension::ALLOW_FILE_ACCESS; |
| 371 return flags; | 371 return flags; |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace extensions | 374 } // namespace extensions |
| OLD | NEW |