OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 int app_user_count = 0; | 173 int app_user_count = 0; |
174 int app_external_count = 0; | 174 int app_external_count = 0; |
175 int hosted_app_count = 0; | 175 int hosted_app_count = 0; |
176 int packaged_app_count = 0; | 176 int packaged_app_count = 0; |
177 int user_script_count = 0; | 177 int user_script_count = 0; |
178 int extension_user_count = 0; | 178 int extension_user_count = 0; |
179 int extension_external_count = 0; | 179 int extension_external_count = 0; |
180 int theme_count = 0; | 180 int theme_count = 0; |
181 int page_action_count = 0; | 181 int page_action_count = 0; |
182 int browser_action_count = 0; | 182 int browser_action_count = 0; |
183 const ExtensionList* extensions = extension_service_->extensions(); | 183 const ExtensionSet* extensions = extension_service_->extensions(); |
184 ExtensionList::const_iterator ex; | 184 ExtensionSet::const_iterator ex; |
185 for (ex = extensions->begin(); ex != extensions->end(); ++ex) { | 185 for (ex = extensions->begin(); ex != extensions->end(); ++ex) { |
186 Extension::Location location = (*ex)->location(); | 186 Extension::Location location = (*ex)->location(); |
187 Extension::Type type = (*ex)->GetType(); | 187 Extension::Type type = (*ex)->GetType(); |
188 if ((*ex)->is_app()) { | 188 if ((*ex)->is_app()) { |
189 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLocation", | 189 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLocation", |
190 location, 100); | 190 location, 100); |
191 } else if (type == Extension::TYPE_EXTENSION) { | 191 } else if (type == Extension::TYPE_EXTENSION) { |
192 UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionLocation", | 192 UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionLocation", |
193 location, 100); | 193 location, 100); |
194 } | 194 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 ++extension_user_count; | 238 ++extension_user_count; |
239 } | 239 } |
240 break; | 240 break; |
241 } | 241 } |
242 if ((*ex)->page_action() != NULL) | 242 if ((*ex)->page_action() != NULL) |
243 ++page_action_count; | 243 ++page_action_count; |
244 if ((*ex)->browser_action() != NULL) | 244 if ((*ex)->browser_action() != NULL) |
245 ++browser_action_count; | 245 ++browser_action_count; |
246 | 246 |
247 extension_service_->RecordPermissionMessagesHistogram( | 247 extension_service_->RecordPermissionMessagesHistogram( |
248 ex->get(), "Extensions.Permissions_Load"); | 248 *ex, "Extensions.Permissions_Load"); |
249 } | 249 } |
250 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadApp", | 250 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadApp", |
251 app_user_count + app_external_count); | 251 app_user_count + app_external_count); |
252 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppUser", app_user_count); | 252 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppUser", app_user_count); |
253 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppExternal", app_external_count); | 253 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAppExternal", app_external_count); |
254 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadHostedApp", hosted_app_count); | 254 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadHostedApp", hosted_app_count); |
255 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPackagedApp", packaged_app_count); | 255 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPackagedApp", packaged_app_count); |
256 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtension", | 256 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtension", |
257 extension_user_count + extension_external_count); | 257 extension_user_count + extension_external_count); |
258 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtensionUser", | 258 UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtensionUser", |
(...skipping 16 matching lines...) Expand all Loading... |
275 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 275 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
276 flags |= Extension::ALLOW_FILE_ACCESS; | 276 flags |= Extension::ALLOW_FILE_ACCESS; |
277 if (extension_prefs_->IsFromWebStore(info->extension_id)) | 277 if (extension_prefs_->IsFromWebStore(info->extension_id)) |
278 flags |= Extension::FROM_WEBSTORE; | 278 flags |= Extension::FROM_WEBSTORE; |
279 if (extension_prefs_->IsFromBookmark(info->extension_id)) | 279 if (extension_prefs_->IsFromBookmark(info->extension_id)) |
280 flags |= Extension::FROM_BOOKMARK; | 280 flags |= Extension::FROM_BOOKMARK; |
281 return flags; | 281 return flags; |
282 } | 282 } |
283 | 283 |
284 } // namespace extensions | 284 } // namespace extensions |
OLD | NEW |