Chromium Code Reviews| 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 52326544545650528606e7c0c314cd6a5341b645..579eb8ff60d1447c9caede6e369a0a970369ddf5 100644 |
| --- a/ui/file_manager/file_manager/foreground/js/file_manager.js |
| +++ b/ui/file_manager/file_manager/foreground/js/file_manager.js |
| @@ -228,7 +228,12 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52; |
| // Get startup preferences. |
| this.viewOptions_ = {}; |
| group.add(function(done) { |
| - util.platform.getPreference(this.startupPrefName_, function(value) { |
| + chrome.storage.local.get([this.startupPrefName_], function(values) { |
|
hirono
2014/09/10 13:03:39
We can pass a single key as a string.
mtomasz
2014/09/11 03:30:50
Done.
|
| + var value = values[this.startupPrefName_]; |
| + if (!value) { |
| + done(); |
| + return; |
| + } |
| // Load the global default options. |
| try { |
| this.viewOptions_ = JSON.parse(value); |
| @@ -486,7 +491,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(); |
| @@ -644,9 +649,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)); |
| @@ -707,8 +711,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 { |
| @@ -1062,7 +1065,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) { |