OLD | NEW |
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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
479 void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) { | 479 void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) { |
480 speech_ui_->UpdateSoundLevel(level); | 480 speech_ui_->UpdateSoundLevel(level); |
481 } | 481 } |
482 | 482 |
483 void AppListViewDelegate::OnSpeechRecognitionStateChanged( | 483 void AppListViewDelegate::OnSpeechRecognitionStateChanged( |
484 app_list::SpeechRecognitionState new_state) { | 484 app_list::SpeechRecognitionState new_state) { |
485 speech_ui_->SetSpeechRecognitionState(new_state); | 485 speech_ui_->SetSpeechRecognitionState(new_state); |
| 486 |
| 487 app_list::StartPageService* service = |
| 488 app_list::StartPageService::Get(profile_); |
| 489 // With the new hotword extension, we need to re-request hotwording after |
| 490 // speech recognition has stopped. |
| 491 if (new_state == app_list::SPEECH_RECOGNITION_READY && |
| 492 HotwordService::IsExperimentalHotwordingEnabled() && |
| 493 service && service->HotwordEnabled()) { |
| 494 HotwordService* hotword_service = |
| 495 HotwordServiceFactory::GetForProfile(profile_); |
| 496 if (hotword_service) { |
| 497 hotword_service->RequestHotwordSession(this); |
| 498 } |
| 499 } |
486 } | 500 } |
487 | 501 |
488 void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) { | 502 void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) { |
489 OnProfileChanged(); | 503 OnProfileChanged(); |
490 } | 504 } |
491 | 505 |
492 void AppListViewDelegate::OnProfileWasRemoved( | 506 void AppListViewDelegate::OnProfileWasRemoved( |
493 const base::FilePath& profile_path, const base::string16& profile_name) { | 507 const base::FilePath& profile_path, const base::string16& profile_name) { |
494 OnProfileChanged(); | 508 OnProfileChanged(); |
495 } | 509 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 597 |
584 void AppListViewDelegate::AddObserver( | 598 void AppListViewDelegate::AddObserver( |
585 app_list::AppListViewDelegateObserver* observer) { | 599 app_list::AppListViewDelegateObserver* observer) { |
586 observers_.AddObserver(observer); | 600 observers_.AddObserver(observer); |
587 } | 601 } |
588 | 602 |
589 void AppListViewDelegate::RemoveObserver( | 603 void AppListViewDelegate::RemoveObserver( |
590 app_list::AppListViewDelegateObserver* observer) { | 604 app_list::AppListViewDelegateObserver* observer) { |
591 observers_.RemoveObserver(observer); | 605 observers_.RemoveObserver(observer); |
592 } | 606 } |
OLD | NEW |