OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "net/url_request/url_request_view_net_internal_job.h" | 7 #include "net/url_request/url_request_view_net_internal_job.h" |
8 | 8 |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 std::string path = request_->url().path(); | 368 std::string path = request_->url().path(); |
369 | 369 |
370 data->clear(); | 370 data->clear(); |
371 data->append("<html><head><title>Network internals</title>" | 371 data->append("<html><head><title>Network internals</title>" |
372 "<style>" | 372 "<style>" |
373 "body { font-family: sans-serif; }\n" | 373 "body { font-family: sans-serif; }\n" |
374 ".subsection_body { margin: 10px 0 10px 2em; }\n" | 374 ".subsection_body { margin: 10px 0 10px 2em; }\n" |
375 ".subsection_title { font-weight: bold; }\n" | 375 ".subsection_title { font-weight: bold; }\n" |
376 ".subsection_name { font-size: 80%; }\n" | 376 ".subsection_name { font-size: 80%; }\n" |
377 "</style>" | 377 "</style>" |
378 "</head><body>"); | 378 "</head><body>" |
| 379 "<p><a href='http://sites.google.com/a/chromium.org/dev/" |
| 380 "developers/design-documents/view-net-internal'>" |
| 381 "Help: how do I use this?</a></p>"); |
379 | 382 |
380 SubSection* all = Singleton<AllSubSections>::get(); | 383 SubSection* all = Singleton<AllSubSections>::get(); |
381 SubSection* section = all; | 384 SubSection* section = all; |
382 | 385 |
383 // Display only the subsection tree asked for. | 386 // Display only the subsection tree asked for. |
384 if (!path.empty()) | 387 if (!path.empty()) |
385 section = all->FindSubSectionByName(path); | 388 section = all->FindSubSectionByName(path); |
386 | 389 |
387 if (section) { | 390 if (section) { |
388 section->OutputRecursive(context, data); | 391 section->OutputRecursive(context, data); |
389 } else { | 392 } else { |
390 data->append("<i>Nothing found for \""); | 393 data->append("<i>Nothing found for \""); |
391 data->append(EscapeForHTML(path)); | 394 data->append(EscapeForHTML(path)); |
392 data->append("\"</i>"); | 395 data->append("\"</i>"); |
393 } | 396 } |
394 | 397 |
395 data->append("</body></html>"); | 398 data->append("</body></html>"); |
396 | 399 |
397 return true; | 400 return true; |
398 } | 401 } |
399 | 402 |
OLD | NEW |