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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/net_internals/net_internals_ui.h" 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 22 matching lines...) Expand all
33 #include "chrome/browser/chrome_notification_types.h" 33 #include "chrome/browser/chrome_notification_types.h"
34 #include "chrome/browser/download/download_prefs.h" 34 #include "chrome/browser/download/download_prefs.h"
35 #include "chrome/browser/io_thread.h" 35 #include "chrome/browser/io_thread.h"
36 #include "chrome/browser/net/chrome_net_log.h" 36 #include "chrome/browser/net/chrome_net_log.h"
37 #include "chrome/browser/net/chrome_network_delegate.h" 37 #include "chrome/browser/net/chrome_network_delegate.h"
38 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 38 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
39 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" 39 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
40 #include "chrome/browser/prerender/prerender_manager.h" 40 #include "chrome/browser/prerender/prerender_manager.h"
41 #include "chrome/browser/prerender/prerender_manager_factory.h" 41 #include "chrome/browser/prerender/prerender_manager_factory.h"
42 #include "chrome/browser/profiles/profile.h" 42 #include "chrome/browser/profiles/profile.h"
43 #include "chrome/common/channel_info.h"
43 #include "chrome/common/chrome_paths.h" 44 #include "chrome/common/chrome_paths.h"
44 #include "chrome/common/chrome_version_info.h"
45 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h" 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h"
48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h" 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h"
49 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h" 49 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h"
50 #include "components/onc/onc_constants.h" 50 #include "components/onc/onc_constants.h"
51 #include "components/url_fixer/url_fixer.h" 51 #include "components/url_fixer/url_fixer.h"
52 #include "components/version_info/version_info.h"
52 #include "content/public/browser/browser_thread.h" 53 #include "content/public/browser/browser_thread.h"
53 #include "content/public/browser/notification_details.h" 54 #include "content/public/browser/notification_details.h"
54 #include "content/public/browser/resource_dispatcher_host.h" 55 #include "content/public/browser/resource_dispatcher_host.h"
55 #include "content/public/browser/web_contents.h" 56 #include "content/public/browser/web_contents.h"
56 #include "content/public/browser/web_ui.h" 57 #include "content/public/browser/web_ui.h"
57 #include "content/public/browser/web_ui_data_source.h" 58 #include "content/public/browser/web_ui_data_source.h"
58 #include "content/public/browser/web_ui_message_handler.h" 59 #include "content/public/browser/web_ui_message_handler.h"
59 #include "grit/net_internals_resources.h" 60 #include "grit/net_internals_resources.h"
60 #include "net/base/net_errors.h" 61 #include "net/base/net_errors.h"
61 #include "net/base/net_util.h" 62 #include "net/base/net_util.h"
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 // static 1165 // static
1165 base::Value* NetInternalsUI::GetConstants() { 1166 base::Value* NetInternalsUI::GetConstants() {
1166 scoped_ptr<base::DictionaryValue> constants_dict = net::GetNetConstants(); 1167 scoped_ptr<base::DictionaryValue> constants_dict = net::GetNetConstants();
1167 DCHECK(constants_dict); 1168 DCHECK(constants_dict);
1168 1169
1169 // Add a dictionary with the version of the client and its command line 1170 // Add a dictionary with the version of the client and its command line
1170 // arguments. 1171 // arguments.
1171 { 1172 {
1172 base::DictionaryValue* dict = new base::DictionaryValue(); 1173 base::DictionaryValue* dict = new base::DictionaryValue();
1173 1174
1174 chrome::VersionInfo version_info;
1175
1176 // We have everything we need to send the right values. 1175 // We have everything we need to send the right values.
1177 dict->SetString("name", version_info.Name()); 1176 dict->SetString("name", version_info::GetProductName());
1178 dict->SetString("version", version_info.Version()); 1177 dict->SetString("version", version_info::GetVersionNumber());
1179 dict->SetString("cl", version_info.LastChange()); 1178 dict->SetString("cl", version_info::GetLastChange());
1180 dict->SetString("version_mod", 1179 dict->SetString("version_mod", chrome::GetChannelString());
1181 chrome::VersionInfo::GetVersionStringModifier()); 1180 dict->SetString("official", version_info::IsOfficialBuild() ? "official"
1182 dict->SetString("official", 1181 : "unofficial");
1183 version_info.IsOfficialBuild() ? "official" : "unofficial"); 1182 dict->SetString("os_type", version_info::GetOSType());
1184 dict->SetString("os_type", version_info.OSType());
1185 dict->SetString( 1183 dict->SetString(
1186 "command_line", 1184 "command_line",
1187 base::CommandLine::ForCurrentProcess()->GetCommandLineString()); 1185 base::CommandLine::ForCurrentProcess()->GetCommandLineString());
1188 1186
1189 constants_dict->Set("clientInfo", dict); 1187 constants_dict->Set("clientInfo", dict);
1190 1188
1191 data_reduction_proxy::DataReductionProxyEventStore::AddConstants( 1189 data_reduction_proxy::DataReductionProxyEventStore::AddConstants(
1192 constants_dict.get()); 1190 constants_dict.get());
1193 } 1191 }
1194 1192
1195 return constants_dict.release(); 1193 return constants_dict.release();
1196 } 1194 }
1197 1195
1198 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1196 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1199 : WebUIController(web_ui) { 1197 : WebUIController(web_ui) {
1200 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1198 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1201 1199
1202 // Set up the chrome://net-internals/ source. 1200 // Set up the chrome://net-internals/ source.
1203 Profile* profile = Profile::FromWebUI(web_ui); 1201 Profile* profile = Profile::FromWebUI(web_ui);
1204 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1202 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1205 } 1203 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/nacl_ui.cc ('k') | chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698