Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_impl.cc

Issue 631913004: Open the launcher when hotword is triggered in always-on mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-google-com-ntp
Patch Set: Fix android build Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 view_delegate_->SetProfile(NULL); 324 view_delegate_->SetProfile(NULL);
325 } 325 }
326 326
327 void AppListServiceImpl::Show() { 327 void AppListServiceImpl::Show() {
328 profile_loader_->LoadProfileInvalidatingOtherLoads( 328 profile_loader_->LoadProfileInvalidatingOtherLoads(
329 GetProfilePath(profile_store_->GetUserDataDir()), 329 GetProfilePath(profile_store_->GetUserDataDir()),
330 base::Bind(&AppListServiceImpl::ShowForProfile, 330 base::Bind(&AppListServiceImpl::ShowForProfile,
331 weak_factory_.GetWeakPtr())); 331 weak_factory_.GetWeakPtr()));
332 } 332 }
333 333
334 void AppListServiceImpl::ShowForVoiceSearch(Profile* profile) {
335 ShowForProfile(profile);
336 view_delegate_->ToggleSpeechRecognition();
337 }
338
334 void AppListServiceImpl::ShowForAppInstall(Profile* profile, 339 void AppListServiceImpl::ShowForAppInstall(Profile* profile,
335 const std::string& extension_id, 340 const std::string& extension_id,
336 bool start_discovery_tracking) { 341 bool start_discovery_tracking) {
337 if (start_discovery_tracking) { 342 if (start_discovery_tracking) {
338 CreateForProfile(profile); 343 CreateForProfile(profile);
339 } else { 344 } else {
340 // 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
341 // 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
342 // counted as undiscovered. 347 // counted as undiscovered.
343 if (local_state_->GetInt64(prefs::kAppListEnableTime) != 0) { 348 if (local_state_->GetInt64(prefs::kAppListEnableTime) != 0) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 if (!base::MessageLoop::current()) 409 if (!base::MessageLoop::current())
405 return; // In a unit test. 410 return; // In a unit test.
406 411
407 // Send app list usage stats after a delay. 412 // Send app list usage stats after a delay.
408 const int kSendUsageStatsDelay = 5; 413 const int kSendUsageStatsDelay = 5;
409 base::MessageLoop::current()->PostDelayedTask( 414 base::MessageLoop::current()->PostDelayedTask(
410 FROM_HERE, 415 FROM_HERE,
411 base::Bind(&AppListServiceImpl::SendAppListStats), 416 base::Bind(&AppListServiceImpl::SendAppListStats),
412 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); 417 base::TimeDelta::FromSeconds(kSendUsageStatsDelay));
413 } 418 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_impl.h ('k') | chrome/browser/ui/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698