| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 content::WebContents* StartPageService::GetSpeechContents() { | 345 content::WebContents* StartPageService::GetSpeechContents() { |
| 346 return GetSpeechRecognitionContents(); | 346 return GetSpeechRecognitionContents(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void StartPageService::GetSpeechAuthParameters(std::string* auth_scope, | 349 void StartPageService::GetSpeechAuthParameters(std::string* auth_scope, |
| 350 std::string* auth_token) { | 350 std::string* auth_token) { |
| 351 if (HotwordService::IsExperimentalHotwordingEnabled()) { | 351 if (HotwordService::IsExperimentalHotwordingEnabled()) { |
| 352 HotwordService* service = HotwordServiceFactory::GetForProfile(profile_); | 352 HotwordService* service = HotwordServiceFactory::GetForProfile(profile_); |
| 353 if (service && | 353 if (service && |
| 354 service->IsOptedIntoAudioLogging() && | 354 service->IsOptedIntoAudioLogging() && |
| 355 service->IsAlwaysOnEnabled() && |
| 355 !speech_auth_helper_->GetToken().empty()) { | 356 !speech_auth_helper_->GetToken().empty()) { |
| 356 *auth_scope = speech_auth_helper_->GetScope(); | 357 *auth_scope = speech_auth_helper_->GetScope(); |
| 357 *auth_token = speech_auth_helper_->GetToken(); | 358 *auth_token = speech_auth_helper_->GetToken(); |
| 358 } | 359 } |
| 359 } | 360 } |
| 360 } | 361 } |
| 361 | 362 |
| 362 void StartPageService::Shutdown() { | 363 void StartPageService::Shutdown() { |
| 363 UnloadContents(); | 364 UnloadContents(); |
| 364 #if defined(OS_CHROMEOS) | 365 #if defined(OS_CHROMEOS) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 392 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 393 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 393 std::string()); | 394 std::string()); |
| 394 } | 395 } |
| 395 | 396 |
| 396 void StartPageService::UnloadContents() { | 397 void StartPageService::UnloadContents() { |
| 397 contents_.reset(); | 398 contents_.reset(); |
| 398 webui_finished_loading_ = false; | 399 webui_finished_loading_ = false; |
| 399 } | 400 } |
| 400 | 401 |
| 401 } // namespace app_list | 402 } // namespace app_list |
| OLD | NEW |