summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/resources/file_manager/js/file_manager.js10
-rw-r--r--chrome/browser/resources/file_manager/js/mock_chrome.js15
2 files changed, 18 insertions, 7 deletions
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 63f190f..099a6fc 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -44,9 +44,6 @@ function FileManager(dialogDom) {
FileManager.DialogType.SELECT_OPEN_MULTI_FILE,
FileManager.DialogType.FULL_PAGE]);
- // TODO(dgozman): This will be changed to LocaleInfo.
- this.locale_ = new v8Locale(navigator.language);
-
this.initFileSystem_();
this.volumeManager_ = VolumeManager.getInstance();
this.initDom_();
@@ -451,15 +448,14 @@ FileManager.prototype = {
}.bind(this));
this.dateFormatter_ = v8Intl.DateTimeFormat(
- {} /* default locale */,
+ [] /* default locale */,
{year: 'numeric', month: 'short', day: 'numeric',
hour: 'numeric', minute: 'numeric'});
this.timeFormatter_ = v8Intl.DateTimeFormat(
- {} /* default locale */,
+ [] /* default locale */,
{hour: 'numeric', minute: 'numeric'});
- this.collator_ = this.locale_.createCollator({
- 'numeric': true, 'ignoreCase': true, 'ignoreAccents': true});
+ this.collator_ = v8Intl.Collator([], {numeric: true, sensitivity: 'base'});
// Optional list of file types.
this.fileTypes_ = this.params_.typeList;
diff --git a/chrome/browser/resources/file_manager/js/mock_chrome.js b/chrome/browser/resources/file_manager/js/mock_chrome.js
index 1665dc8..bef0183 100644
--- a/chrome/browser/resources/file_manager/js/mock_chrome.js
+++ b/chrome/browser/resources/file_manager/js/mock_chrome.js
@@ -750,5 +750,20 @@ v8Intl.DateTimeFormat = function(locales, options) {
};
};
+/**
+ * @constructor
+ * @param {Array?} locales Unused in the mock.
+ * @param {Object} options Unused in the mock.
+ */
+v8Intl.Collator = function(locales, options) {
+ return {
+ compare: function(a, b) {
+ if (a > b) return 1;
+ if (a < b) return -1;
+ return 0;
+ }
+ };
+};
+
return v8Intl;
}());