| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/prefs/pref_service.h" | |
| 17 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 18 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 19 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 20 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 21 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/browser_shutdown.h" | 21 #include "chrome/browser/browser_shutdown.h" |
| 23 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
| 24 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 23 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 25 #include "chrome/browser/ui/app_list/profile_loader.h" | 24 #include "chrome/browser/ui/app_list/profile_loader.h" |
| 26 #include "chrome/browser/ui/app_list/profile_store.h" | 25 #include "chrome/browser/ui/app_list/profile_store.h" |
| 27 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 28 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "components/prefs/pref_service.h" |
| 29 #include "ui/app_list/app_list_model.h" | 29 #include "ui/app_list/app_list_model.h" |
| 30 #include "ui/app_list/app_list_switches.h" | 30 #include "ui/app_list/app_list_switches.h" |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 const int kDiscoverabilityTimeoutMinutes = 60; | 34 const int kDiscoverabilityTimeoutMinutes = 60; |
| 35 | 35 |
| 36 void SendAppListAppLaunch(int count) { | 36 void SendAppListAppLaunch(int count) { |
| 37 UMA_HISTOGRAM_CUSTOM_COUNTS( | 37 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 38 "Apps.AppListDailyAppLaunches", count, 1, 1000, 50); | 38 "Apps.AppListDailyAppLaunches", count, 1, 1000, 50); |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 448 |
| 449 if (!base::ThreadTaskRunnerHandle::IsSet()) | 449 if (!base::ThreadTaskRunnerHandle::IsSet()) |
| 450 return; // In a unit test. | 450 return; // In a unit test. |
| 451 | 451 |
| 452 // Send app list usage stats after a delay. | 452 // Send app list usage stats after a delay. |
| 453 const int kSendUsageStatsDelay = 5; | 453 const int kSendUsageStatsDelay = 5; |
| 454 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 454 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 455 FROM_HERE, base::Bind(&AppListServiceImpl::SendAppListStats), | 455 FROM_HERE, base::Bind(&AppListServiceImpl::SendAppListStats), |
| 456 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 456 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
| 457 } | 457 } |
| OLD | NEW |