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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 105773004: Introduces the speech recognition UI to app_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index 808610f5e00c2a468926735a9be28073ed4216f8..b2098c440629302db6f996f90f34f4e82b1b381f 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -36,6 +36,7 @@
#include "content/public/browser/user_metrics.h"
#include "ui/app_list/app_list_view_delegate_observer.h"
#include "ui/app_list/search_box_model.h"
+#include "ui/app_list/speech_ui_model.h"
#if defined(USE_ASH)
#include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h"
@@ -173,6 +174,10 @@ app_list::SigninDelegate* AppListViewDelegate::GetSigninDelegate() {
return &signin_delegate_;
}
+app_list::SpeechUIModel* AppListViewDelegate::GetSpeechUI() {
+ return &speech_ui_;
+}
+
void AppListViewDelegate::GetShortcutPathForApp(
const std::string& app_id,
const base::Callback<void(const base::FilePath&)>& callback) {
@@ -279,12 +284,20 @@ void AppListViewDelegate::ShowForProfileByPath(
controller_->ShowForProfileByPath(profile_path);
}
-void AppListViewDelegate::OnSearch(const base::string16& query) {
- model_->search_box()->SetText(query);
+void AppListViewDelegate::OnSpeechResult(const base::string16& result,
+ bool is_final) {
+ speech_ui_.SetSpeechResult(result, is_final);
+ if (is_final)
+ model_->search_box()->SetText(result);
+}
+
+void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) {
+ speech_ui_.UpdateSoundLevel(level);
}
-void AppListViewDelegate::OnSpeechRecognitionStateChanged(bool recognizing) {
- model_->search_box()->SetSpeechRecognitionButtonState(recognizing);
+void AppListViewDelegate::OnSpeechRecognitionStateChanged(
+ app_list::SpeechRecognitionState new_state) {
+ speech_ui_.SetSpeechRecognitionState(new_state);
}
void AppListViewDelegate::Observe(
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/browser/ui/app_list/search/search_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698