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