OLD | NEW |
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 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/net/chrome_network_delegate.h" | 37 #include "chrome/browser/net/chrome_network_delegate.h" |
38 #include "chrome/browser/net/connection_tester.h" | 38 #include "chrome/browser/net/connection_tester.h" |
39 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 39 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
40 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 40 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
41 #include "chrome/browser/prerender/prerender_manager.h" | 41 #include "chrome/browser/prerender/prerender_manager.h" |
42 #include "chrome/browser/prerender/prerender_manager_factory.h" | 42 #include "chrome/browser/prerender/prerender_manager_factory.h" |
43 #include "chrome/browser/profiles/profile.h" | 43 #include "chrome/browser/profiles/profile.h" |
44 #include "chrome/common/chrome_paths.h" | 44 #include "chrome/common/chrome_paths.h" |
45 #include "chrome/common/chrome_version_info.h" | 45 #include "chrome/common/chrome_version_info.h" |
46 #include "chrome/common/url_constants.h" | 46 #include "chrome/common/url_constants.h" |
| 47 #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" | 48 #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" | 49 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" |
49 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" | |
50 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_store.h" | 50 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_store.h" |
51 #include "components/onc/onc_constants.h" | 51 #include "components/onc/onc_constants.h" |
52 #include "components/url_fixer/url_fixer.h" | 52 #include "components/url_fixer/url_fixer.h" |
53 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
54 #include "content/public/browser/notification_details.h" | 54 #include "content/public/browser/notification_details.h" |
55 #include "content/public/browser/resource_dispatcher_host.h" | 55 #include "content/public/browser/resource_dispatcher_host.h" |
56 #include "content/public/browser/web_contents.h" | 56 #include "content/public/browser/web_contents.h" |
57 #include "content/public/browser/web_ui.h" | 57 #include "content/public/browser/web_ui.h" |
58 #include "content/public/browser/web_ui_data_source.h" | 58 #include "content/public/browser/web_ui_data_source.h" |
59 #include "content/public/browser/web_ui_message_handler.h" | 59 #include "content/public/browser/web_ui_message_handler.h" |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 } | 585 } |
586 | 586 |
587 void NetInternalsMessageHandler::OnGetHistoricNetworkStats( | 587 void NetInternalsMessageHandler::OnGetHistoricNetworkStats( |
588 const base::ListValue* list) { | 588 const base::ListValue* list) { |
589 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 589 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
590 base::Value* historic_network_info = NULL; | 590 base::Value* historic_network_info = NULL; |
591 Profile* profile = Profile::FromWebUI(web_ui()); | 591 Profile* profile = Profile::FromWebUI(web_ui()); |
592 DataReductionProxyChromeSettings* data_reduction_proxy_settings = | 592 DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
593 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | 593 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); |
594 if (data_reduction_proxy_settings) { | 594 if (data_reduction_proxy_settings) { |
595 data_reduction_proxy::DataReductionProxyStatisticsPrefs* statistics_prefs = | 595 data_reduction_proxy::DataReductionProxyCompressionStats* |
596 data_reduction_proxy_settings->data_reduction_proxy_service()-> | 596 compression_stats = |
597 statistics_prefs(); | 597 data_reduction_proxy_settings->data_reduction_proxy_service() |
598 historic_network_info = statistics_prefs->HistoricNetworkStatsInfoToValue(); | 598 ->compression_stats(); |
| 599 historic_network_info = |
| 600 compression_stats->HistoricNetworkStatsInfoToValue(); |
599 } | 601 } |
600 SendJavascriptCommand("receivedHistoricNetworkStats", historic_network_info); | 602 SendJavascriptCommand("receivedHistoricNetworkStats", historic_network_info); |
601 } | 603 } |
602 | 604 |
603 void NetInternalsMessageHandler::OnGetExtensionInfo( | 605 void NetInternalsMessageHandler::OnGetExtensionInfo( |
604 const base::ListValue* list) { | 606 const base::ListValue* list) { |
605 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 607 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
606 base::ListValue* extension_list = new base::ListValue(); | 608 base::ListValue* extension_list = new base::ListValue(); |
607 #if defined(ENABLE_EXTENSIONS) | 609 #if defined(ENABLE_EXTENSIONS) |
608 Profile* profile = Profile::FromWebUI(web_ui()); | 610 Profile* profile = Profile::FromWebUI(web_ui()); |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 } | 1288 } |
1287 | 1289 |
1288 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1290 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1289 : WebUIController(web_ui) { | 1291 : WebUIController(web_ui) { |
1290 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1292 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1291 | 1293 |
1292 // Set up the chrome://net-internals/ source. | 1294 // Set up the chrome://net-internals/ source. |
1293 Profile* profile = Profile::FromWebUI(web_ui); | 1295 Profile* profile = Profile::FromWebUI(web_ui); |
1294 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1296 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1295 } | 1297 } |
OLD | NEW |