Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3253)

Unified Diff: chrome/browser/extensions/install_verifier.cc

Issue 464463003: Adding logging of offstore extensions state to user metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/install_verifier.cc
diff --git a/chrome/browser/extensions/install_verifier.cc b/chrome/browser/extensions/install_verifier.cc
index 9cfb94cce09da5d9ce3047b308ab252b8c5f75ed..35147e59c7499e56ee0cf05db02dd0b6abcb06b4 100644
--- a/chrome/browser/extensions/install_verifier.cc
+++ b/chrome/browser/extensions/install_verifier.cc
@@ -128,19 +128,6 @@ void LogInitResultHistogram(InitResult result) {
result, INIT_RESULT_MAX);
}
-bool FromStore(const Extension& extension) {
- if (extension.from_webstore() || ManifestURL::UpdatesFromGallery(&extension))
- return true;
-
- // If an extension has no update url, our autoupdate code will ask the
- // webstore about it (to aid in migrating to the webstore from self-hosting
- // or sideloading based installs). So we want to do verification checks on
- // such extensions too so that we don't accidentally disable old installs of
- // extensions that did migrate to the webstore.
- return (ManifestURL::GetUpdateURL(&extension).is_empty() &&
- Manifest::IsAutoUpdateableLocation(extension.location()));
-}
-
bool CanUseExtensionApis(const Extension& extension) {
return extension.is_extension() || extension.is_legacy_packaged_app();
}
@@ -247,6 +234,15 @@ bool InstallVerifier::IsKnownId(const std::string& id) {
ContainsKey(signature_->invalid_ids, id));
}
+bool InstallVerifier::IsVerified(const std::string& id) const {
+ return ((signature_.get() && ContainsKey(signature_->ids, id)) ||
+ ContainsKey(provisional_, id));
+}
+
+bool InstallVerifier::IsInvalid(const std::string& id) const {
+ return ((signature_.get() && ContainsKey(signature_->invalid_ids, id)));
+}
+
void InstallVerifier::VerifyExtension(const std::string& extension_id) {
ExtensionIdSet ids;
ids.insert(extension_id);
@@ -314,6 +310,20 @@ void InstallVerifier::RemoveMany(const ExtensionIdSet& ids) {
BeginFetch();
}
+// static
+bool InstallVerifier::FromStore(const Extension& extension) {
+ if (extension.from_webstore() || ManifestURL::UpdatesFromGallery(&extension))
+ return true;
+
+ // If an extension has no update url, our autoupdate code will ask the
+ // webstore about it (to aid in migrating to the webstore from self-hosting
+ // or sideloading based installs). So we want to do verification checks on
+ // such extensions too so that we don't accidentally disable old installs of
+ // extensions that did migrate to the webstore.
+ return (ManifestURL::GetUpdateURL(&extension).is_empty() &&
+ Manifest::IsAutoUpdateableLocation(extension.location()));
+}
+
std::string InstallVerifier::GetDebugPolicyProviderName() const {
return std::string("InstallVerifier");
}
@@ -528,11 +538,6 @@ bool InstallVerifier::AllowedByEnterprisePolicy(const std::string& id) const {
return false;
}
-bool InstallVerifier::IsVerified(const std::string& id) const {
- return ((signature_.get() && ContainsKey(signature_->ids, id)) ||
- ContainsKey(provisional_, id));
-}
-
void InstallVerifier::BeginFetch() {
DCHECK(ShouldFetchSignature());

Powered by Google App Engine
This is Rietveld 408576698