| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 plugin_prefs->IsPluginEnabled(info)) { | 264 plugin_prefs->IsPluginEnabled(info)) { |
| 265 nacl_enabled = "Yes"; | 265 nacl_enabled = "Yes"; |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 #endif | 268 #endif |
| 269 | 269 |
| 270 AddPair(list, "NaCl Enabled", nacl_enabled); | 270 AddPair(list, "NaCl Enabled", nacl_enabled); |
| 271 | 271 |
| 272 HotwordService* hotword_service = | 272 HotwordService* hotword_service = |
| 273 HotwordServiceFactory::GetForProfile(profile_); | 273 HotwordServiceFactory::GetForProfile(profile_); |
| 274 AddPair(list, "Microphone", | 274 AddPair(list, "Microphone Present", |
| 275 hotword_service && hotword_service->microphone_available() ? "Yes" | 275 hotword_service && hotword_service->microphone_available() ? "Yes" |
| 276 : "No"); | 276 : "No"); |
| 277 | 277 |
| 278 std::string audio_capture = "No"; | 278 std::string audio_capture = "No"; |
| 279 if (profile_->GetPrefs()->GetBoolean(prefs::kAudioCaptureAllowed)) | 279 if (profile_->GetPrefs()->GetBoolean(prefs::kAudioCaptureAllowed)) |
| 280 audio_capture = "Yes"; | 280 audio_capture = "Yes"; |
| 281 AddPair(list, "Audio Capture Allowed", audio_capture); | 281 AddPair(list, "Audio Capture Allowed", audio_capture); |
| 282 | 282 |
| 283 AddLineBreak(list); | 283 AddLineBreak(list); |
| 284 } | 284 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 296 | 296 |
| 297 AddPair(list, | 297 AddPair(list, |
| 298 "Hotword Previous Language", | 298 "Hotword Previous Language", |
| 299 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage)); | 299 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage)); |
| 300 | 300 |
| 301 AddLineBreak(list); | 301 AddLineBreak(list); |
| 302 } | 302 } |
| 303 | 303 |
| 304 // Adds information specific to the hotword configuration to the list. | 304 // Adds information specific to the hotword configuration to the list. |
| 305 void AddHotwordInfo(base::ListValue* list) { | 305 void AddHotwordInfo(base::ListValue* list) { |
| 306 HotwordService* hotword_service = |
| 307 HotwordServiceFactory::GetForProfile(profile_); |
| 308 std::string hotword_allowed = "No"; |
| 309 if (hotword_service && hotword_service->IsHotwordAllowed()) |
| 310 hotword_allowed = "Yes"; |
| 311 AddPair(list, "Hotword Module Installable", hotword_allowed); |
| 312 |
| 306 std::string search_enabled = "No"; | 313 std::string search_enabled = "No"; |
| 307 if (profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled)) | 314 if (profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled)) |
| 308 search_enabled = "Yes"; | 315 search_enabled = "Yes"; |
| 309 AddPair(list, "Hotword Search Enabled", search_enabled); | 316 AddPair(list, "Hotword Search Enabled", search_enabled); |
| 310 | 317 |
| 311 std::string always_on_search_enabled = "No"; | 318 std::string always_on_search_enabled = "No"; |
| 312 if (profile_->GetPrefs()->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled)) | 319 if (profile_->GetPrefs()->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled)) |
| 313 always_on_search_enabled = "Yes"; | 320 always_on_search_enabled = "Yes"; |
| 314 AddPair(list, "Always-on Hotword Search Enabled", always_on_search_enabled); | 321 AddPair(list, "Always-on Hotword Search Enabled", always_on_search_enabled); |
| 315 | 322 |
| 316 std::string audio_logging_enabled = "No"; | 323 std::string audio_logging_enabled = "No"; |
| 317 HotwordService* hotword_service = | |
| 318 HotwordServiceFactory::GetForProfile(profile_); | |
| 319 if (hotword_service && hotword_service->IsOptedIntoAudioLogging()) | 324 if (hotword_service && hotword_service->IsOptedIntoAudioLogging()) |
| 320 audio_logging_enabled = "Yes"; | 325 audio_logging_enabled = "Yes"; |
| 321 AddPair(list, "Hotword Audio Logging Enabled", audio_logging_enabled); | 326 AddPair(list, "Hotword Audio Logging Enabled", audio_logging_enabled); |
| 322 | 327 |
| 323 AddLineBreak(list); | 328 AddLineBreak(list); |
| 324 } | 329 } |
| 325 | 330 |
| 326 // Adds information specific to an extension to the list. | 331 // Adds information specific to an extension to the list. |
| 327 void AddExtensionInfo(const std::string& extension_id, | 332 void AddExtensionInfo(const std::string& extension_id, |
| 328 const std::string& name_prefix, | 333 const std::string& name_prefix, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) | 438 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) |
| 434 : content::WebUIController(web_ui) { | 439 : content::WebUIController(web_ui) { |
| 435 Profile* profile = Profile::FromWebUI(web_ui); | 440 Profile* profile = Profile::FromWebUI(web_ui); |
| 436 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); | 441 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); |
| 437 | 442 |
| 438 // Set up the about:voicesearch source. | 443 // Set up the about:voicesearch source. |
| 439 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); | 444 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); |
| 440 } | 445 } |
| 441 | 446 |
| 442 VoiceSearchUI::~VoiceSearchUI() {} | 447 VoiceSearchUI::~VoiceSearchUI() {} |
| OLD | NEW |