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

Unified Diff: ui/app_list/speech_ui_model.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
« no previous file with comments | « ui/app_list/speech_ui_model.h ('k') | ui/app_list/speech_ui_model_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/speech_ui_model.cc
diff --git a/ui/app_list/speech_ui_model.cc b/ui/app_list/speech_ui_model.cc
new file mode 100644
index 0000000000000000000000000000000000000000..86955511930a8c3be69c983c6501d78784516bea
--- /dev/null
+++ b/ui/app_list/speech_ui_model.cc
@@ -0,0 +1,54 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/speech_ui_model.h"
+
+namespace app_list {
+
+SpeechUIModel::SpeechUIModel() {}
+
+SpeechUIModel::~SpeechUIModel() {}
+
+void SpeechUIModel::SetSpeechResult(const base::string16& result,
+ bool is_final) {
+ if (result_ == result && is_final_ == is_final)
+ return;
+
+ result_ = result;
+ is_final_ = is_final;
+ FOR_EACH_OBSERVER(SpeechUIModelObserver,
+ observers_,
+ OnSpeechResult(result, is_final));
+}
+
+void SpeechUIModel::UpdateSoundLevel(int16 level) {
+ if (sound_level_ == level)
+ return;
+
+ sound_level_ = level;
+ FOR_EACH_OBSERVER(SpeechUIModelObserver,
+ observers_,
+ OnSpeechSoundLevelChanged(level));
+}
+
+void SpeechUIModel::SetSpeechRecognitionState(
+ SpeechRecognitionState new_state) {
+ if (state_ == new_state)
+ return;
+
+ state_ = new_state;
+ FOR_EACH_OBSERVER(SpeechUIModelObserver,
+ observers_,
+ OnSpeechRecognitionStateChanged(new_state));
+}
+
+void SpeechUIModel::AddObserver(SpeechUIModelObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void SpeechUIModel::RemoveObserver(SpeechUIModelObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+} // namespace app_list
« no previous file with comments | « ui/app_list/speech_ui_model.h ('k') | ui/app_list/speech_ui_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698