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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 } | 1729 } |
1731 | 1730 |
1732 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1731 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1733 : WebUIController(web_ui) { | 1732 : WebUIController(web_ui) { |
1734 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1733 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1735 | 1734 |
1736 // Set up the chrome://net-internals/ source. | 1735 // Set up the chrome://net-internals/ source. |
1737 Profile* profile = Profile::FromWebUI(web_ui); | 1736 Profile* profile = Profile::FromWebUI(web_ui); |
1738 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1737 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1739 } | 1738 } |
OLD | NEW |