/**
* Encapsulated handling of ChromeOS change picture options page.
* @constructor
+ * @extends {cr.ui.pageManager.Page}
*/
function ChangePictureOptions() {
Page.call(this, 'changePicture',
chrome.send('onChangePicturePageInitialized');
},
- /**
- * Called right after the page has been shown to user.
- */
+ /** @override */
didShowPage: function() {
var imageGrid = $('user-image-grid');
// Reset camera element.
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.
},
/**
- * 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();
},
};
// 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 {