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

Unified Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 267653005: Adds HotwordPrivate API for integrating the hotword feature to AppLauncher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/start_page_service.cc
diff --git a/chrome/browser/ui/app_list/start_page_service.cc b/chrome/browser/ui/app_list/start_page_service.cc
index 461e5400968fad0e2ce4218c81aaf0b5b2297d0a..e57480972d17030b473ff3ffe08f4a287b51b010 100644
--- a/chrome/browser/ui/app_list/start_page_service.cc
+++ b/chrome/browser/ui/app_list/start_page_service.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/media/media_stream_infobar_delegate.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/search/hotword_service.h"
#include "chrome/browser/search/hotword_service_factory.h"
#include "chrome/browser/ui/app_list/recommended_apps.h"
#include "chrome/browser/ui/app_list/start_page_observer.h"
@@ -104,14 +103,6 @@ StartPageService::StartPageService(Profile* profile)
state_(app_list::SPEECH_RECOGNITION_OFF),
speech_button_toggled_manually_(false),
speech_result_obtained_(false) {
-#if defined(OS_CHROMEOS)
- // Updates the default state to hotword listening, because this is
- // the default behavior. This will be updated when the page is loaded and
- // the nacl module is loaded.
- if (app_list::switches::IsVoiceSearchEnabled())
- state_ = app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING;
-#endif
-
if (app_list::switches::IsExperimentalAppListEnabled())
LoadContents();
}
@@ -151,24 +142,8 @@ void StartPageService::ToggleSpeechRecognition() {
bool StartPageService::HotwordEnabled() {
#if defined(OS_CHROMEOS)
- if (!HotwordService::DoesHotwordSupportLanguage(profile_))
- return false;
-
- const PrefService::Preference* preference =
- profile_->GetPrefs()->FindPreference(prefs::kHotwordSearchEnabled);
- if (!preference)
- return false;
-
- if (!HotwordServiceFactory::IsServiceAvailable(profile_))
- return false;
-
- // kHotwordSearchEnabled is off by default, but app-list is on by default.
- // To achieve this, we'll return true if it's in the default status.
- if (preference->IsDefaultValue())
- return true;
-
- bool isEnabled = false;
- return preference->GetValue()->GetAsBoolean(&isEnabled) && isEnabled;
+ return HotwordServiceFactory::IsServiceAvailable(profile_) &&
+ profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled);
#else
return false;
#endif
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.cc ('k') | chrome/browser/ui/webui/app_list/start_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698