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 #include "chrome/browser/ui/app_list/start_page_service.h" | 5 #include "chrome/browser/ui/app_list/start_page_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 void StartPageService::RemoveObserver(StartPageObserver* observer) { | 151 void StartPageService::RemoveObserver(StartPageObserver* observer) { |
152 observers_.RemoveObserver(observer); | 152 observers_.RemoveObserver(observer); |
153 } | 153 } |
154 | 154 |
155 void StartPageService::ToggleSpeechRecognition() { | 155 void StartPageService::ToggleSpeechRecognition() { |
156 contents_->GetWebUI()->CallJavascriptFunction( | 156 contents_->GetWebUI()->CallJavascriptFunction( |
157 "appList.startPage.toggleSpeechRecognition"); | 157 "appList.startPage.toggleSpeechRecognition"); |
158 } | 158 } |
159 | 159 |
160 void StartPageService::OnSearch(const base::string16& query) { | 160 void StartPageService::OnSpeechResult( |
161 FOR_EACH_OBSERVER(StartPageObserver, observers_, OnSearch(query)); | 161 const base::string16& query, bool is_final) { |
| 162 FOR_EACH_OBSERVER(StartPageObserver, |
| 163 observers_, |
| 164 OnSpeechResult(query, is_final)); |
162 } | 165 } |
163 | 166 |
164 void StartPageService::OnSpeechRecognitionStateChanged(bool recognizing) { | 167 void StartPageService::OnSpeechSoundLevelChanged(int16 level) { |
165 FOR_EACH_OBSERVER(StartPageObserver, | 168 FOR_EACH_OBSERVER(StartPageObserver, |
166 observers_, | 169 observers_, |
167 OnSpeechRecognitionStateChanged(recognizing)); | 170 OnSpeechSoundLevelChanged(level)); |
| 171 } |
| 172 |
| 173 void StartPageService::OnSpeechRecognitionStateChanged( |
| 174 SpeechRecognitionState new_state) { |
| 175 FOR_EACH_OBSERVER(StartPageObserver, |
| 176 observers_, |
| 177 OnSpeechRecognitionStateChanged(new_state)); |
168 } | 178 } |
169 | 179 |
170 void StartPageService::Shutdown() { | 180 void StartPageService::Shutdown() { |
171 contents_.reset(); | 181 contents_.reset(); |
172 } | 182 } |
173 | 183 |
174 } // namespace app_list | 184 } // namespace app_list |
OLD | NEW |