| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/app_list/app_list_service_impl.h" | 5 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "apps/pref_names.h" | 9 #include "apps/pref_names.h" |
| 10 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 12 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "chrome/browser/apps/shortcut_manager.h" | 16 #include "chrome/browser/apps/shortcut_manager.h" |
| 16 #include "chrome/browser/apps/shortcut_manager_factory.h" | 17 #include "chrome/browser/apps/shortcut_manager_factory.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/browser/ui/app_list/keep_alive_service.h" | 20 #include "chrome/browser/ui/app_list/keep_alive_service.h" |
| 20 #include "chrome/browser/ui/app_list/keep_alive_service_impl.h" | 21 #include "chrome/browser/ui/app_list/keep_alive_service_impl.h" |
| 21 #include "chrome/browser/ui/app_list/profile_loader.h" | 22 #include "chrome/browser/ui/app_list/profile_loader.h" |
| 22 #include "chrome/browser/ui/app_list/profile_store.h" | 23 #include "chrome/browser/ui/app_list/profile_store.h" |
| 23 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 26 #include "content/public/browser/browser_thread.h" | |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 void SendAppListAppLaunch(int count) { | 30 void SendAppListAppLaunch(int count) { |
| 31 UMA_HISTOGRAM_CUSTOM_COUNTS( | 31 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 32 "Apps.AppListDailyAppLaunches", count, 1, 1000, 50); | 32 "Apps.AppListDailyAppLaunches", count, 1, 1000, 50); |
| 33 if (count > 0) | 33 if (count > 0) |
| 34 UMA_HISTOGRAM_ENUMERATION("Apps.AppListHasLaunchedAppToday", 1, 2); | 34 UMA_HISTOGRAM_ENUMERATION("Apps.AppListHasLaunchedAppToday", 1, 2); |
| 35 } | 35 } |
| 36 | 36 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 | 282 |
| 283 void AppListServiceImpl::SendUsageStats() { | 283 void AppListServiceImpl::SendUsageStats() { |
| 284 // Send app list usage stats after a delay. | 284 // Send app list usage stats after a delay. |
| 285 const int kSendUsageStatsDelay = 5; | 285 const int kSendUsageStatsDelay = 5; |
| 286 base::MessageLoop::current()->PostDelayedTask( | 286 base::MessageLoop::current()->PostDelayedTask( |
| 287 FROM_HERE, | 287 FROM_HERE, |
| 288 base::Bind(&AppListServiceImpl::SendAppListStats), | 288 base::Bind(&AppListServiceImpl::SendAppListStats), |
| 289 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 289 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
| 290 } | 290 } |
| OLD | NEW |