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

Unified Diff: chrome/common/jstemplate_builder.h

Issue 11929016: Move jstemplate_builder.* to ui\webui so it can be reused by webui implementations outside of chrom… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to 177705 to get yfriendman's fix Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/descriptors_android.h ('k') | chrome/common/jstemplate_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/jstemplate_builder.h
===================================================================
--- chrome/common/jstemplate_builder.h (revision 177707)
+++ chrome/common/jstemplate_builder.h (working copy)
@@ -1,86 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This provides some helper methods for building and rendering an
-// internal html page. The flow is as follows:
-// - instantiate a builder given a webframe that we're going to render content
-// into
-// - load the template html and load the jstemplate javascript into the frame
-// - given a json data object, run the jstemplate javascript which fills in
-// template values
-
-#ifndef CHROME_COMMON_JSTEMPLATE_BUILDER_H_
-#define CHROME_COMMON_JSTEMPLATE_BUILDER_H_
-
-#include <string>
-
-#include "base/string_piece.h"
-
-namespace base {
-class DictionaryValue;
-}
-
-namespace jstemplate_builder {
-
-// While an object of this class is in scope, the template builder will output
-// version 2 html. Version 2 uses load_time_data.js and i18n_template2.js, and
-// should soon become the default.
-class UseVersion2 {
- public:
- UseVersion2();
- ~UseVersion2();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UseVersion2);
-};
-
-// A helper function that generates a string of HTML to be loaded. The
-// string includes the HTML and the javascript code necessary to generate the
-// full page with support for JsTemplates.
-std::string GetTemplateHtml(const base::StringPiece& html_template,
- const base::DictionaryValue* json,
- const base::StringPiece& template_id);
-
-// A helper function that generates a string of HTML to be loaded. The
-// string includes the HTML and the javascript code necessary to generate the
-// full page with support for i18n Templates.
-std::string GetI18nTemplateHtml(const base::StringPiece& html_template,
- const base::DictionaryValue* json);
-
-// A helper function that generates a string of HTML to be loaded. The
-// string includes the HTML and the javascript code necessary to generate the
-// full page with support for both i18n Templates and JsTemplates.
-std::string GetTemplatesHtml(const base::StringPiece& html_template,
- const base::DictionaryValue* json,
- const base::StringPiece& template_id);
-
-// The following functions build up the different parts that the above
-// templates use.
-
-// Appends a script tag with a variable name |templateData| that has the JSON
-// assigned to it.
-void AppendJsonHtml(const base::DictionaryValue* json, std::string* output);
-
-// Same as AppendJsonHtml(), except does not include the <script></script>
-// tag wrappers.
-void AppendJsonJS(const base::DictionaryValue* json, std::string* output);
-
-// Appends the source for JsTemplates in a script tag.
-void AppendJsTemplateSourceHtml(std::string* output);
-
-// Appends the code that processes the JsTemplate with the JSON. You should
-// call AppendJsTemplateSourceHtml and AppendJsonHtml before calling this.
-void AppendJsTemplateProcessHtml(const base::StringPiece& template_id,
- std::string* output);
-
-// Appends the source for i18n Templates in a script tag.
-void AppendI18nTemplateSourceHtml(std::string* output);
-
-// Appends the code that processes the i18n Template with the JSON. You
-// should call AppendJsTemplateSourceHtml and AppendJsonHtml before calling
-// this.
-void AppendI18nTemplateProcessHtml(std::string* output);
-
-} // namespace jstemplate_builder
-#endif // CHROME_COMMON_JSTEMPLATE_BUILDER_H_
« no previous file with comments | « chrome/common/descriptors_android.h ('k') | chrome/common/jstemplate_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698