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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 if (content::PluginService::GetInstance()->GetPluginInfoByPath(path, | 263 if (content::PluginService::GetInstance()->GetPluginInfoByPath(path, |
264 &info) && | 264 &info) && |
265 plugin_prefs->IsPluginEnabled(info)) { | 265 plugin_prefs->IsPluginEnabled(info)) { |
266 nacl_enabled = "Yes"; | 266 nacl_enabled = "Yes"; |
267 } | 267 } |
268 } | 268 } |
269 #endif | 269 #endif |
270 | 270 |
271 AddPair(list, "NaCl Enabled", nacl_enabled); | 271 AddPair(list, "NaCl Enabled", nacl_enabled); |
272 | 272 |
273 AddPair(list, | 273 HotwordService* hotword_service = |
274 "Microphone", | 274 HotwordServiceFactory::GetForProfile(profile_); |
275 HotwordServiceFactory::IsMicrophoneAvailable() ? "Yes" : "No"); | 275 AddPair(list, "Microphone", |
| 276 hotword_service && hotword_service->microphone_available() ? "Yes" |
| 277 : "No"); |
276 | 278 |
277 std::string audio_capture = "No"; | 279 std::string audio_capture = "No"; |
278 if (profile_->GetPrefs()->GetBoolean(prefs::kAudioCaptureAllowed)) | 280 if (profile_->GetPrefs()->GetBoolean(prefs::kAudioCaptureAllowed)) |
279 audio_capture = "Yes"; | 281 audio_capture = "Yes"; |
280 AddPair(list, "Audio Capture Allowed", audio_capture); | 282 AddPair(list, "Audio Capture Allowed", audio_capture); |
281 | 283 |
282 AddLineBreak(list); | 284 AddLineBreak(list); |
283 } | 285 } |
284 | 286 |
285 // Adds information regarding languages to the list. | 287 // Adds information regarding languages to the list. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) | 438 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) |
437 : content::WebUIController(web_ui) { | 439 : content::WebUIController(web_ui) { |
438 Profile* profile = Profile::FromWebUI(web_ui); | 440 Profile* profile = Profile::FromWebUI(web_ui); |
439 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); | 441 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); |
440 | 442 |
441 // Set up the about:voicesearch source. | 443 // Set up the about:voicesearch source. |
442 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); | 444 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); |
443 } | 445 } |
444 | 446 |
445 VoiceSearchUI::~VoiceSearchUI() {} | 447 VoiceSearchUI::~VoiceSearchUI() {} |
OLD | NEW |