// found in the LICENSE file.
cr.define('options', function() {
- var OptionsPage = options.OptionsPage;
+ var Page = cr.ui.pageManager.Page;
+ var PageManager = cr.ui.pageManager.PageManager;
/**
* AlertOverlay class
* Encapsulated handling of a generic alert.
- * @class
+ * @constructor
+ * @extends {cr.ui.pageManager.Page}
*/
function AlertOverlay() {
- OptionsPage.call(this, 'alertOverlay', '', 'alertOverlay');
+ Page.call(this, 'alertOverlay', '', 'alertOverlay');
}
cr.addSingletonGetter(AlertOverlay);
AlertOverlay.prototype = {
- // Inherit AlertOverlay from OptionsPage.
- __proto__: OptionsPage.prototype,
+ // Inherit AlertOverlay from Page.
+ __proto__: Page.prototype,
/**
* Whether the page can be shown. Used to make sure the page is only
*/
canShow_: false,
- /**
- * Initialize the page.
- */
+ /** @override */
initializePage: function() {
- // Call base class implementation to start preference initialization.
- OptionsPage.prototype.initializePage.call(this);
+ Page.prototype.initializePage.call(this);
+
+ // AlertOverlay is special in that it is not tied to one page or overlay.
+ this.alwaysOnTop = true;
var self = this;
$('alertOverlayOk').onclick = function(event) {
};
},
- /** @override */
- get nestingLevel() {
- // AlertOverlay is special in that it is not tied to one page or overlay.
- // Set the nesting level arbitrarily high so as to always be recognized as
- // the top-most visible page.
- return 99;
- },
-
/**
* Handle the 'ok' button. Clear the overlay and call the ok callback if
* available.
* @private
*/
handleOK_: function() {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
if (this.okCallback != undefined) {
this.okCallback.call();
}
* @private
*/
handleCancel_: function() {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
if (this.cancelCallback != undefined) {
this.cancelCallback.call();
}
/**
* The page is getting hidden. Don't let it be shown again.
+ * @override
*/
willHidePage: function() {
canShow_ = false;
// Intentionally don't show the URL in the location bar as we don't want
// people trying to navigate here by hand.
- OptionsPage.showPageByName('alertOverlay', false);
+ PageManager.showPageByName('alertOverlay', false);
};
// Export