| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 dict->SetString("host_resolver_experiment", | 196 dict->SetString("host_resolver_experiment", |
| 197 ConnectionTester::HostResolverExperimentDescription( | 197 ConnectionTester::HostResolverExperimentDescription( |
| 198 experiment.host_resolver_experiment)); | 198 experiment.host_resolver_experiment)); |
| 199 return dict; | 199 return dict; |
| 200 } | 200 } |
| 201 | 201 |
| 202 content::WebUIDataSource* CreateNetInternalsHTMLSource() { | 202 content::WebUIDataSource* CreateNetInternalsHTMLSource() { |
| 203 content::WebUIDataSource* source = | 203 content::WebUIDataSource* source = |
| 204 content::WebUIDataSource::Create(chrome::kChromeUINetInternalsHost); | 204 content::WebUIDataSource::Create(chrome::kChromeUINetInternalsHost); |
| 205 | 205 |
| 206 source->SetUseJsonJSFormatV2(); | |
| 207 source->SetDefaultResource(IDR_NET_INTERNALS_INDEX_HTML); | 206 source->SetDefaultResource(IDR_NET_INTERNALS_INDEX_HTML); |
| 208 source->AddResourcePath("index.js", IDR_NET_INTERNALS_INDEX_JS); | 207 source->AddResourcePath("index.js", IDR_NET_INTERNALS_INDEX_JS); |
| 209 source->SetJsonPath("strings.js"); | 208 source->SetJsonPath("strings.js"); |
| 210 return source; | 209 return source; |
| 211 } | 210 } |
| 212 | 211 |
| 213 // This class receives javascript messages from the renderer. | 212 // This class receives javascript messages from the renderer. |
| 214 // Note that the WebUI infrastructure runs on the UI thread, therefore all of | 213 // Note that the WebUI infrastructure runs on the UI thread, therefore all of |
| 215 // this class's methods are expected to run on the UI thread. | 214 // this class's methods are expected to run on the UI thread. |
| 216 // | 215 // |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 } | 1708 } |
| 1710 | 1709 |
| 1711 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1710 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1712 : WebUIController(web_ui) { | 1711 : WebUIController(web_ui) { |
| 1713 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1712 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
| 1714 | 1713 |
| 1715 // Set up the chrome://net-internals/ source. | 1714 // Set up the chrome://net-internals/ source. |
| 1716 Profile* profile = Profile::FromWebUI(web_ui); | 1715 Profile* profile = Profile::FromWebUI(web_ui); |
| 1717 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1716 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1718 } | 1717 } |
| OLD | NEW |