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

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

Issue 7046077: Revert 88510 - Escaping file names correctly. Also fixed a crush in chromeos debug build while sa... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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/extensions/file_manager_util.cc ('k') | chrome/browser/sync/engine/net/url_translator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
===================================================================
--- chrome/browser/resources/file_manager/js/file_manager.js (revision 88552)
+++ chrome/browser/resources/file_manager/js/file_manager.js (working copy)
@@ -54,9 +54,6 @@
this.defaultPath_ = this.params_.defaultPath || '/';
- // Optional list of file types.
- this.fileTypes_ = this.params_.typeList;
-
// This is set to just the directory portion of defaultPath in initDialogType.
this.defaultFolder_ = '/';
@@ -558,29 +555,6 @@
};
/**
- * "Save a file" dialog is supposed to have a combo box with available
- * file types. Selecting an item filters files by extension and specifies how
- * file should be saved.
- * @return {intener} Index of selected type from this.fileTypes_ + 1. 0
- * means value is not specified.
- */
- FileManager.prototype.getSelectedFilterIndex_= function(fileName) {
- // TODO(serya): Implement the combo box
- // For now try to guess choice by file extension.
- if (!this.fileTypes_ || this.fileTypes_.length == 0) return 0;
-
- var extension = /\.[^\.]+$/.exec(fileName);
- extension = extension ? extension[0].substring(1).toLowerCase() : "";
- var result = 0; // Use first type by default.
- for (var i = 0; i < this.fileTypes_.length; i++) {
- if (this.fileTypes_[i].extensions.indexOf(extension)) {
- result = i;
- }
- }
- return result + 1; // 1-based index.
- };
-
- /**
* Force the canExecute events to be dispatched.
*/
FileManager.prototype.updateCommands_ = function() {
@@ -2104,9 +2078,8 @@
if (!filename)
throw new Error('Missing filename!');
- chrome.fileBrowserPrivate.selectFile(
- currentDirUrl + encodeURIComponent(filename),
- this.getSelectedFilterIndex_(filename));
+ chrome.fileBrowserPrivate.selectFile(currentDirUrl + encodeURI(filename),
+ 0);
window.close();
return;
}
@@ -2127,7 +2100,7 @@
continue;
}
- ary.push(currentDirUrl + encodeURIComponent(entry.name));
+ ary.push(currentDirUrl + encodeURI(entry.name));
}
// Multi-file selection has no other restrictions.
@@ -2156,8 +2129,7 @@
throw new Error('Selected entry is not a file!');
}
- chrome.fileBrowserPrivate.selectFile(
- ary[0], this.getSelectedFilterIndex_(ary[0]));
+ chrome.fileBrowserPrivate.selectFile(ary[0], 0);
window.close();
};
Property changes on: chrome/browser/resources/file_manager/js/file_manager.js
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « chrome/browser/extensions/file_manager_util.cc ('k') | chrome/browser/sync/engine/net/url_translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698