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) { |