Index: chrome/browser/extensions/installed_loader.cc |
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc |
index dbf79252ff3f693ed80c474858f943bf901db11c..2586c64193d9431c9b663fac273801b8afc62da1 100644 |
--- a/chrome/browser/extensions/installed_loader.cc |
+++ b/chrome/browser/extensions/installed_loader.cc |
@@ -114,6 +114,23 @@ BackgroundPageType GetBackgroundPageType(const Extension* extension) { |
return EVENT_PAGE; |
} |
+// Records the creation flags of an extension grouped by |
+// Extension::InitFromValueFlags. |
+void RecordCreationFlags(const Extension* extension) { |
+ int highest_flag_bit = 0; |
+ for (int i = 1; i < Extension::LAST_INIT_FROM_VALUE_FLAGS; i <<= 1) |
benwells
2014/04/22 06:41:44
Nit: add a comment explaining what you're doing he
calamity
2014/04/22 06:56:28
Done.
|
+ ++highest_flag_bit; |
+ |
+ int flag = 1; |
+ for (int i = 1; i <= highest_flag_bit; ++i) { |
+ if (extension->creation_flags() & flag) { |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "Extensions.LoadCreationFlags", i, highest_flag_bit + 1); |
+ } |
+ flag <<= 1; |
+ } |
+} |
+ |
} // namespace |
InstalledLoader::InstalledLoader(ExtensionService* extension_service) |
@@ -403,6 +420,8 @@ void InstalledLoader::LoadAllExtensions() { |
if (extensions::ManagedModeInfo::IsContentPack(ex->get())) |
++content_pack_count; |
+ RecordCreationFlags(*ex); |
+ |
extension_service_->RecordPermissionMessagesHistogram( |
ex->get(), "Extensions.Permissions_Load"); |
} |