OLD | NEW |
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 #ifndef UI_APP_LIST_SPEECH_UI_MODEL_H_ | 5 #ifndef UI_APP_LIST_SPEECH_UI_MODEL_H_ |
6 #define UI_APP_LIST_SPEECH_UI_MODEL_H_ | 6 #define UI_APP_LIST_SPEECH_UI_MODEL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "ui/app_list/app_list_export.h" | 11 #include "ui/app_list/app_list_export.h" |
12 #include "ui/app_list/speech_ui_model_observer.h" | 12 #include "ui/app_list/speech_ui_model_observer.h" |
13 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
14 | 14 |
15 namespace app_list { | 15 namespace app_list { |
16 | 16 |
17 // SpeechUIModel provides the interface to update the UI for speech recognition. | 17 // SpeechUIModel provides the interface to update the UI for speech recognition. |
18 class APP_LIST_EXPORT SpeechUIModel { | 18 class APP_LIST_EXPORT SpeechUIModel { |
19 public: | 19 public: |
20 explicit SpeechUIModel(SpeechRecognitionState initial_state); | 20 // Construct the model, initially in state SPEECH_RECOGNITION_OFF. |
| 21 SpeechUIModel(); |
21 virtual ~SpeechUIModel(); | 22 virtual ~SpeechUIModel(); |
22 | 23 |
23 void SetSpeechResult(const base::string16& result, bool is_final); | 24 void SetSpeechResult(const base::string16& result, bool is_final); |
24 void UpdateSoundLevel(int16 level); | 25 void UpdateSoundLevel(int16 level); |
25 void SetSpeechRecognitionState(SpeechRecognitionState new_state); | 26 void SetSpeechRecognitionState(SpeechRecognitionState new_state); |
26 | 27 |
27 void AddObserver(SpeechUIModelObserver* observer); | 28 void AddObserver(SpeechUIModelObserver* observer); |
28 void RemoveObserver(SpeechUIModelObserver* observer); | 29 void RemoveObserver(SpeechUIModelObserver* observer); |
29 | 30 |
30 const base::string16& result() const { return result_; } | 31 const base::string16& result() const { return result_; } |
(...skipping 17 matching lines...) Expand all Loading... |
48 int16 maximum_sound_level_; | 49 int16 maximum_sound_level_; |
49 | 50 |
50 ObserverList<SpeechUIModelObserver> observers_; | 51 ObserverList<SpeechUIModelObserver> observers_; |
51 | 52 |
52 DISALLOW_COPY_AND_ASSIGN(SpeechUIModel); | 53 DISALLOW_COPY_AND_ASSIGN(SpeechUIModel); |
53 }; | 54 }; |
54 | 55 |
55 } // namespace app_list | 56 } // namespace app_list |
56 | 57 |
57 #endif // UI_APP_LIST_SPEECH_UI_MODEL_H_ | 58 #endif // UI_APP_LIST_SPEECH_UI_MODEL_H_ |
OLD | NEW |