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

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

Issue 297533002: Improvements to incognito and file access metrics for extensions: only record (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reabse Created 6 years, 7 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 73ea40c059f929b528e066b510a9ab2f7fd4f6fc..c3de689ae8b1806bff4394f27b416b12dbbd1374 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -296,10 +296,10 @@ void InstalledLoader::LoadAllExtensions() {
int browser_action_count = 0;
int disabled_for_permissions_count = 0;
int non_webstore_ntp_override_count = 0;
- int incognito = 0;
- int not_incognito = 0;
- int file_access = 0;
- int not_file_access = 0;
+ int incognito_allowed_count = 0;
+ int incognito_not_allowed_count = 0;
+ int file_access_allowed_count = 0;
+ int file_access_not_allowed_count = 0;
const ExtensionSet& extensions = extension_registry_->enabled_extensions();
ExtensionActionManager* extension_action_manager =
@@ -444,19 +444,21 @@ void InstalledLoader::LoadAllExtensions() {
extension, "Extensions.Permissions_Load");
// For incognito and file access, skip anything that doesn't appear in
- // settings.
- if (extension->ShouldDisplayInExtensionSettings()) {
+ // settings. Also, policy-installed (and unpacked of course, checked above)
+ // extensions are boring.
+ if (extension->ShouldDisplayInExtensionSettings() &&
+ !Manifest::IsPolicyLocation(extension->location())) {
if (extension->can_be_incognito_enabled()) {
if (util::IsIncognitoEnabled(extension->id(), profile))
- ++incognito;
+ ++incognito_allowed_count;
else
- ++not_incognito;
+ ++incognito_not_allowed_count;
}
if (extension->wants_file_access()) {
if (util::AllowFileAccess(extension->id(), profile))
- ++file_access;
+ ++file_access_allowed_count;
else
- ++not_file_access;
+ ++file_access_not_allowed_count;
}
}
}
@@ -527,10 +529,18 @@ void InstalledLoader::LoadAllExtensions() {
disabled_for_permissions_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.NonWebStoreNewTabPageOverrides",
non_webstore_ntp_override_count);
- UMA_HISTOGRAM_COUNTS_100("Extensions.IncognitoAllowed", incognito);
- UMA_HISTOGRAM_COUNTS_100("Extensions.IncognitoNotAllowed", not_incognito);
- UMA_HISTOGRAM_COUNTS_100("Extensions.FileAccessAllowed", file_access);
- UMA_HISTOGRAM_COUNTS_100("Extensions.FileAccessNotAllowed", not_file_access);
+ if (incognito_allowed_count + incognito_not_allowed_count > 0) {
+ UMA_HISTOGRAM_COUNTS_100("Extensions.IncognitoAllowed",
+ incognito_allowed_count);
+ UMA_HISTOGRAM_COUNTS_100("Extensions.IncognitoNotAllowed",
+ incognito_not_allowed_count);
+ }
+ if (file_access_allowed_count + file_access_not_allowed_count > 0) {
+ UMA_HISTOGRAM_COUNTS_100("Extensions.FileAccessAllowed",
+ file_access_allowed_count);
+ UMA_HISTOGRAM_COUNTS_100("Extensions.FileAccessNotAllowed",
+ file_access_not_allowed_count);
+ }
}
int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
« 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