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

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

Issue 22390005: Change Extensions.ExternalItemState to report more specific data (enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/installed_loader.cc
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index 72a147f25816f5b72ff08038095835e7f90a5eb7..3f578651c7f16f4fd92bc3384219e84bc0df5bde 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -61,6 +61,18 @@ enum BackgroundPageType {
EVENT_PAGE = 2,
};
+// Used in histogram Extensions.ExternalItemState. Values may be added, as
+// long as existing values are not changed.
+enum ExternalItemState {
+ DEPRECATED_EXTERNAL_ITEM_DISABLED = 0,
+ DEPRECATED_EXTERNAL_ITEM_ENABLED = 1,
+ EXTERNAL_ITEM_WEBSTORE_DISABLED = 2,
+ EXTERNAL_ITEM_WEBSTORE_ENABLED = 3,
+ EXTERNAL_ITEM_NONWEBSTORE_DISABLED = 4,
+ EXTERNAL_ITEM_NONWEBSTORE_ENABLED = 5,
+ EXTERNAL_ITEM_MAX_ITEMS = 6
+};
+
ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) {
// Always reload manifests of unpacked extensions, because they can change
// on disk independent of the manifest in our prefs.
@@ -267,22 +279,28 @@ void InstalledLoader::LoadAllExtensions() {
}
if (Manifest::IsExternalLocation(location)) {
// See loop below for DISABLED.
- UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
- Extension::ENABLED, 100);
+ if (ManifestURL::UpdatesFromGallery(*ex)) {
+ UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
+ EXTERNAL_ITEM_WEBSTORE_ENABLED,
+ EXTERNAL_ITEM_MAX_ITEMS);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
+ EXTERNAL_ITEM_NONWEBSTORE_ENABLED,
+ EXTERNAL_ITEM_MAX_ITEMS);
+ }
}
if ((*ex)->from_webstore()) {
// Check for inconsistencies if the extension was supposedly installed
// from the webstore.
enum {
BAD_UPDATE_URL = 0,
- IS_EXTERNAL = 1,
+ // This value was a mistake. Turns out sideloaded extensions can
+ // have the from_webstore bit if they update from the webstore.
+ DEPRECATED_IS_EXTERNAL = 1,
};
if (!ManifestURL::UpdatesFromGallery(*ex)) {
UMA_HISTOGRAM_ENUMERATION("Extensions.FromWebstoreInconsistency",
BAD_UPDATE_URL, 2);
- } else if (Manifest::IsExternalLocation(location)) {
- UMA_HISTOGRAM_ENUMERATION("Extensions.FromWebstoreInconsistency",
- IS_EXTERNAL, 2);
}
}
@@ -384,8 +402,15 @@ void InstalledLoader::LoadAllExtensions() {
}
if (Manifest::IsExternalLocation((*ex)->location())) {
// See loop above for ENABLED.
- UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
- Extension::DISABLED, 100);
+ if (ManifestURL::UpdatesFromGallery(*ex)) {
+ UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
+ EXTERNAL_ITEM_WEBSTORE_DISABLED,
+ EXTERNAL_ITEM_MAX_ITEMS);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
+ EXTERNAL_ITEM_NONWEBSTORE_DISABLED,
+ EXTERNAL_ITEM_MAX_ITEMS);
+ }
}
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698