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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 profile_loader_(new ProfileLoader(profile_store_.get())), | 254 profile_loader_(new ProfileLoader(profile_store_.get())), |
255 weak_factory_(this) { | 255 weak_factory_(this) { |
256 profile_store_->AddProfileObserver(this); | 256 profile_store_->AddProfileObserver(this); |
257 } | 257 } |
258 | 258 |
259 AppListServiceImpl::~AppListServiceImpl() {} | 259 AppListServiceImpl::~AppListServiceImpl() {} |
260 | 260 |
261 AppListViewDelegate* AppListServiceImpl::GetViewDelegate(Profile* profile) { | 261 AppListViewDelegate* AppListServiceImpl::GetViewDelegate(Profile* profile) { |
262 if (!view_delegate_) | 262 if (!view_delegate_) |
263 view_delegate_.reset(new AppListViewDelegate(GetControllerDelegate())); | 263 view_delegate_.reset(new AppListViewDelegate(GetControllerDelegate())); |
264 view_delegate_->SetProfile(profile); | 264 view_delegate_->SetProfile(profile->GetOriginalProfile()); |
265 return view_delegate_.get(); | 265 return view_delegate_.get(); |
266 } | 266 } |
267 | 267 |
268 void AppListServiceImpl::SetAppListNextPaintCallback(void (*callback)()) {} | 268 void AppListServiceImpl::SetAppListNextPaintCallback(void (*callback)()) {} |
269 | 269 |
270 void AppListServiceImpl::Init(Profile* initial_profile) {} | 270 void AppListServiceImpl::Init(Profile* initial_profile) {} |
271 | 271 |
272 base::FilePath AppListServiceImpl::GetProfilePath( | 272 base::FilePath AppListServiceImpl::GetProfilePath( |
273 const base::FilePath& user_data_dir) { | 273 const base::FilePath& user_data_dir) { |
274 std::string app_list_profile; | 274 std::string app_list_profile; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 if (!base::MessageLoop::current()) | 416 if (!base::MessageLoop::current()) |
417 return; // In a unit test. | 417 return; // In a unit test. |
418 | 418 |
419 // Send app list usage stats after a delay. | 419 // Send app list usage stats after a delay. |
420 const int kSendUsageStatsDelay = 5; | 420 const int kSendUsageStatsDelay = 5; |
421 base::MessageLoop::current()->PostDelayedTask( | 421 base::MessageLoop::current()->PostDelayedTask( |
422 FROM_HERE, | 422 FROM_HERE, |
423 base::Bind(&AppListServiceImpl::SendAppListStats), | 423 base::Bind(&AppListServiceImpl::SendAppListStats), |
424 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 424 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
425 } | 425 } |
OLD | NEW |