| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 view_delegate_->SetProfile(NULL); | 322 view_delegate_->SetProfile(NULL); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void AppListServiceImpl::Show() { | 325 void AppListServiceImpl::Show() { |
| 326 profile_loader_->LoadProfileInvalidatingOtherLoads( | 326 profile_loader_->LoadProfileInvalidatingOtherLoads( |
| 327 GetProfilePath(profile_store_->GetUserDataDir()), | 327 GetProfilePath(profile_store_->GetUserDataDir()), |
| 328 base::Bind(&AppListServiceImpl::ShowForProfile, | 328 base::Bind(&AppListServiceImpl::ShowForProfile, |
| 329 weak_factory_.GetWeakPtr())); | 329 weak_factory_.GetWeakPtr())); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void AppListServiceImpl::ShowForVoiceSearch(Profile* profile) { | 332 void AppListServiceImpl::ShowForVoiceSearch( |
| 333 Profile* profile, |
| 334 const scoped_refptr<content::SpeechRecognitionSessionPreamble>& preamble) { |
| 333 ShowForProfile(profile); | 335 ShowForProfile(profile); |
| 334 view_delegate_->ToggleSpeechRecognition(); | 336 view_delegate_->ToggleSpeechRecognitionForHotword(preamble); |
| 335 } | 337 } |
| 336 | 338 |
| 337 void AppListServiceImpl::ShowForAppInstall(Profile* profile, | 339 void AppListServiceImpl::ShowForAppInstall(Profile* profile, |
| 338 const std::string& extension_id, | 340 const std::string& extension_id, |
| 339 bool start_discovery_tracking) { | 341 bool start_discovery_tracking) { |
| 340 if (start_discovery_tracking) { | 342 if (start_discovery_tracking) { |
| 341 CreateForProfile(profile); | 343 CreateForProfile(profile); |
| 342 } else { | 344 } else { |
| 343 // Check if the app launcher has not yet been shown ever. Since this will | 345 // Check if the app launcher has not yet been shown ever. Since this will |
| 344 // show it, if discoverability UMA hasn't yet been recorded, it needs to be | 346 // show it, if discoverability UMA hasn't yet been recorded, it needs to be |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (!base::MessageLoop::current()) | 409 if (!base::MessageLoop::current()) |
| 408 return; // In a unit test. | 410 return; // In a unit test. |
| 409 | 411 |
| 410 // Send app list usage stats after a delay. | 412 // Send app list usage stats after a delay. |
| 411 const int kSendUsageStatsDelay = 5; | 413 const int kSendUsageStatsDelay = 5; |
| 412 base::MessageLoop::current()->PostDelayedTask( | 414 base::MessageLoop::current()->PostDelayedTask( |
| 413 FROM_HERE, | 415 FROM_HERE, |
| 414 base::Bind(&AppListServiceImpl::SendAppListStats), | 416 base::Bind(&AppListServiceImpl::SendAppListStats), |
| 415 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 417 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
| 416 } | 418 } |
| OLD | NEW |