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

Side by Side Diff: chrome/browser/dom_ui/net_internals_ui.cc

Issue 2008007: Replace about:net-internals with the javascript-based frontend.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: improve a comment Created 10 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/net_internals_ui.h" 5 #include "chrome/browser/dom_ui/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // care about the path itself, and will disregard anything else. 316 // care about the path itself, and will disregard anything else.
317 filename = GURL(std::string("chrome://net/") + path).path().substr(1); 317 filename = GURL(std::string("chrome://net/") + path).path().substr(1);
318 318
319 if (filename.empty()) 319 if (filename.empty())
320 filename = "index.html"; 320 filename = "index.html";
321 321
322 file_path = file_path.AppendASCII(filename); 322 file_path = file_path.AppendASCII(filename);
323 323
324 if (!file_util::ReadFileToString(file_path, &data_string)) { 324 if (!file_util::ReadFileToString(file_path, &data_string)) {
325 LOG(WARNING) << "Could not read resource: " << file_path.value(); 325 LOG(WARNING) << "Could not read resource: " << file_path.value();
326 data_string = StringPrintf( 326 data_string = StringPrintf("<p style='color:red'>Failed to read file "
327 "Failed to read file RESOURCES/net_internals/%s", 327 "RESOURCES/net_internals/%s</p>",
328 filename.c_str()); 328 EscapeForHTML(filename).c_str());
329
330 // During the transition from old implementation to new implementation,
331 // users may be entering the URLs for the old frontend.
332 data_string.append(
333 "<p>Note that the URL scheme for net-internals has changed because of "
334 "its new implementation (bug 37421):</p>"
335 "<ul>"
336 "<li>chrome://net-internals/proxyservice.* &rarr; "
337 "<a href='chrome://net-internals#proxy'>chrome://net-internals#proxy"
338 "</a></li>"
339 "<li>chrome://net-internals/hostresolver.* &rarr; <a href='chrome://net"
340 "-internals#dns'>chrome://net-internals#dns</a></li>"
341 "<li>chrome://net-internals/urlrequest.* &rarr; <a href='chrome://net-"
342 "internals#requests'>chrome://net-internals#requests</a></li>"
343 "<li>chrome://net-internals/ (overview for copy-pasting) &rarr; <a href"
344 "='chrome://net-internals#data'>chrome://net-internals#data</a></li>"
345 "<li>chrome://net-internals/view-cache/* &rarr; <a href="
346 "'chrome://view-http-cache'>chrome://view-http-cache</a></li>"
347 "</ul>");
329 } 348 }
330 349
331 scoped_refptr<RefCountedBytes> bytes(new RefCountedBytes); 350 scoped_refptr<RefCountedBytes> bytes(new RefCountedBytes);
332 bytes->data.resize(data_string.size()); 351 bytes->data.resize(data_string.size());
333 std::copy(data_string.begin(), data_string.end(), bytes->data.begin()); 352 std::copy(data_string.begin(), data_string.end(), bytes->data.begin());
334 353
335 SendResponse(request_id, bytes); 354 SendResponse(request_id, bytes);
336 } 355 }
337 356
338 std::string NetInternalsHTMLSource::GetMimeType(const std::string&) const { 357 std::string NetInternalsHTMLSource::GetMimeType(const std::string&) const {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); 851 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource();
833 852
834 // Set up the chrome://net-internals/ source. 853 // Set up the chrome://net-internals/ source.
835 ChromeThread::PostTask( 854 ChromeThread::PostTask(
836 ChromeThread::IO, FROM_HERE, 855 ChromeThread::IO, FROM_HERE,
837 NewRunnableMethod( 856 NewRunnableMethod(
838 Singleton<ChromeURLDataManager>::get(), 857 Singleton<ChromeURLDataManager>::get(),
839 &ChromeURLDataManager::AddDataSource, 858 &ChromeURLDataManager::AddDataSource,
840 make_scoped_refptr(html_source))); 859 make_scoped_refptr(html_source)));
841 } 860 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/chrome_url_data_manager.cc ('k') | chrome/browser/net/view_http_cache_job_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698