diff options
author | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 00:52:00 +0000 |
---|---|---|
committer | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 00:52:00 +0000 |
commit | 9a128b022f10d7080a8fae777d0bbda5750842f8 (patch) | |
tree | 43094a52595cc223cdea5b9ced279d65f209accf /chrome/browser/dom_ui/net_internals_ui.cc | |
parent | e31ed71893f0ca0d95087899137f35353ed7bd13 (diff) | |
download | chromium_src-9a128b022f10d7080a8fae777d0bbda5750842f8.zip chromium_src-9a128b022f10d7080a8fae777d0bbda5750842f8.tar.gz chromium_src-9a128b022f10d7080a8fae777d0bbda5750842f8.tar.bz2 |
Sitch the about:gpu implementation from an about handler to dom_ui.
Generalize tabswitcherview slightly so it doesn't rely on div naming to
obtain its styling.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5228004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/net_internals_ui.cc')
-rw-r--r-- | chrome/browser/dom_ui/net_internals_ui.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc index 8fa9e9b8..f44ac9e 100644 --- a/chrome/browser/dom_ui/net_internals_ui.cc +++ b/chrome/browser/dom_ui/net_internals_ui.cc @@ -32,6 +32,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_version_info.h" +#include "chrome/common/jstemplate_builder.h" #include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" @@ -319,6 +320,9 @@ NetInternalsHTMLSource::NetInternalsHTMLSource() void NetInternalsHTMLSource::StartDataRequest(const std::string& path, bool is_off_the_record, int request_id) { + DictionaryValue localized_strings; + SetFontAndTextDirection(&localized_strings); + // The provided "path" may contain a fragment, or query section. We only // care about the path itself, and will disregard anything else. std::string filename = @@ -329,13 +333,20 @@ void NetInternalsHTMLSource::StartDataRequest(const std::string& path, // Note that users can type anything into the address bar, though, so we must // handle arbitrary input. if (filename.empty() || filename == "index.html") { - scoped_refptr<RefCountedStaticMemory> bytes( - ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + base::StringPiece html( + ResourceBundle::GetSharedInstance().GetRawDataResource( IDR_NET_INTERNALS_INDEX_HTML)); - if (bytes && bytes->front()) { - SendResponse(request_id, bytes); - return; - } + std::string full_html(html.data(), html.size()); + jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); + jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); + jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); + jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); + + scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); + html_bytes->data.resize(full_html.size()); + std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); + SendResponse(request_id, html_bytes); + return; } const std::string data_string("<p style='color:red'>Failed to read resource" + |