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" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "base/version.h" | 12 #include "base/version.h" |
13 #include "chrome/browser/omaha_query_params/omaha_query_params.h" | |
14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/search/hotword_service.h" | 14 #include "chrome/browser/search/hotword_service.h" |
16 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 15 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
17 #include "chrome/browser/ui/app_list/app_list_service.h" | 16 #include "chrome/browser/ui/app_list/app_list_service.h" |
18 #include "chrome/browser/ui/app_list/recommended_apps.h" | 17 #include "chrome/browser/ui/app_list/recommended_apps.h" |
19 #include "chrome/browser/ui/app_list/start_page_service.h" | 18 #include "chrome/browser/ui/app_list/start_page_service.h" |
20 #include "chrome/browser/ui/host_desktop.h" | 19 #include "chrome/browser/ui/host_desktop.h" |
21 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 20 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
22 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 22 #include "components/omaha_query_params/omaha_query_params.h" |
23 #include "content/public/browser/web_ui.h" | 23 #include "content/public/browser/web_ui.h" |
24 #include "extensions/browser/extension_registry.h" | 24 #include "extensions/browser/extension_registry.h" |
25 #include "extensions/browser/extension_system.h" | 25 #include "extensions/browser/extension_system.h" |
26 #include "extensions/common/constants.h" | 26 #include "extensions/common/constants.h" |
27 #include "extensions/common/extension.h" | 27 #include "extensions/common/extension.h" |
28 #include "extensions/common/extension_icon_set.h" | 28 #include "extensions/common/extension_icon_set.h" |
29 #include "ui/app_list/app_list_switches.h" | 29 #include "ui/app_list/app_list_switches.h" |
30 #include "ui/app_list/speech_ui_model_observer.h" | 30 #include "ui/app_list/speech_ui_model_observer.h" |
31 #include "ui/events/event_constants.h" | 31 #include "ui/events/event_constants.h" |
32 | 32 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 base::Bind(&StartPageHandler::OnHotwordEnabledChanged, | 174 base::Bind(&StartPageHandler::OnHotwordEnabledChanged, |
175 base::Unretained(this))); | 175 base::Unretained(this))); |
176 | 176 |
177 extension_registry_observer_.Add( | 177 extension_registry_observer_.Add( |
178 extensions::ExtensionRegistry::Get(profile)); | 178 extensions::ExtensionRegistry::Get(profile)); |
179 } | 179 } |
180 #endif | 180 #endif |
181 | 181 |
182 web_ui()->CallJavascriptFunction( | 182 web_ui()->CallJavascriptFunction( |
183 "appList.startPage.setNaclArch", | 183 "appList.startPage.setNaclArch", |
184 base::StringValue(chrome::OmahaQueryParams::GetNaclArch())); | 184 base::StringValue(omaha_query_params::OmahaQueryParams::GetNaclArch())); |
185 | 185 |
186 if (!app_list::switches::IsExperimentalAppListEnabled()) { | 186 if (!app_list::switches::IsExperimentalAppListEnabled()) { |
187 web_ui()->CallJavascriptFunction( | 187 web_ui()->CallJavascriptFunction( |
188 "appList.startPage.onAppListShown", | 188 "appList.startPage.onAppListShown", |
189 base::FundamentalValue(service->HotwordEnabled())); | 189 base::FundamentalValue(service->HotwordEnabled())); |
190 } | 190 } |
191 } | 191 } |
192 | 192 |
193 void StartPageHandler::HandleLaunchApp(const base::ListValue* args) { | 193 void StartPageHandler::HandleLaunchApp(const base::ListValue* args) { |
194 std::string app_id; | 194 std::string app_id; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 else if (state_string == "NETWORK_ERROR") | 251 else if (state_string == "NETWORK_ERROR") |
252 new_state = SPEECH_RECOGNITION_NETWORK_ERROR; | 252 new_state = SPEECH_RECOGNITION_NETWORK_ERROR; |
253 | 253 |
254 StartPageService* service = | 254 StartPageService* service = |
255 StartPageService::Get(Profile::FromWebUI(web_ui())); | 255 StartPageService::Get(Profile::FromWebUI(web_ui())); |
256 if (service) | 256 if (service) |
257 service->OnSpeechRecognitionStateChanged(new_state); | 257 service->OnSpeechRecognitionStateChanged(new_state); |
258 } | 258 } |
259 | 259 |
260 } // namespace app_list | 260 } // namespace app_list |
OLD | NEW |