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 "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 prefs::kAppListLaunchCount, | 222 prefs::kAppListLaunchCount, |
223 &SendAppListLaunch); | 223 &SendAppListLaunch); |
224 SendDailyEventFrequency(prefs::kLastAppListAppLaunchPing, | 224 SendDailyEventFrequency(prefs::kLastAppListAppLaunchPing, |
225 prefs::kAppListAppLaunchCount, | 225 prefs::kAppListAppLaunchCount, |
226 &SendAppListAppLaunch); | 226 &SendAppListAppLaunch); |
227 } | 227 } |
228 | 228 |
229 AppListServiceImpl::AppListServiceImpl() | 229 AppListServiceImpl::AppListServiceImpl() |
230 : profile_store_( | 230 : profile_store_( |
231 new ProfileStoreImpl(g_browser_process->profile_manager())), | 231 new ProfileStoreImpl(g_browser_process->profile_manager())), |
232 weak_factory_(this), | |
233 command_line_(*CommandLine::ForCurrentProcess()), | 232 command_line_(*CommandLine::ForCurrentProcess()), |
234 local_state_(g_browser_process->local_state()), | 233 local_state_(g_browser_process->local_state()), |
235 profile_loader_(new ProfileLoader(profile_store_.get())) { | 234 profile_loader_(new ProfileLoader(profile_store_.get())), |
| 235 weak_factory_(this) { |
236 profile_store_->AddProfileObserver(this); | 236 profile_store_->AddProfileObserver(this); |
237 } | 237 } |
238 | 238 |
239 AppListServiceImpl::AppListServiceImpl(const CommandLine& command_line, | 239 AppListServiceImpl::AppListServiceImpl(const CommandLine& command_line, |
240 PrefService* local_state, | 240 PrefService* local_state, |
241 scoped_ptr<ProfileStore> profile_store) | 241 scoped_ptr<ProfileStore> profile_store) |
242 : profile_store_(profile_store.Pass()), | 242 : profile_store_(profile_store.Pass()), |
243 weak_factory_(this), | |
244 command_line_(command_line), | 243 command_line_(command_line), |
245 local_state_(local_state), | 244 local_state_(local_state), |
246 profile_loader_(new ProfileLoader(profile_store_.get())) { | 245 profile_loader_(new ProfileLoader(profile_store_.get())), |
| 246 weak_factory_(this) { |
247 profile_store_->AddProfileObserver(this); | 247 profile_store_->AddProfileObserver(this); |
248 } | 248 } |
249 | 249 |
250 AppListServiceImpl::~AppListServiceImpl() {} | 250 AppListServiceImpl::~AppListServiceImpl() {} |
251 | 251 |
252 void AppListServiceImpl::SetAppListNextPaintCallback(void (*callback)()) {} | 252 void AppListServiceImpl::SetAppListNextPaintCallback(void (*callback)()) {} |
253 | 253 |
254 void AppListServiceImpl::HandleFirstRun() {} | 254 void AppListServiceImpl::HandleFirstRun() {} |
255 | 255 |
256 void AppListServiceImpl::Init(Profile* initial_profile) {} | 256 void AppListServiceImpl::Init(Profile* initial_profile) {} |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 if (!base::MessageLoop::current()) | 373 if (!base::MessageLoop::current()) |
374 return; // In a unit test. | 374 return; // In a unit test. |
375 | 375 |
376 // Send app list usage stats after a delay. | 376 // Send app list usage stats after a delay. |
377 const int kSendUsageStatsDelay = 5; | 377 const int kSendUsageStatsDelay = 5; |
378 base::MessageLoop::current()->PostDelayedTask( | 378 base::MessageLoop::current()->PostDelayedTask( |
379 FROM_HERE, | 379 FROM_HERE, |
380 base::Bind(&AppListServiceImpl::SendAppListStats), | 380 base::Bind(&AppListServiceImpl::SendAppListStats), |
381 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 381 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
382 } | 382 } |
OLD | NEW |