Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / options / chromeos / change_picture_options.js
index e41e504..506e483 100644 (file)
@@ -24,6 +24,7 @@ cr.define('options', function() {
   /**
    * Encapsulated handling of ChromeOS change picture options page.
    * @constructor
+   * @extends {cr.ui.pageManager.Page}
    */
   function ChangePictureOptions() {
     Page.call(this, 'changePicture',
@@ -103,9 +104,7 @@ cr.define('options', function() {
       chrome.send('onChangePicturePageInitialized');
     },
 
-    /**
-     * Called right after the page has been shown to user.
-     */
+    /** @override */
     didShowPage: function() {
       var imageGrid = $('user-image-grid');
       // Reset camera element.
@@ -114,9 +113,7 @@ cr.define('options', function() {
       chrome.send('onChangePicturePageShown');
     },
 
-    /**
-     * Called right before the page is hidden.
-     */
+    /** @override */
     willHidePage: function() {
       var imageGrid = $('user-image-grid');
       imageGrid.blur();  // Make sure the image grid is not active.
@@ -129,10 +126,10 @@ cr.define('options', function() {
     },
 
     /**
-     * Called right after the page has been hidden.
+     * Either willHidePage or didClosePage may be called depending on the way
+     * the page was closed.
+     * @override
      */
-    // TODO(ivankr): both callbacks are required as only one of them is called
-    // depending on the way the page was closed, see http://crbug.com/118923.
     didClosePage: function() {
       this.willHidePage();
     },
@@ -323,19 +320,14 @@ cr.define('options', function() {
   };
 
   // Forward public APIs to private implementations.
-  [
+  cr.makePublic(ChangePictureOptions, [
     'closeOverlay',
     'setCameraPresent',
     'setDefaultImages',
     'setOldImage',
     'setProfileImage',
     'setSelectedImage',
-  ].forEach(function(name) {
-    ChangePictureOptions[name] = function() {
-      var instance = ChangePictureOptions.getInstance();
-      return instance[name + '_'].apply(instance, arguments);
-    };
-  });
+  ]);
 
   // Export
   return {