| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |