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

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

Issue 7003007: Apply content-security-policy to the HTML options page. This is a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/common_resources.grd ('k') | chrome/common/jstemplate_builder.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 // This provides some helper methods for building and rendering an 5 // This provides some helper methods for building and rendering an
6 // internal html page. The flow is as follows: 6 // internal html page. The flow is as follows:
7 // - instantiate a builder given a webframe that we're going to render content 7 // - instantiate a builder given a webframe that we're going to render content
8 // into 8 // into
9 // - load the template html and load the jstemplate javascript into the frame 9 // - load the template html and load the jstemplate javascript into the frame
10 // - given a json data object, run the jstemplate javascript which fills in 10 // - given a json data object, run the jstemplate javascript which fills in
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const DictionaryValue* json, 43 const DictionaryValue* json,
44 const base::StringPiece& template_id); 44 const base::StringPiece& template_id);
45 45
46 // The following functions build up the different parts that the above 46 // The following functions build up the different parts that the above
47 // templates use. 47 // templates use.
48 48
49 // Appends a script tag with a variable name |templateData| that has the JSON 49 // Appends a script tag with a variable name |templateData| that has the JSON
50 // assigned to it. 50 // assigned to it.
51 void AppendJsonHtml(const DictionaryValue* json, std::string* output); 51 void AppendJsonHtml(const DictionaryValue* json, std::string* output);
52 52
53 // Same as AppendJsonHtml(), execpt does not include the <script></script>
54 // tag wrappers.
55 void AppendJsonJS(const DictionaryValue* json, std::string* output);
56
53 // Appends the source for JsTemplates in a script tag. 57 // Appends the source for JsTemplates in a script tag.
54 void AppendJsTemplateSourceHtml(std::string* output); 58 void AppendJsTemplateSourceHtml(std::string* output);
55 59
56 // Appends the code that processes the JsTemplate with the JSON. You should 60 // Appends the code that processes the JsTemplate with the JSON. You should
57 // call AppendJsTemplateSourceHtml and AppendJsonHtml before calling this. 61 // call AppendJsTemplateSourceHtml and AppendJsonHtml before calling this.
58 void AppendJsTemplateProcessHtml(const base::StringPiece& template_id, 62 void AppendJsTemplateProcessHtml(const base::StringPiece& template_id,
59 std::string* output); 63 std::string* output);
60 64
61 // Appends the source for i18n Templates in a script tag. 65 // Appends the source for i18n Templates in a script tag.
62 void AppendI18nTemplateSourceHtml(std::string* output); 66 void AppendI18nTemplateSourceHtml(std::string* output);
63 67
64 // Appends the code that processes the i18n Template with the JSON. You 68 // Appends the code that processes the i18n Template with the JSON. You
65 // should call AppendJsTemplateSourceHtml and AppendJsonHtml before calling 69 // should call AppendJsTemplateSourceHtml and AppendJsonHtml before calling
66 // this. 70 // this.
67 void AppendI18nTemplateProcessHtml(std::string* output); 71 void AppendI18nTemplateProcessHtml(std::string* output);
68 72
69 } // namespace jstemplate_builder 73 } // namespace jstemplate_builder
70 #endif // CHROME_COMMON_JSTEMPLATE_BUILDER_H_ 74 #endif // CHROME_COMMON_JSTEMPLATE_BUILDER_H_
OLDNEW
« no previous file with comments | « chrome/common/common_resources.grd ('k') | chrome/common/jstemplate_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698