Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: chrome/browser/ui/webui/voice_search_ui.cc

Issue 1269773002: Cleanup VersionInfo after componentization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/metrics/field_trial.h" 12 #include "base/metrics/field_trial.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/plugins/plugin_prefs.h" 19 #include "chrome/browser/plugins/plugin_prefs.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/search/hotword_service.h" 21 #include "chrome/browser/search/hotword_service.h"
22 #include "chrome/browser/search/hotword_service_factory.h" 22 #include "chrome/browser/search/hotword_service_factory.h"
23 #include "chrome/browser/ui/app_list/start_page_service.h" 23 #include "chrome/browser/ui/app_list/start_page_service.h"
24 #include "chrome/browser/ui/webui/version_handler.h" 24 #include "chrome/browser/ui/webui/version_handler.h"
25 #include "chrome/common/channel_info.h"
25 #include "chrome/common/chrome_content_client.h" 26 #include "chrome/common/chrome_content_client.h"
26 #include "chrome/common/chrome_paths.h" 27 #include "chrome/common/chrome_paths.h"
27 #include "chrome/common/chrome_version_info.h"
28 #include "chrome/common/extensions/extension_constants.h" 28 #include "chrome/common/extensions/extension_constants.h"
29 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
30 #include "chrome/common/url_constants.h" 30 #include "chrome/common/url_constants.h"
31 #include "chrome/grit/chromium_strings.h" 31 #include "chrome/grit/chromium_strings.h"
32 #include "chrome/grit/generated_resources.h" 32 #include "chrome/grit/generated_resources.h"
33 #include "components/version_info/version_info.h"
33 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/plugin_service.h" 35 #include "content/public/browser/plugin_service.h"
35 #include "content/public/browser/url_data_source.h" 36 #include "content/public/browser/url_data_source.h"
36 #include "content/public/browser/web_ui.h" 37 #include "content/public/browser/web_ui.h"
37 #include "content/public/browser/web_ui_data_source.h" 38 #include "content/public/browser/web_ui_data_source.h"
38 #include "content/public/browser/web_ui_message_handler.h" 39 #include "content/public/browser/web_ui_message_handler.h"
39 #include "content/public/common/user_agent.h" 40 #include "content/public/common/user_agent.h"
40 #include "extensions/browser/extension_prefs.h" 41 #include "extensions/browser/extension_prefs.h"
41 #include "extensions/browser/extension_system.h" 42 #include "extensions/browser/extension_system.h"
42 #include "extensions/common/extension.h" 43 #include "extensions/common/extension.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 raw_list, 203 raw_list,
203 path, 204 path,
204 base::Bind(&VoiceSearchDomHandler::ReturnVoiceSearchInfo, 205 base::Bind(&VoiceSearchDomHandler::ReturnVoiceSearchInfo,
205 weak_factory_.GetWeakPtr(), 206 weak_factory_.GetWeakPtr(),
206 base::Passed(list.Pass())))); 207 base::Passed(list.Pass()))));
207 } 208 }
208 209
209 // Adds information regarding the system and chrome version info to list. 210 // Adds information regarding the system and chrome version info to list.
210 void AddOperatingSystemInfo(base::ListValue* list) { 211 void AddOperatingSystemInfo(base::ListValue* list) {
211 // Obtain the Chrome version info. 212 // Obtain the Chrome version info.
212 chrome::VersionInfo version_info;
213 AddPair(list, 213 AddPair(list,
214 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME), 214 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME),
215 version_info.Version() + " (" + 215 version_info::GetVersionNumber() + " (" +
216 chrome::VersionInfo::GetVersionStringModifier() + ")"); 216 chrome::GetChannelString() + ")");
217 217
218 // OS version information. 218 // OS version information.
219 std::string os_label = version_info.OSType(); 219 std::string os_label = version_info::GetOSType();
220 #if defined(OS_WIN) 220 #if defined(OS_WIN)
221 base::win::OSInfo* os = base::win::OSInfo::GetInstance(); 221 base::win::OSInfo* os = base::win::OSInfo::GetInstance();
222 switch (os->version()) { 222 switch (os->version()) {
223 case base::win::VERSION_XP: 223 case base::win::VERSION_XP:
224 os_label += " XP"; 224 os_label += " XP";
225 break; 225 break;
226 case base::win::VERSION_SERVER_2003: 226 case base::win::VERSION_SERVER_2003:
227 os_label += " Server 2003 or XP Pro 64 bit"; 227 os_label += " Server 2003 or XP Pro 64 bit";
228 break; 228 break;
229 case base::win::VERSION_VISTA: 229 case base::win::VERSION_VISTA:
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui) 434 VoiceSearchUI::VoiceSearchUI(content::WebUI* web_ui)
435 : content::WebUIController(web_ui) { 435 : content::WebUIController(web_ui) {
436 Profile* profile = Profile::FromWebUI(web_ui); 436 Profile* profile = Profile::FromWebUI(web_ui);
437 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile)); 437 web_ui->AddMessageHandler(new VoiceSearchDomHandler(profile));
438 438
439 // Set up the about:voicesearch source. 439 // Set up the about:voicesearch source.
440 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource()); 440 content::WebUIDataSource::Add(profile, CreateVoiceSearchUiHtmlSource());
441 } 441 }
442 442
443 VoiceSearchUI::~VoiceSearchUI() {} 443 VoiceSearchUI::~VoiceSearchUI() {}
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/version_ui.cc ('k') | chrome/browser/update_client/chrome_update_query_params_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698