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

Unified Diff: ui/file_manager/audio_player/js/audio_player_model.js

Issue 1176483002: AudioPlayer.app: Migrate to Polymer 1.0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: ui/file_manager/audio_player/js/audio_player_model.js
diff --git a/ui/file_manager/audio_player/js/audio_player_model.js b/ui/file_manager/audio_player/js/audio_player_model.js
index c8645ee9054258338ba1a892ec26e23d44f432bc..7bbef274cd33a9cd79d71012a4adf2ddc7754b06 100644
--- a/ui/file_manager/audio_player/js/audio_player_model.js
+++ b/ui/file_manager/audio_player/js/audio_player_model.js
@@ -6,7 +6,9 @@
* The model class for audio player.
* @constructor
*/
-function AudioPlayerModel() {
+function AudioPlayerModel() {}
+
+AudioPlayerModel.prototype.initialize = function(callback) {
'use strict';
/**
@@ -14,7 +16,7 @@ function AudioPlayerModel() {
* @type {!Object<*>}
* @const
*/
- var VALUES = Object.freeze(
+ var VALUES =
/**
* They will be used as properties of AudioPlayerModel.
* @lends {AudioPlayerModel.prototype}
@@ -24,7 +26,7 @@ function AudioPlayerModel() {
repeat: false,
volume: 100,
expanded: false,
- });
+ };
/**
* Prefix of the stored values in the storage.
@@ -48,9 +50,9 @@ function AudioPlayerModel() {
/**
* Load the values in the model from the storage.
* @param {AudioPlayerModel} model The model.
- * @param {function()} callback Called when the load is completed.
+ * @param {function()} inCallback Called when the load is completed.
*/
- function loadModel(model, callback) {
+ function loadModel(model, inCallback) {
// Restores the values from the storage
var objectsToBeRead = Object.keys(VALUES).
map(function(a) {
@@ -62,7 +64,7 @@ function AudioPlayerModel() {
// Strips the prefix.
model[key.substr(STORAGE_PREFIX.length)] = result[key];
}
- callback();
+ inCallback();
});
};
@@ -79,5 +81,6 @@ function AudioPlayerModel() {
Object.observe(target, function(changes) {
saveModel(target);
});
+ callback();
});
}

Powered by Google App Engine
This is Rietveld 408576698