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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 2149323003: Change the way that gzipped resources are loaded from resources.pak (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return context->http_transaction_factory()->GetSession(); 169 return context->http_transaction_factory()->GetSession();
170 } 170 }
171 171
172 content::WebUIDataSource* CreateNetInternalsHTMLSource() { 172 content::WebUIDataSource* CreateNetInternalsHTMLSource() {
173 content::WebUIDataSource* source = 173 content::WebUIDataSource* source =
174 content::WebUIDataSource::Create(chrome::kChromeUINetInternalsHost); 174 content::WebUIDataSource::Create(chrome::kChromeUINetInternalsHost);
175 175
176 source->SetDefaultResource(IDR_NET_INTERNALS_INDEX_HTML); 176 source->SetDefaultResource(IDR_NET_INTERNALS_INDEX_HTML);
177 source->AddResourcePath("index.js", IDR_NET_INTERNALS_INDEX_JS); 177 source->AddResourcePath("index.js", IDR_NET_INTERNALS_INDEX_JS);
178 source->SetJsonPath("strings.js"); 178 source->SetJsonPath("strings.js");
179 source->UseGzipForAllPaths();
179 return source; 180 return source;
180 } 181 }
181 182
182 // This class receives javascript messages from the renderer. 183 // This class receives javascript messages from the renderer.
183 // Note that the WebUI infrastructure runs on the UI thread, therefore all of 184 // Note that the WebUI infrastructure runs on the UI thread, therefore all of
184 // this class's methods are expected to run on the UI thread. 185 // this class's methods are expected to run on the UI thread.
185 // 186 //
186 // Since the network code we want to run lives on the IO thread, we proxy 187 // Since the network code we want to run lives on the IO thread, we proxy
187 // almost everything over to NetInternalsMessageHandler::IOThreadImpl, which 188 // almost everything over to NetInternalsMessageHandler::IOThreadImpl, which
188 // runs on the IO thread. 189 // runs on the IO thread.
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 //////////////////////////////////////////////////////////////////////////////// 1183 ////////////////////////////////////////////////////////////////////////////////
1183 1184
1184 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1185 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1185 : WebUIController(web_ui) { 1186 : WebUIController(web_ui) {
1186 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1187 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1187 1188
1188 // Set up the chrome://net-internals/ source. 1189 // Set up the chrome://net-internals/ source.
1189 Profile* profile = Profile::FromWebUI(web_ui); 1190 Profile* profile = Profile::FromWebUI(web_ui);
1190 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1191 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1191 } 1192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698