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 29 matching lines...) Expand all Loading... |
40 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
41 #include "content/public/browser/plugin_service.h" | 41 #include "content/public/browser/plugin_service.h" |
42 #include "content/public/browser/url_data_source.h" | 42 #include "content/public/browser/url_data_source.h" |
43 #include "content/public/browser/web_ui.h" | 43 #include "content/public/browser/web_ui.h" |
44 #include "content/public/browser/web_ui_data_source.h" | 44 #include "content/public/browser/web_ui_data_source.h" |
45 #include "content/public/browser/web_ui_message_handler.h" | 45 #include "content/public/browser/web_ui_message_handler.h" |
46 #include "content/public/common/user_agent.h" | 46 #include "content/public/common/user_agent.h" |
47 #include "extensions/browser/extension_prefs.h" | 47 #include "extensions/browser/extension_prefs.h" |
48 #include "extensions/browser/extension_system.h" | 48 #include "extensions/browser/extension_system.h" |
49 #include "extensions/common/extension.h" | 49 #include "extensions/common/extension.h" |
| 50 #include "extensions/features/features.h" |
50 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
51 #include "v8/include/v8.h" | 52 #include "v8/include/v8.h" |
52 | 53 |
53 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
54 #include "base/win/windows_version.h" | 55 #include "base/win/windows_version.h" |
55 #endif | 56 #endif |
56 | 57 |
57 using base::ASCIIToUTF16; | 58 using base::ASCIIToUTF16; |
58 using content::WebUIMessageHandler; | 59 using content::WebUIMessageHandler; |
59 | 60 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 254 |
254 AddLineBreak(list); | 255 AddLineBreak(list); |
255 } | 256 } |
256 | 257 |
257 // Adds information regarding audio to the list. | 258 // Adds information regarding audio to the list. |
258 void AddAudioInfo(base::ListValue* list) { | 259 void AddAudioInfo(base::ListValue* list) { |
259 // NaCl and its associated functions are not available on most mobile | 260 // NaCl and its associated functions are not available on most mobile |
260 // platforms. ENABLE_EXTENSIONS covers those platforms and hey would not | 261 // platforms. ENABLE_EXTENSIONS covers those platforms and hey would not |
261 // allow Hotwording anyways since it is an extension. | 262 // allow Hotwording anyways since it is an extension. |
262 std::string nacl_enabled = "not available"; | 263 std::string nacl_enabled = "not available"; |
263 #if defined(ENABLE_EXTENSIONS) | 264 #if BUILDFLAG(ENABLE_EXTENSIONS) |
264 nacl_enabled = "No"; | 265 nacl_enabled = "No"; |
265 // Determine if NaCl is available. | 266 // Determine if NaCl is available. |
266 base::FilePath path; | 267 base::FilePath path; |
267 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 268 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
268 content::WebPluginInfo info; | 269 content::WebPluginInfo info; |
269 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); | 270 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); |
270 if (content::PluginService::GetInstance()->GetPluginInfoByPath(path, | 271 if (content::PluginService::GetInstance()->GetPluginInfoByPath(path, |
271 &info) && | 272 &info) && |
272 plugin_prefs->IsPluginEnabled(info)) { | 273 plugin_prefs->IsPluginEnabled(info)) { |
273 nacl_enabled = "Yes"; | 274 nacl_enabled = "Yes"; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) | 437 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) |
437 : content::WebUIController(web_ui) { | 438 : content::WebUIController(web_ui) { |
438 Profile* profile = Profile::FromWebUI(web_ui); | 439 Profile* profile = Profile::FromWebUI(web_ui); |
439 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); | 440 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); |
440 | 441 |
441 // Set up the about:voicesearch source. | 442 // Set up the about:voicesearch source. |
442 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); | 443 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); |
443 } | 444 } |
444 | 445 |
445 VoiceSearchUI::~VoiceSearchUI() {} | 446 VoiceSearchUI::~VoiceSearchUI() {} |
OLD | NEW |