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/updater/extension_downloader.h" | 5 #include "chrome/browser/extensions/updater/extension_downloader.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 ++url_stats_.theme_count; | 232 ++url_stats_.theme_count; |
233 break; | 233 break; |
234 case Extension::TYPE_EXTENSION: | 234 case Extension::TYPE_EXTENSION: |
235 case Extension::TYPE_USER_SCRIPT: | 235 case Extension::TYPE_USER_SCRIPT: |
236 ++url_stats_.extension_count; | 236 ++url_stats_.extension_count; |
237 break; | 237 break; |
238 case Extension::TYPE_HOSTED_APP: | 238 case Extension::TYPE_HOSTED_APP: |
239 case Extension::TYPE_LEGACY_PACKAGED_APP: | 239 case Extension::TYPE_LEGACY_PACKAGED_APP: |
240 ++url_stats_.app_count; | 240 ++url_stats_.app_count; |
241 break; | 241 break; |
| 242 case Extension::TYPE_PLATFORM_APP: |
| 243 ++url_stats_.platform_app_count; |
| 244 break; |
242 case Extension::TYPE_UNKNOWN: | 245 case Extension::TYPE_UNKNOWN: |
243 default: | 246 default: |
244 ++url_stats_.pending_count; | 247 ++url_stats_.pending_count; |
245 break; | 248 break; |
246 } | 249 } |
247 | 250 |
248 std::vector<GURL> update_urls; | 251 std::vector<GURL> update_urls; |
249 update_urls.push_back(update_url); | 252 update_urls.push_back(update_url); |
250 // If UMA is enabled, also add to ManifestFetchData for the | 253 // If UMA is enabled, also add to ManifestFetchData for the |
251 // webstore update URL. | 254 // webstore update URL. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 return true; | 298 return true; |
296 } | 299 } |
297 | 300 |
298 void ExtensionDownloader::ReportStats() const { | 301 void ExtensionDownloader::ReportStats() const { |
299 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtension", | 302 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtension", |
300 url_stats_.extension_count); | 303 url_stats_.extension_count); |
301 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", | 304 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", |
302 url_stats_.theme_count); | 305 url_stats_.theme_count); |
303 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckApp", | 306 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckApp", |
304 url_stats_.app_count); | 307 url_stats_.app_count); |
| 308 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPackagedApp", |
| 309 url_stats_.platform_app_count); |
305 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPending", | 310 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPending", |
306 url_stats_.pending_count); | 311 url_stats_.pending_count); |
307 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckGoogleUrl", | 312 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckGoogleUrl", |
308 url_stats_.google_url_count); | 313 url_stats_.google_url_count); |
309 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckOtherUrl", | 314 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckOtherUrl", |
310 url_stats_.other_url_count); | 315 url_stats_.other_url_count); |
311 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckNoUrl", | 316 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckNoUrl", |
312 url_stats_.no_url_count); | 317 url_stats_.no_url_count); |
313 } | 318 } |
314 | 319 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 668 } |
664 | 669 |
665 void ExtensionDownloader::NotifyUpdateFound(const std::string& id) { | 670 void ExtensionDownloader::NotifyUpdateFound(const std::string& id) { |
666 content::NotificationService::current()->Notify( | 671 content::NotificationService::current()->Notify( |
667 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 672 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
668 content::NotificationService::AllBrowserContextsAndSources(), | 673 content::NotificationService::AllBrowserContextsAndSources(), |
669 content::Details<const std::string>(&id)); | 674 content::Details<const std::string>(&id)); |
670 } | 675 } |
671 | 676 |
672 } // namespace extensions | 677 } // namespace extensions |
OLD | NEW |