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