| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chrome_content_verifier_delegate.h" | 5 #include "chrome/browser/extensions/chrome_content_verifier_delegate.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 if (!extension.is_extension() && !extension.is_legacy_packaged_app()) | 119 if (!extension.is_extension() && !extension.is_legacy_packaged_app()) |
| 120 return ContentVerifierDelegate::NONE; | 120 return ContentVerifierDelegate::NONE; |
| 121 if (!Manifest::IsAutoUpdateableLocation(extension.location())) | 121 if (!Manifest::IsAutoUpdateableLocation(extension.location())) |
| 122 return ContentVerifierDelegate::NONE; | 122 return ContentVerifierDelegate::NONE; |
| 123 | 123 |
| 124 if (!ManifestURL::UpdatesFromGallery(&extension)) { | 124 if (!ManifestURL::UpdatesFromGallery(&extension)) { |
| 125 // It's possible that the webstore update url was overridden for testing | 125 // It's possible that the webstore update url was overridden for testing |
| 126 // so also consider extensions with the default (production) update url | 126 // so also consider extensions with the default (production) update url |
| 127 // to be from the store as well. | 127 // to be from the store as well. |
| 128 GURL default_webstore_url = extension_urls::GetDefaultWebstoreUpdateUrl(); | 128 if (ManifestURL::GetUpdateURL(&extension) != |
| 129 if (ManifestURL::GetUpdateURL(&extension) != default_webstore_url) | 129 extension_urls::GetDefaultWebstoreUpdateUrl()) { |
| 130 return ContentVerifierDelegate::NONE; | 130 return ContentVerifierDelegate::NONE; |
| 131 } |
| 131 } | 132 } |
| 132 | 133 |
| 133 return default_mode_; | 134 return default_mode_; |
| 134 } | 135 } |
| 135 | 136 |
| 136 ContentVerifierKey ChromeContentVerifierDelegate::GetPublicKey() { | 137 ContentVerifierKey ChromeContentVerifierDelegate::GetPublicKey() { |
| 137 return ContentVerifierKey(kWebstoreSignaturesPublicKey, | 138 return ContentVerifierKey(kWebstoreSignaturesPublicKey, |
| 138 kWebstoreSignaturesPublicKeySize); | 139 kWebstoreSignaturesPublicKeySize); |
| 139 } | 140 } |
| 140 | 141 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 UMA_HISTOGRAM_ENUMERATION("Extensions.CorruptExtensionDisabledReason", | 200 UMA_HISTOGRAM_ENUMERATION("Extensions.CorruptExtensionDisabledReason", |
| 200 reason, ContentVerifyJob::FAILURE_REASON_MAX); | 201 reason, ContentVerifyJob::FAILURE_REASON_MAX); |
| 201 } else if (!base::ContainsKey(would_be_disabled_ids_, extension_id)) { | 202 } else if (!base::ContainsKey(would_be_disabled_ids_, extension_id)) { |
| 202 UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptExtensionWouldBeDisabled", true); | 203 UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptExtensionWouldBeDisabled", true); |
| 203 would_be_disabled_ids_.insert(extension_id); | 204 would_be_disabled_ids_.insert(extension_id); |
| 204 } | 205 } |
| 205 } | 206 } |
| 206 | 207 |
| 207 | 208 |
| 208 } // namespace extensions | 209 } // namespace extensions |
| OLD | NEW |