| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 "appList.startPage.toggleSpeechRecognition"); | 438 "appList.startPage.toggleSpeechRecognition"); |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool StartPageService::HotwordEnabled() { | 441 bool StartPageService::HotwordEnabled() { |
| 442 // Voice input for the launcher is unsupported on non-ChromeOS platforms. | 442 // Voice input for the launcher is unsupported on non-ChromeOS platforms. |
| 443 // TODO(amistry): Make speech input, and hotwording, work on non-ChromeOS. | 443 // TODO(amistry): Make speech input, and hotwording, work on non-ChromeOS. |
| 444 #if defined(OS_CHROMEOS) | 444 #if defined(OS_CHROMEOS) |
| 445 if (HotwordService::IsExperimentalHotwordingEnabled()) { | 445 if (HotwordService::IsExperimentalHotwordingEnabled()) { |
| 446 HotwordService* service = HotwordServiceFactory::GetForProfile(profile_); | 446 HotwordService* service = HotwordServiceFactory::GetForProfile(profile_); |
| 447 return state_ != SPEECH_RECOGNITION_OFF && | 447 return state_ != SPEECH_RECOGNITION_OFF && |
| 448 HotwordServiceFactory::IsServiceAvailable(profile_) && | |
| 449 service && | 448 service && |
| 450 (service->IsSometimesOnEnabled() || service->IsAlwaysOnEnabled()); | 449 (service->IsSometimesOnEnabled() || service->IsAlwaysOnEnabled()) && |
| 450 service->IsServiceAvailable(); |
| 451 } | 451 } |
| 452 return HotwordServiceFactory::IsServiceAvailable(profile_) && | 452 return HotwordServiceFactory::IsServiceAvailable(profile_) && |
| 453 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled); | 453 profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled); |
| 454 #else | 454 #else |
| 455 return false; | 455 return false; |
| 456 #endif | 456 #endif |
| 457 } | 457 } |
| 458 | 458 |
| 459 content::WebContents* StartPageService::GetStartPageContents() { | 459 content::WebContents* StartPageService::GetStartPageContents() { |
| 460 return app_list::switches::IsExperimentalAppListEnabled() ? contents_.get() | 460 return app_list::switches::IsExperimentalAppListEnabled() ? contents_.get() |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 | 676 |
| 677 // Check for a new doodle. | 677 // Check for a new doodle. |
| 678 content::BrowserThread::PostDelayedTask( | 678 content::BrowserThread::PostDelayedTask( |
| 679 content::BrowserThread::UI, FROM_HERE, | 679 content::BrowserThread::UI, FROM_HERE, |
| 680 base::Bind(&StartPageService::FetchDoodleJson, | 680 base::Bind(&StartPageService::FetchDoodleJson, |
| 681 weak_factory_.GetWeakPtr()), | 681 weak_factory_.GetWeakPtr()), |
| 682 recheck_delay); | 682 recheck_delay); |
| 683 } | 683 } |
| 684 | 684 |
| 685 } // namespace app_list | 685 } // namespace app_list |
| OLD | NEW |