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

Side by Side Diff: chrome/browser/ui/webui/app_list/start_page_handler.cc

Issue 631913004: Open the launcher when hotword is triggered in always-on mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-google-com-ntp
Patch Set: Fix android build Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.cc ('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/webui/app_list/start_page_handler.h" 5 #include "chrome/browser/ui/webui/app_list/start_page_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 } 154 }
155 #endif 155 #endif
156 156
157 void StartPageHandler::HandleInitialize(const base::ListValue* args) { 157 void StartPageHandler::HandleInitialize(const base::ListValue* args) {
158 Profile* profile = Profile::FromWebUI(web_ui()); 158 Profile* profile = Profile::FromWebUI(web_ui());
159 StartPageService* service = StartPageService::Get(profile); 159 StartPageService* service = StartPageService::Get(profile);
160 if (!service) 160 if (!service)
161 return; 161 return;
162 162
163 service->WebUILoaded();
164
163 recommended_apps_ = service->recommended_apps(); 165 recommended_apps_ = service->recommended_apps();
164 recommended_apps_->AddObserver(this); 166 recommended_apps_->AddObserver(this);
165 167
166 SendRecommendedApps(); 168 SendRecommendedApps();
167 169
168 #if defined(OS_CHROMEOS) 170 #if defined(OS_CHROMEOS)
169 if (app_list::switches::IsVoiceSearchEnabled() && 171 if (app_list::switches::IsVoiceSearchEnabled() &&
170 HotwordService::DoesHotwordSupportLanguage(profile)) { 172 HotwordService::DoesHotwordSupportLanguage(profile)) {
171 OnHotwordEnabledChanged(); 173 OnHotwordEnabledChanged();
172 pref_change_registrar_.Init(profile->GetPrefs()); 174 pref_change_registrar_.Init(profile->GetPrefs());
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 else if (state_string == "NETWORK_ERROR") 267 else if (state_string == "NETWORK_ERROR")
266 new_state = SPEECH_RECOGNITION_NETWORK_ERROR; 268 new_state = SPEECH_RECOGNITION_NETWORK_ERROR;
267 269
268 StartPageService* service = 270 StartPageService* service =
269 StartPageService::Get(Profile::FromWebUI(web_ui())); 271 StartPageService::Get(Profile::FromWebUI(web_ui()));
270 if (service) 272 if (service)
271 service->OnSpeechRecognitionStateChanged(new_state); 273 service->OnSpeechRecognitionStateChanged(new_state);
272 } 274 }
273 275
274 } // namespace app_list 276 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698