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

Unified Diff: ui/file_manager/file_manager/foreground/js/cws_container_client.js

Issue 1056433003: Add button to add new FSP services to Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 9 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: ui/file_manager/file_manager/foreground/js/cws_container_client.js
diff --git a/ui/file_manager/file_manager/foreground/js/cws_container_client.js b/ui/file_manager/file_manager/foreground/js/cws_container_client.js
index d177630e451ea729de03db4062d8390972d48abf..650f3c17407a5e1d8c31573d1f32194796129d78 100644
--- a/ui/file_manager/file_manager/foreground/js/cws_container_client.js
+++ b/ui/file_manager/file_manager/foreground/js/cws_container_client.js
@@ -4,26 +4,21 @@
/**
* @param {WebView} webView Web View tag.
- * @param {?string} ext File extension.
- * @param {?string} mime File mime type.
- * @param {?string} searchQuery Search query.
* @param {number} width Width of the CWS widget.
* @param {number} height Height of the CWS widget.
* @param {string} url Share Url for an entry.
* @param {string} target Target (scheme + host + port) of the widget.
+ * @param {Object<string, *>} options Options to be sent to the dialog host.
* @constructor
* @extends {cr.EventTarget}
*/
-function CWSContainerClient(
- webView, ext, mime, searchQuery, width, height, url, target) {
+function CWSContainerClient(webView, width, height, url, target, options) {
this.webView_ = webView;
- this.ext_ = (ext && ext[0] == '.') ? ext.substr(1) : ext;
- this.mime_ = mime;
- this.searchQuery_ = searchQuery;
this.width_ = width;
this.height_ = height;
this.url_ = url;
this.target_ = target;
+ this.options_ = options;
this.loaded_ = false;
this.loading_ = false;
@@ -190,11 +185,10 @@ CWSContainerClient.prototype.postInitializeMessage_ = function() {
v: 1
};
- if (this.searchQuery_) {
- message['search_query'] = this.searchQuery_;
- } else {
- message['file_extension'] = this.ext_;
- message['mime_type'] = this.mime_;
+ if (this.options_) {
+ Object.keys(this.options_).forEach(function(key) {
+ message[key] = this.options_[key];
+ }.bind(this));
}
this.postMessage_(message);

Powered by Google App Engine
This is Rietveld 408576698