| OLD | NEW |
| 1 // Copyright (c) 2011 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" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 info.extension_location, | 77 info.extension_location, |
| 78 *info.extension_manifest, | 78 *info.extension_manifest, |
| 79 GetCreationFlags(&info), | 79 GetCreationFlags(&info), |
| 80 &error); | 80 &error); |
| 81 } else { | 81 } else { |
| 82 error = errors::kManifestUnreadable; | 82 error = errors::kManifestUnreadable; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Once installed, non-unpacked extensions cannot change their IDs (e.g., by | 85 // Once installed, non-unpacked extensions cannot change their IDs (e.g., by |
| 86 // updating the 'key' field in their manifest). | 86 // updating the 'key' field in their manifest). |
| 87 // TODO(jstritar): migrate preferences when unpacked extensions change IDs. |
| 87 if (extension && | 88 if (extension && |
| 88 extension->location() != Extension::LOAD && | 89 extension->location() != Extension::LOAD && |
| 89 info.extension_id != extension->id()) { | 90 info.extension_id != extension->id()) { |
| 90 error = errors::kCannotChangeExtensionID; | 91 error = errors::kCannotChangeExtensionID; |
| 91 extension = NULL; | 92 extension = NULL; |
| 92 content::RecordAction(UserMetricsAction("Extensions.IDChangedError")); | 93 content::RecordAction(UserMetricsAction("Extensions.IDChangedError")); |
| 93 } | 94 } |
| 94 | 95 |
| 95 if (!extension) { | 96 if (!extension) { |
| 96 extension_service_-> | 97 extension_service_-> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 278 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
| 278 flags |= Extension::ALLOW_FILE_ACCESS; | 279 flags |= Extension::ALLOW_FILE_ACCESS; |
| 279 if (extension_prefs_->IsFromWebStore(info->extension_id)) | 280 if (extension_prefs_->IsFromWebStore(info->extension_id)) |
| 280 flags |= Extension::FROM_WEBSTORE; | 281 flags |= Extension::FROM_WEBSTORE; |
| 281 if (extension_prefs_->IsFromBookmark(info->extension_id)) | 282 if (extension_prefs_->IsFromBookmark(info->extension_id)) |
| 282 flags |= Extension::FROM_BOOKMARK; | 283 flags |= Extension::FROM_BOOKMARK; |
| 283 return flags; | 284 return flags; |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace extensions | 287 } // namespace extensions |
| OLD | NEW |