Index: chrome/browser/extensions/installed_loader.cc |
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc |
index 155a177b2b591b59c84a1ad01121c2a7e641dd62..d9de618ff6edb101de0d8c1b0c4db2519724887e 100644 |
--- a/chrome/browser/extensions/installed_loader.cc |
+++ b/chrome/browser/extensions/installed_loader.cc |
@@ -20,6 +20,7 @@ |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/extensions/api/managed_mode_private/managed_mode_handler.h" |
+#include "chrome/common/extensions/background_info.h" |
#include "chrome/common/extensions/extension.h" |
#include "chrome/common/extensions/extension_file_util.h" |
#include "chrome/common/extensions/extension_l10n_util.h" |
@@ -37,6 +38,8 @@ using extensions::Manifest; |
namespace errors = extension_manifest_errors; |
+namespace extensions { |
+ |
namespace { |
// The following enumeration is used in histograms matching |
@@ -49,6 +52,14 @@ enum ManifestReloadReason { |
NUM_MANIFEST_RELOAD_REASONS |
}; |
+// Used in histogram Extension.BackgroundPageType. Values may be added, as |
+// long as existing values are not changed. |
+enum BackgroundPageType { |
+ NO_BACKGROUND_PAGE = 0, |
+ BACKGROUND_PAGE_PERSISTENT = 1, |
+ EVENT_PAGE = 2, |
+}; |
+ |
ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) { |
// Always reload manifests of unpacked extensions, because they can change |
// on disk independent of the manifest in our prefs. |
@@ -63,6 +74,14 @@ ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) { |
return NOT_NEEDED; |
} |
+BackgroundPageType GetBackgroundPageType(const Extension* extension) { |
+ if (!BackgroundInfo::HasBackgroundPage(extension)) |
+ return NO_BACKGROUND_PAGE; |
+ if (BackgroundInfo::HasPersistentBackgroundPage(extension)) |
+ return BACKGROUND_PAGE_PERSISTENT; |
+ return EVENT_PAGE; |
+} |
+ |
void DispatchOnInstalledEvent( |
Profile* profile, |
const std::string& extension_id, |
@@ -80,8 +99,6 @@ void DispatchOnInstalledEvent( |
} // namespace |
-namespace extensions { |
- |
InstalledLoader::InstalledLoader(ExtensionService* extension_service) |
: extension_service_(extension_service), |
extension_prefs_(extension_service->extension_prefs()) { |
@@ -281,6 +298,15 @@ void InstalledLoader::LoadAllExtensions() { |
if (Manifest::IsUnpackedLocation(location)) |
continue; |
+ UMA_HISTOGRAM_ENUMERATION("Extensions.ManifestVersion", |
+ (*ex)->manifest_version(), 10); |
+ |
+ if (type == Manifest::TYPE_EXTENSION) { |
+ BackgroundPageType background_page_type = GetBackgroundPageType(*ex); |
+ UMA_HISTOGRAM_ENUMERATION("Extensions.BackgroundPageType", |
+ background_page_type, 10); |
+ } |
+ |
// Using an enumeration shows us the total installed ratio across all users. |
// Using the totals per user at each startup tells us the distribution of |
// usage for each user (e.g. 40% of users have at least one app installed). |