| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/installed_loader.h" | 5 #include "chrome/browser/extensions/installed_loader.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 extension_service_->extensions()->size()); | 184 extension_service_->extensions()->size()); |
| 185 UMA_HISTOGRAM_COUNTS_100("Extensions.Disabled", | 185 UMA_HISTOGRAM_COUNTS_100("Extensions.Disabled", |
| 186 extension_service_->disabled_extensions()->size()); | 186 extension_service_->disabled_extensions()->size()); |
| 187 | 187 |
| 188 UMA_HISTOGRAM_TIMES("Extensions.LoadAllTime", | 188 UMA_HISTOGRAM_TIMES("Extensions.LoadAllTime", |
| 189 base::TimeTicks::Now() - start_time); | 189 base::TimeTicks::Now() - start_time); |
| 190 | 190 |
| 191 int app_user_count = 0; | 191 int app_user_count = 0; |
| 192 int app_external_count = 0; | 192 int app_external_count = 0; |
| 193 int hosted_app_count = 0; | 193 int hosted_app_count = 0; |
| 194 int packaged_app_count = 0; | 194 int legacy_packaged_app_count = 0; |
| 195 int user_script_count = 0; | 195 int user_script_count = 0; |
| 196 int extension_user_count = 0; | 196 int extension_user_count = 0; |
| 197 int extension_external_count = 0; | 197 int extension_external_count = 0; |
| 198 int theme_count = 0; | 198 int theme_count = 0; |
| 199 int page_action_count = 0; | 199 int page_action_count = 0; |
| 200 int browser_action_count = 0; | 200 int browser_action_count = 0; |
| 201 int disabled_for_permissions_count = 0; | 201 int disabled_for_permissions_count = 0; |
| 202 int item_user_count = 0; | 202 int item_user_count = 0; |
| 203 const ExtensionSet* extensions = extension_service_->extensions(); | 203 const ExtensionSet* extensions = extension_service_->extensions(); |
| 204 ExtensionSet::const_iterator ex; | 204 ExtensionSet::const_iterator ex; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 235 ++user_script_count; | 235 ++user_script_count; |
| 236 break; | 236 break; |
| 237 case Extension::TYPE_HOSTED_APP: | 237 case Extension::TYPE_HOSTED_APP: |
| 238 ++hosted_app_count; | 238 ++hosted_app_count; |
| 239 if (Extension::IsExternalLocation(location)) { | 239 if (Extension::IsExternalLocation(location)) { |
| 240 ++app_external_count; | 240 ++app_external_count; |
| 241 } else { | 241 } else { |
| 242 ++app_user_count; | 242 ++app_user_count; |
| 243 } | 243 } |
| 244 break; | 244 break; |
| 245 case Extension::TYPE_PACKAGED_APP: | 245 case Extension::TYPE_LEGACY_PACKAGED_APP: |
| 246 ++packaged_app_count; | 246 ++legacy_packaged_app_count; |
| 247 if (Extension::IsExternalLocation(location)) { | 247 if (Extension::IsExternalLocation(location)) { |
| 248 ++app_external_count; | 248 ++app_external_count; |
| 249 } else { | 249 } else { |
| 250 ++app_user_count; | 250 ++app_user_count; |
| 251 } | 251 } |
| 252 break; | 252 break; |
| 253 case Extension::TYPE_EXTENSION: | 253 case Extension::TYPE_EXTENSION: |
| 254 default: | 254 default: |
| 255 if (Extension::IsExternalLocation(location)) { | 255 if (Extension::IsExternalLocation(location)) { |
| 256 ++extension_external_count; | 256 ++extension_external_count; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 278 ++disabled_for_permissions_count; | 278 ++disabled_for_permissions_count; |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAllUser", item_user_count); | 282 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAllUser", item_user_count); |
| 283 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadApp", | 283 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadApp", |
| 284 app_user_count + app_external_count); | 284 app_user_count + app_external_count); |
| 285 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppUser", app_user_count); | 285 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppUser", app_user_count); |
| 286 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppExternal", app_external_count); | 286 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppExternal", app_external_count); |
| 287 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadHostedApp", hosted_app_count); | 287 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadHostedApp", hosted_app_count); |
| 288 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPackagedApp", packaged_app_count); | 288 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPackagedApp", |
| 289 legacy_packaged_app_count); |
| 289 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtension", | 290 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtension", |
| 290 extension_user_count + extension_external_count); | 291 extension_user_count + extension_external_count); |
| 291 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtensionUser", | 292 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtensionUser", |
| 292 extension_user_count); | 293 extension_user_count); |
| 293 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtensionExternal", | 294 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtensionExternal", |
| 294 extension_external_count); | 295 extension_external_count); |
| 295 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadUserScript", user_script_count); | 296 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadUserScript", user_script_count); |
| 296 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadTheme", theme_count); | 297 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadTheme", theme_count); |
| 297 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPageAction", page_action_count); | 298 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPageAction", page_action_count); |
| 298 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadBrowserAction", | 299 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadBrowserAction", |
| 299 browser_action_count); | 300 browser_action_count); |
| 300 UMA_HISTOGRAM_COUNTS_100("Extensions.DisabledForPermissions", | 301 UMA_HISTOGRAM_COUNTS_100("Extensions.DisabledForPermissions", |
| 301 disabled_for_permissions_count); | 302 disabled_for_permissions_count); |
| 302 } | 303 } |
| 303 | 304 |
| 304 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 305 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
| 305 int flags = Extension::NO_FLAGS; | 306 int flags = Extension::NO_FLAGS; |
| 306 if (info->extension_location != Extension::LOAD) | 307 if (info->extension_location != Extension::LOAD) |
| 307 flags |= Extension::REQUIRE_KEY; | 308 flags |= Extension::REQUIRE_KEY; |
| 308 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 309 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
| 309 flags |= Extension::ALLOW_FILE_ACCESS; | 310 flags |= Extension::ALLOW_FILE_ACCESS; |
| 310 if (extension_prefs_->IsFromWebStore(info->extension_id)) | 311 if (extension_prefs_->IsFromWebStore(info->extension_id)) |
| 311 flags |= Extension::FROM_WEBSTORE; | 312 flags |= Extension::FROM_WEBSTORE; |
| 312 if (extension_prefs_->IsFromBookmark(info->extension_id)) | 313 if (extension_prefs_->IsFromBookmark(info->extension_id)) |
| 313 flags |= Extension::FROM_BOOKMARK; | 314 flags |= Extension::FROM_BOOKMARK; |
| 314 return flags; | 315 return flags; |
| 315 } | 316 } |
| 316 | 317 |
| 317 } // namespace extensions | 318 } // namespace extensions |
| OLD | NEW |