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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2611843010: DevTools: move DOMExtension.js into ui module. (Closed)
Patch Set: Introduce progress monitor Created 3 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
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 53f32100c8c900e9760dee650a0f84a3b8e7c6b4..49077735edd43c41ef819b528c667a4c7de373f4 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -2016,3 +2016,19 @@ UI.loadImage = function(url) {
/** @type {!UI.ThemeSupport} */
UI.themeSupport;
+
+/**
+ * @param {function(!File)} callback
+ * @return {!Node}
+ */
+UI.createFileSelectorElement = function(callback) {
+ var fileSelectorElement = createElement('input');
+ fileSelectorElement.type = 'file';
+ fileSelectorElement.style.display = 'none';
+ fileSelectorElement.setAttribute('tabindex', -1);
+ fileSelectorElement.onchange = onChange;
+ function onChange(event) {
+ callback(fileSelectorElement.files[0]);
+ }
+ return fileSelectorElement;
+};

Powered by Google App Engine
This is Rietveld 408576698