| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/json/json_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| 11 #include "base/json/json_string_value_serializer.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 13 #include "grit/common_resources.h" | 14 #include "grit/common_resources.h" |
| 14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 15 | 16 |
| 16 namespace jstemplate_builder { | 17 namespace jstemplate_builder { |
| 17 | 18 |
| 18 std::string GetTemplateHtml(const base::StringPiece& html_template, | 19 std::string GetTemplateHtml(const base::StringPiece& html_template, |
| 19 const DictionaryValue* json, | 20 const DictionaryValue* json, |
| 20 const base::StringPiece& template_id) { | 21 const base::StringPiece& template_id) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 NOTREACHED() << "Unable to get i18n process src"; | 123 NOTREACHED() << "Unable to get i18n process src"; |
| 123 return; | 124 return; |
| 124 } | 125 } |
| 125 | 126 |
| 126 output->append("<script>"); | 127 output->append("<script>"); |
| 127 output->append(i18n_process_src.data(), i18n_process_src.size()); | 128 output->append(i18n_process_src.data(), i18n_process_src.size()); |
| 128 output->append("</script>"); | 129 output->append("</script>"); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace jstemplate_builder | 132 } // namespace jstemplate_builder |
| OLD | NEW |