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

Side by Side Diff: chrome/common/jstemplate_builder.cc

Issue 6263008: Move ResourceBundle, DataPack to ui/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/common/gfx_resource_provider.cc ('k') | chrome/common/net/net_resource_provider.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // A helper function for using JsTemplate. See jstemplate_builder.h for more 5 // A helper function for using JsTemplate. See jstemplate_builder.h for more
6 // info. 6 // info.
7 7
8 #include "chrome/common/jstemplate_builder.h" 8 #include "chrome/common/jstemplate_builder.h"
9 9
10 #include "app/resource_bundle.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/string_util.h" 11 #include "base/string_util.h"
13 #include "chrome/common/json_value_serializer.h" 12 #include "chrome/common/json_value_serializer.h"
14
15 #include "grit/common_resources.h" 13 #include "grit/common_resources.h"
14 #include "ui/base/resource/resource_bundle.h"
16 15
17 namespace jstemplate_builder { 16 namespace jstemplate_builder {
18 17
19 std::string GetTemplateHtml(const base::StringPiece& html_template, 18 std::string GetTemplateHtml(const base::StringPiece& html_template,
20 const DictionaryValue* json, 19 const DictionaryValue* json,
21 const base::StringPiece& template_id) { 20 const base::StringPiece& template_id) {
22 std::string output(html_template.data(), html_template.size()); 21 std::string output(html_template.data(), html_template.size());
23 AppendJsonHtml(json, &output); 22 AppendJsonHtml(json, &output);
24 AppendJsTemplateSourceHtml(&output); 23 AppendJsTemplateSourceHtml(&output);
25 AppendJsTemplateProcessHtml(template_id, &output); 24 AppendJsTemplateProcessHtml(template_id, &output);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 output->append("</script>"); 106 output->append("</script>");
108 } 107 }
109 108
110 void AppendI18nTemplateProcessHtml(std::string* output) { 109 void AppendI18nTemplateProcessHtml(std::string* output) {
111 output->append("<script>"); 110 output->append("<script>");
112 output->append("i18nTemplate.process(document, templateData);"); 111 output->append("i18nTemplate.process(document, templateData);");
113 output->append("</script>"); 112 output->append("</script>");
114 } 113 }
115 114
116 } // namespace jstemplate_builder 115 } // namespace jstemplate_builder
OLDNEW
« no previous file with comments | « chrome/common/gfx_resource_provider.cc ('k') | chrome/common/net/net_resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698