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

Unified Diff: chrome/browser/resources/file_manager/js/util.js

Issue 10834354: Refactor the Photo Editor to enable new feature work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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/browser/resources/file_manager/js/photo/slide_mode.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/util.js
diff --git a/chrome/browser/resources/file_manager/js/util.js b/chrome/browser/resources/file_manager/js/util.js
index ef058fa1732dda5b51d66ed833844ff7ee59f049..d929a21f41558fe817452539351eef9be5ec7f2d 100644
--- a/chrome/browser/resources/file_manager/js/util.js
+++ b/chrome/browser/resources/file_manager/js/util.js
@@ -569,6 +569,13 @@ util.makeFilesystemUrl = function(path) {
};
/**
+ * @return {string} Id of the current Chrome extension.
+ */
+util.getExtensionId = function() {
+ return chrome.extension.getURL('').split('/')[2];
+};
+
+/**
* Traverses a tree up to a certain depth.
* @param {FileEntry} root Root entry.
* @param {function(Array.<Entry>)} callback The callback is called at the very
@@ -612,6 +619,22 @@ util.traverseTree = function(root, callback, max_depth) {
};
/**
+ * A shortcut function to create a child element with given tag and class.
+ *
+ * @param {HTMLElement} parent Parent element.
+ * @param {string} opt_className Class name.
+ * @param {string} opt_tag Element tag, DIV is omitted.
+ * @return {Element} Newly created element.
+ */
+util.createChild = function(parent, opt_className, opt_tag) {
+ var child = parent.ownerDocument.createElement(opt_tag || 'div');
+ if (opt_className)
+ child.className = opt_className;
+ parent.appendChild(child);
+ return child;
+};
+
+/**
* Return a translated string.
*
* Wrapper function to make dealing with translated strings more concise.
@@ -637,4 +660,3 @@ function str(id) {
function strf(id, var_args) {
return loadTimeData.getStringF.apply(loadTimeData, arguments);
}
-
« no previous file with comments | « chrome/browser/resources/file_manager/js/photo/slide_mode.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698