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

Side by Side Diff: chrome/browser/ui/webui/app_list/start_page_handler.cc

Issue 149753002: Enables the 'hotword not listening' icon in the search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix breaks Created 6 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/app_list/search/search_controller.cc ('k') | ui/app_list/search_box_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/webui/app_list/start_page_handler.h" 5 #include "chrome/browser/ui/webui/app_list/start_page_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 StartPageService* service = 147 StartPageService* service =
148 StartPageService::Get(Profile::FromWebUI(web_ui())); 148 StartPageService::Get(Profile::FromWebUI(web_ui()));
149 service->OnSpeechSoundLevelChanged(static_cast<int16>(level)); 149 service->OnSpeechSoundLevelChanged(static_cast<int16>(level));
150 } 150 }
151 151
152 void StartPageHandler::HandleSpeechRecognition(const base::ListValue* args) { 152 void StartPageHandler::HandleSpeechRecognition(const base::ListValue* args) {
153 std::string state_string; 153 std::string state_string;
154 CHECK(args->GetString(0, &state_string)); 154 CHECK(args->GetString(0, &state_string));
155 155
156 SpeechRecognitionState new_state = SPEECH_RECOGNITION_NOT_STARTED; 156 SpeechRecognitionState new_state = SPEECH_RECOGNITION_OFF;
157 if (state_string == "on") 157 if (state_string == "READY")
158 new_state = SPEECH_RECOGNITION_ON; 158 new_state = SPEECH_RECOGNITION_READY;
159 else if (state_string == "in-speech") 159 else if (state_string == "HOTWORD_RECOGNIZING")
160 new_state = SPEECH_RECOGNITION_HOTWORD_LISTENING;
161 else if (state_string == "RECOGNIZING")
162 new_state = SPEECH_RECOGNITION_RECOGNIZING;
163 else if (state_string == "IN_SPEECH")
160 new_state = SPEECH_RECOGNITION_IN_SPEECH; 164 new_state = SPEECH_RECOGNITION_IN_SPEECH;
165 else if (state_string == "STOPPING")
166 new_state = SPEECH_RECOGNITION_STOPPING;
161 167
162 StartPageService* service = 168 StartPageService* service =
163 StartPageService::Get(Profile::FromWebUI(web_ui())); 169 StartPageService::Get(Profile::FromWebUI(web_ui()));
164 service->OnSpeechRecognitionStateChanged(new_state); 170 service->OnSpeechRecognitionStateChanged(new_state);
165 } 171 }
166 172
167 } // namespace app_list 173 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/search_controller.cc ('k') | ui/app_list/search_box_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698