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

Side by Side Diff: chrome/browser/ui/webui/gpu_internals_ui.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/fileicon_source.cc ('k') | chrome/browser/ui/webui/history2_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gpu_internals_ui.h" 5 #include "chrome/browser/ui/webui/gpu_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 base::StringPiece gpu_html( 168 base::StringPiece gpu_html(
169 ResourceBundle::GetSharedInstance().GetRawDataResource( 169 ResourceBundle::GetSharedInstance().GetRawDataResource(
170 IDR_GPU_INTERNALS_HTML)); 170 IDR_GPU_INTERNALS_HTML));
171 std::string full_html(gpu_html.data(), gpu_html.size()); 171 std::string full_html(gpu_html.data(), gpu_html.size());
172 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); 172 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html);
173 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); 173 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html);
174 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); 174 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html);
175 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); 175 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html);
176 176
177 177
178 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); 178 SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
179 html_bytes->data.resize(full_html.size());
180 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin());
181
182 SendResponse(request_id, html_bytes);
183 } 179 }
184 180
185 std::string GpuHTMLSource::GetMimeType(const std::string&) const { 181 std::string GpuHTMLSource::GetMimeType(const std::string&) const {
186 return "text/html"; 182 return "text/html";
187 } 183 }
188 184
189 //////////////////////////////////////////////////////////////////////////////// 185 ////////////////////////////////////////////////////////////////////////////////
190 // 186 //
191 // GpuMessageHandler 187 // GpuMessageHandler
192 // 188 //
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 //////////////////////////////////////////////////////////////////////////////// 637 ////////////////////////////////////////////////////////////////////////////////
642 638
643 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : ChromeWebUI(contents) { 639 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : ChromeWebUI(contents) {
644 AddMessageHandler((new GpuMessageHandler())->Attach(this)); 640 AddMessageHandler((new GpuMessageHandler())->Attach(this));
645 641
646 GpuHTMLSource* html_source = new GpuHTMLSource(); 642 GpuHTMLSource* html_source = new GpuHTMLSource();
647 643
648 // Set up the chrome://gpu/ source. 644 // Set up the chrome://gpu/ source.
649 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); 645 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
650 } 646 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/fileicon_source.cc ('k') | chrome/browser/ui/webui/history2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698