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

Side by Side Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 721093002: Disable new hotwording in the launcher for non-ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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/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/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 speech_recognizer_->Start(); 196 speech_recognizer_->Start();
197 return; 197 return;
198 } 198 }
199 199
200 contents_->GetWebUI()->CallJavascriptFunction( 200 contents_->GetWebUI()->CallJavascriptFunction(
201 "appList.startPage.toggleSpeechRecognition"); 201 "appList.startPage.toggleSpeechRecognition");
202 } 202 }
203 203
204 bool StartPageService::HotwordEnabled() { 204 bool StartPageService::HotwordEnabled() {
205 // Voice input for the launcher is unsupported on non-ChromeOS platforms.
206 // TODO(amistry): Make speech input, and hotwording, work on non-ChromeOS.
207 #if defined(OS_CHROMEOS)
205 if (HotwordService::IsExperimentalHotwordingEnabled()) { 208 if (HotwordService::IsExperimentalHotwordingEnabled()) {
206 auto prefs = profile_->GetPrefs(); 209 auto prefs = profile_->GetPrefs();
207 return HotwordServiceFactory::IsServiceAvailable(profile_) && 210 return HotwordServiceFactory::IsServiceAvailable(profile_) &&
208 (prefs->GetBoolean(prefs::kHotwordSearchEnabled) || 211 (prefs->GetBoolean(prefs::kHotwordSearchEnabled) ||
209 prefs->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled)); 212 prefs->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled));
210 } 213 }
211 #if defined(OS_CHROMEOS)
212 return HotwordServiceFactory::IsServiceAvailable(profile_) && 214 return HotwordServiceFactory::IsServiceAvailable(profile_) &&
213 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled); 215 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled);
214 #else 216 #else
215 return false; 217 return false;
216 #endif 218 #endif
217 } 219 }
218 220
219 content::WebContents* StartPageService::GetStartPageContents() { 221 content::WebContents* StartPageService::GetStartPageContents() {
220 return app_list::switches::IsExperimentalAppListEnabled() ? contents_.get() 222 return app_list::switches::IsExperimentalAppListEnabled() ? contents_.get()
221 : NULL; 223 : NULL;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 316 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
315 std::string()); 317 std::string());
316 } 318 }
317 319
318 void StartPageService::UnloadContents() { 320 void StartPageService::UnloadContents() {
319 contents_.reset(); 321 contents_.reset();
320 webui_finished_loading_ = false; 322 webui_finished_loading_ = false;
321 } 323 }
322 324
323 } // namespace app_list 325 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698