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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 view_delegate_->SetProfile(NULL); | 323 view_delegate_->SetProfile(NULL); |
324 } | 324 } |
325 | 325 |
326 void AppListServiceImpl::Show() { | 326 void AppListServiceImpl::Show() { |
327 profile_loader_->LoadProfileInvalidatingOtherLoads( | 327 profile_loader_->LoadProfileInvalidatingOtherLoads( |
328 GetProfilePath(profile_store_->GetUserDataDir()), | 328 GetProfilePath(profile_store_->GetUserDataDir()), |
329 base::Bind(&AppListServiceImpl::ShowForProfile, | 329 base::Bind(&AppListServiceImpl::ShowForProfile, |
330 weak_factory_.GetWeakPtr())); | 330 weak_factory_.GetWeakPtr())); |
331 } | 331 } |
332 | 332 |
333 void AppListServiceImpl::ShowForVoiceSearch(Profile* profile) { | |
334 ShowForProfile(profile); | |
335 app_list::AppListViewDelegate* delegate = | |
336 implicit_cast<app_list::AppListViewDelegate*>(view_delegate_.get()); | |
tapted
2014/10/09 03:37:00
you shouldn't need the implicit cast after a rebas
Anand Mistry (off Chromium)
2014/10/13 21:51:59
Done.
| |
337 delegate->ToggleSpeechRecognition(); | |
338 } | |
339 | |
333 void AppListServiceImpl::AutoShowForProfile(Profile* requested_profile) { | 340 void AppListServiceImpl::AutoShowForProfile(Profile* requested_profile) { |
334 if (local_state_->GetInt64(prefs::kAppListEnableTime) != 0) { | 341 if (local_state_->GetInt64(prefs::kAppListEnableTime) != 0) { |
335 // User has not yet discovered the app launcher. Update the enable method to | 342 // User has not yet discovered the app launcher. Update the enable method to |
336 // indicate this. It will then be recorded in UMA. | 343 // indicate this. It will then be recorded in UMA. |
337 local_state_->SetInteger(prefs::kAppListEnableMethod, | 344 local_state_->SetInteger(prefs::kAppListEnableMethod, |
338 ENABLE_SHOWN_UNDISCOVERED); | 345 ENABLE_SHOWN_UNDISCOVERED); |
339 } | 346 } |
340 ShowForProfile(requested_profile); | 347 ShowForProfile(requested_profile); |
341 } | 348 } |
342 | 349 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 if (!base::MessageLoop::current()) | 393 if (!base::MessageLoop::current()) |
387 return; // In a unit test. | 394 return; // In a unit test. |
388 | 395 |
389 // Send app list usage stats after a delay. | 396 // Send app list usage stats after a delay. |
390 const int kSendUsageStatsDelay = 5; | 397 const int kSendUsageStatsDelay = 5; |
391 base::MessageLoop::current()->PostDelayedTask( | 398 base::MessageLoop::current()->PostDelayedTask( |
392 FROM_HERE, | 399 FROM_HERE, |
393 base::Bind(&AppListServiceImpl::SendAppListStats), | 400 base::Bind(&AppListServiceImpl::SendAppListStats), |
394 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 401 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
395 } | 402 } |
OLD | NEW |