OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/voice_search_ui.h" | 5 #include "chrome/browser/ui/webui/voice_search_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/plugins/plugin_prefs.h" | 21 #include "chrome/browser/plugins/plugin_prefs.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/search/hotword_service.h" | 23 #include "chrome/browser/search/hotword_service.h" |
24 #include "chrome/browser/search/hotword_service_factory.h" | 24 #include "chrome/browser/search/hotword_service_factory.h" |
25 #include "chrome/browser/ui/app_list/start_page_service.h" | 25 #include "chrome/browser/ui/app_list/start_page_service.h" |
26 #include "chrome/browser/ui/webui/version_handler.h" | 26 #include "chrome/browser/ui/webui/version_handler.h" |
27 #include "chrome/common/channel_info.h" | 27 #include "chrome/common/channel_info.h" |
28 #include "chrome/common/chrome_content_client.h" | 28 #include "chrome/common/chrome_content_client.h" |
29 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
| 31 #include "chrome/common/features.h" |
31 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
32 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
33 #include "chrome/grit/browser_resources.h" | 34 #include "chrome/grit/browser_resources.h" |
34 #include "chrome/grit/chromium_strings.h" | 35 #include "chrome/grit/chromium_strings.h" |
35 #include "chrome/grit/generated_resources.h" | 36 #include "chrome/grit/generated_resources.h" |
36 #include "components/prefs/pref_service.h" | 37 #include "components/prefs/pref_service.h" |
37 #include "components/strings/grit/components_strings.h" | 38 #include "components/strings/grit/components_strings.h" |
38 #include "components/version_info/version_info.h" | 39 #include "components/version_info/version_info.h" |
39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
40 #include "content/public/browser/plugin_service.h" | 41 #include "content/public/browser/plugin_service.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 state = "undefined"; | 374 state = "undefined"; |
374 } | 375 } |
375 | 376 |
376 AddPair(list, name_prefix + " State", state); | 377 AddPair(list, name_prefix + " State", state); |
377 | 378 |
378 AddLineBreak(list); | 379 AddLineBreak(list); |
379 } | 380 } |
380 | 381 |
381 // Adds information specific to voice search in the app launcher to the list. | 382 // Adds information specific to voice search in the app launcher to the list. |
382 void AddAppListInfo(base::ListValue* list) { | 383 void AddAppListInfo(base::ListValue* list) { |
383 #if defined (ENABLE_APP_LIST) | 384 #if BUILDFLAG(ENABLE_APP_LIST) |
384 std::string state = "No Start Page Service"; | 385 std::string state = "No Start Page Service"; |
385 app_list::StartPageService* start_page_service = | 386 app_list::StartPageService* start_page_service = |
386 app_list::StartPageService::Get(profile_); | 387 app_list::StartPageService::Get(profile_); |
387 if (start_page_service) { | 388 if (start_page_service) { |
388 app_list::SpeechRecognitionState speech_state = | 389 app_list::SpeechRecognitionState speech_state = |
389 start_page_service->state(); | 390 start_page_service->state(); |
390 switch (speech_state) { | 391 switch (speech_state) { |
391 case app_list::SPEECH_RECOGNITION_OFF: | 392 case app_list::SPEECH_RECOGNITION_OFF: |
392 state = "SPEECH_RECOGNITION_OFF"; | 393 state = "SPEECH_RECOGNITION_OFF"; |
393 break; | 394 break; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) | 436 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) |
436 : content::WebUIController(web_ui) { | 437 : content::WebUIController(web_ui) { |
437 Profile* profile = Profile::FromWebUI(web_ui); | 438 Profile* profile = Profile::FromWebUI(web_ui); |
438 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); | 439 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); |
439 | 440 |
440 // Set up the about:voicesearch source. | 441 // Set up the about:voicesearch source. |
441 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); | 442 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); |
442 } | 443 } |
443 | 444 |
444 VoiceSearchUI::~VoiceSearchUI() {} | 445 VoiceSearchUI::~VoiceSearchUI() {} |
OLD | NEW |