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

Side by Side Diff: chrome/browser/ui/webui/sync_internals_html_source.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/sessions_ui.cc ('k') | chrome/browser/ui/webui/task_manager_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/sync_internals_html_source.h" 5 #include "chrome/browser/ui/webui/sync_internals_html_source.h"
6 6
7 #include <algorithm>
8
9 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
10 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
11 #include "base/message_loop.h" 9 #include "base/message_loop.h"
12 #include "base/string_piece.h" 10 #include "base/string_piece.h"
13 #include "base/values.h" 11 #include "base/values.h"
14 #include "chrome/common/jstemplate_builder.h" 12 #include "chrome/common/jstemplate_builder.h"
15 #include "chrome/common/url_constants.h" 13 #include "chrome/common/url_constants.h"
16 #include "grit/sync_internals_resources.h" 14 #include "grit/sync_internals_resources.h"
17 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
18 16
(...skipping 11 matching lines...) Expand all
30 IDR_SYNC_INTERNALS_INDEX_HTML)); 28 IDR_SYNC_INTERNALS_INDEX_HTML));
31 DictionaryValue localized_strings; 29 DictionaryValue localized_strings;
32 SetFontAndTextDirection(&localized_strings); 30 SetFontAndTextDirection(&localized_strings);
33 31
34 std::string html(html_template.data(), html_template.size()); 32 std::string html(html_template.data(), html_template.size());
35 jstemplate_builder::AppendI18nTemplateSourceHtml(&html); 33 jstemplate_builder::AppendI18nTemplateSourceHtml(&html);
36 jstemplate_builder::AppendJsTemplateSourceHtml(&html); 34 jstemplate_builder::AppendJsTemplateSourceHtml(&html);
37 jstemplate_builder::AppendJsonHtml(&localized_strings, &html); 35 jstemplate_builder::AppendJsonHtml(&localized_strings, &html);
38 jstemplate_builder::AppendI18nTemplateProcessHtml(&html); 36 jstemplate_builder::AppendI18nTemplateProcessHtml(&html);
39 37
40 scoped_refptr<RefCountedBytes> bytes(new RefCountedBytes()); 38 SendResponse(request_id, base::RefCountedString::TakeString(&html));
41 bytes->data.resize(html.size());
42 std::copy(html.begin(), html.end(), bytes->data.begin());
43 SendResponse(request_id, bytes);
44 } 39 }
45 40
46 std::string SyncInternalsHTMLSource::GetMimeType( 41 std::string SyncInternalsHTMLSource::GetMimeType(
47 const std::string& path) const { 42 const std::string& path) const {
48 return "text/html"; 43 return "text/html";
49 } 44 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sessions_ui.cc ('k') | chrome/browser/ui/webui/task_manager_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698