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

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, .grd fix 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
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..25b0fde20c678c32e4716d175960c46f917d8c24 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
@@ -638,3 +645,18 @@ function strf(id, var_args) {
return loadTimeData.getStringF.apply(loadTimeData, arguments);
}
+/**
+ * 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.
+ */
+function createChild(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;
+}

Powered by Google App Engine
This is Rietveld 408576698