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

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

Issue 992173002: Delete the old hotwording integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-remove-disable-option
Patch Set: Rebase. Created 5 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_view_delegate.h" 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/custom_launcher_page_contents.h" 9 #include "apps/custom_launcher_page_contents.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 653
654 // With the new hotword extension, stop the hotword session. With the launcher 654 // With the new hotword extension, stop the hotword session. With the launcher
655 // and NTP, this is unnecessary since the hotwording is implicitly stopped. 655 // and NTP, this is unnecessary since the hotwording is implicitly stopped.
656 // However, for always on, hotword triggering launches the launcher which 656 // However, for always on, hotword triggering launches the launcher which
657 // starts a session and hence starts the hotword detector. This results in the 657 // starts a session and hence starts the hotword detector. This results in the
658 // hotword detector and the speech-to-text engine running in parallel, which 658 // hotword detector and the speech-to-text engine running in parallel, which
659 // will conflict with each other (i.e. saying 'Ok Google' twice in a row 659 // will conflict with each other (i.e. saying 'Ok Google' twice in a row
660 // should cause a search to happen for 'Ok Google', not two hotword triggers). 660 // should cause a search to happen for 'Ok Google', not two hotword triggers).
661 // To get around this, always stop the session when switching to speech 661 // To get around this, always stop the session when switching to speech
662 // recognition. 662 // recognition.
663 if (HotwordService::IsExperimentalHotwordingEnabled() && 663 if (service && service->HotwordEnabled()) {
664 service && service->HotwordEnabled()) {
665 HotwordService* hotword_service = 664 HotwordService* hotword_service =
666 HotwordServiceFactory::GetForProfile(profile_); 665 HotwordServiceFactory::GetForProfile(profile_);
667 if (hotword_service) 666 if (hotword_service)
668 hotword_service->StopHotwordSession(this); 667 hotword_service->StopHotwordSession(this);
669 } 668 }
670 } 669 }
671 670
672 void AppListViewDelegate::ShowForProfileByPath( 671 void AppListViewDelegate::ShowForProfileByPath(
673 const base::FilePath& profile_path) { 672 const base::FilePath& profile_path) {
674 controller_->ShowForProfileByPath(profile_path); 673 controller_->ShowForProfileByPath(profile_path);
(...skipping 17 matching lines...) Expand all
692 void AppListViewDelegate::OnSpeechRecognitionStateChanged( 691 void AppListViewDelegate::OnSpeechRecognitionStateChanged(
693 app_list::SpeechRecognitionState new_state) { 692 app_list::SpeechRecognitionState new_state) {
694 speech_ui_->SetSpeechRecognitionState(new_state); 693 speech_ui_->SetSpeechRecognitionState(new_state);
695 694
696 app_list::StartPageService* service = 695 app_list::StartPageService* service =
697 app_list::StartPageService::Get(profile_); 696 app_list::StartPageService::Get(profile_);
698 // With the new hotword extension, we need to re-request hotwording after 697 // With the new hotword extension, we need to re-request hotwording after
699 // speech recognition has stopped. Do not request hotwording after the app 698 // speech recognition has stopped. Do not request hotwording after the app
700 // list has already closed. 699 // list has already closed.
701 if (new_state == app_list::SPEECH_RECOGNITION_READY && 700 if (new_state == app_list::SPEECH_RECOGNITION_READY &&
702 HotwordService::IsExperimentalHotwordingEnabled() &&
703 service && service->HotwordEnabled() && 701 service && service->HotwordEnabled() &&
704 controller_->GetAppListWindow()) { 702 controller_->GetAppListWindow()) {
705 HotwordService* hotword_service = 703 HotwordService* hotword_service =
706 HotwordServiceFactory::GetForProfile(profile_); 704 HotwordServiceFactory::GetForProfile(profile_);
707 if (hotword_service) { 705 if (hotword_service) {
708 hotword_service->RequestHotwordSession(this); 706 hotword_service->RequestHotwordSession(this);
709 } 707 }
710 } 708 }
711 } 709 }
712 710
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 843
846 // SigninManagerFactory is not a leaky singleton (unlike this class), and 844 // SigninManagerFactory is not a leaky singleton (unlike this class), and
847 // its destructor will check that it has no remaining observers. 845 // its destructor will check that it has no remaining observers.
848 scoped_observer_.RemoveAll(); 846 scoped_observer_.RemoveAll();
849 SigninManagerFactory::GetInstance()->RemoveObserver(this); 847 SigninManagerFactory::GetInstance()->RemoveObserver(this);
850 break; 848 break;
851 default: 849 default:
852 NOTREACHED(); 850 NOTREACHED();
853 } 851 }
854 } 852 }
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/ui/app_list/start_page_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698