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

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

Issue 685053002: Treat regular and always-on hotwording settings as mutually exclusive. (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 | « chrome/browser/resources/hotword/state_manager.js ('k') | 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 "appList.startPage.toggleSpeechRecognition"); 167 "appList.startPage.toggleSpeechRecognition");
168 } else { 168 } else {
169 pending_webui_callbacks_.push_back( 169 pending_webui_callbacks_.push_back(
170 base::Bind(&StartPageService::ToggleSpeechRecognition, 170 base::Bind(&StartPageService::ToggleSpeechRecognition,
171 base::Unretained(this))); 171 base::Unretained(this)));
172 } 172 }
173 } 173 }
174 174
175 bool StartPageService::HotwordEnabled() { 175 bool StartPageService::HotwordEnabled() {
176 if (HotwordService::IsExperimentalHotwordingEnabled()) { 176 if (HotwordService::IsExperimentalHotwordingEnabled()) {
177 auto prefs = profile_->GetPrefs();
177 return HotwordServiceFactory::IsServiceAvailable(profile_) && 178 return HotwordServiceFactory::IsServiceAvailable(profile_) &&
178 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled); 179 (prefs->GetBoolean(prefs::kHotwordSearchEnabled) ||
180 prefs->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled));
179 } 181 }
180 #if defined(OS_CHROMEOS) 182 #if defined(OS_CHROMEOS)
181 return HotwordServiceFactory::IsServiceAvailable(profile_) && 183 return HotwordServiceFactory::IsServiceAvailable(profile_) &&
182 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled); 184 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled);
183 #else 185 #else
184 return false; 186 return false;
185 #endif 187 #endif
186 } 188 }
187 189
188 content::WebContents* StartPageService::GetStartPageContents() { 190 content::WebContents* StartPageService::GetStartPageContents() {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 274 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
273 std::string()); 275 std::string());
274 } 276 }
275 277
276 void StartPageService::UnloadContents() { 278 void StartPageService::UnloadContents() {
277 contents_.reset(); 279 contents_.reset();
278 webui_finished_loading_ = false; 280 webui_finished_loading_ = false;
279 } 281 }
280 282
281 } // namespace app_list 283 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/resources/hotword/state_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698