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

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

Issue 553263003: Remove util.platform from Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 6 years, 3 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 | « ui/file_manager/file_manager/common/js/util.js ('k') | ui/file_manager/gallery/js/slide_mode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/file_manager.js
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js
index 82ffcf3c1ff9c7c54942c37db64aff26238b9834..c8cdaff380ea49e1bef1bc3f87b47c03948d1e7a 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -767,7 +767,12 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
// Get startup preferences.
group.add(function(done) {
- util.platform.getPreference(this.startupPrefName_, function(value) {
+ chrome.storage.local.get(this.startupPrefName_, function(values) {
+ var value = values[this.startupPrefName_];
+ if (!value) {
+ done();
+ return;
+ }
// Load the global default options.
try {
this.viewOptions_ = JSON.parse(value);
@@ -1023,7 +1028,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.syncButton.checkable = true;
this.hostedButton.checkable = true;
- if (util.platform.runningInBrowser()) {
+ if (util.runningInBrowser()) {
// Suppresses the default context menu.
this.dialogDom_.addEventListener('contextmenu', function(e) {
e.preventDefault();
@@ -1181,9 +1186,8 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.backgroundPage_ = backgroundPage;
this.backgroundPage_.background.ready(function() {
loadTimeData.data = this.backgroundPage_.background.stringData;
- if (util.platform.runningInBrowser()) {
+ if (util.runningInBrowser())
this.backgroundPage_.registerDialog(window);
- }
callback();
}.bind(this));
}.bind(this));
@@ -1244,8 +1248,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.cancelButton_ = this.ui_.cancelButton;
// Show the window as soon as the UI pre-initialization is done.
- if (this.dialogType == DialogType.FULL_PAGE &&
- !util.platform.runningInBrowser()) {
+ if (this.dialogType == DialogType.FULL_PAGE && !util.runningInBrowser()) {
chrome.app.window.current().show();
setTimeout(callback, 100); // Wait until the animation is finished.
} else {
@@ -1592,7 +1595,9 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
prefs.columns.push(cm.getWidth(i));
}
// Save the global default.
- util.platform.setPreference(this.startupPrefName_, JSON.stringify(prefs));
+ var items = {};
+ items[this.startupPrefName_] = JSON.stringify(prefs);
+ chrome.storage.local.set(items);
// Save the window-specific preference.
if (window.appState) {
« no previous file with comments | « ui/file_manager/file_manager/common/js/util.js ('k') | ui/file_manager/gallery/js/slide_mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698