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

Unified Diff: chrome/browser/resources/options/alert_overlay.js

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ugh just no Created 6 years, 5 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: chrome/browser/resources/options/alert_overlay.js
diff --git a/chrome/browser/resources/options/alert_overlay.js b/chrome/browser/resources/options/alert_overlay.js
index a4bf51b35f533225e04847c4e74a65d55931526d..09b95bf7db87915dd65e822107702c7e275c696d 100644
--- a/chrome/browser/resources/options/alert_overlay.js
+++ b/chrome/browser/resources/options/alert_overlay.js
@@ -3,7 +3,8 @@
// 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
@@ -11,14 +12,18 @@ cr.define('options', function() {
* @class
*/
function AlertOverlay() {
- OptionsPage.call(this, 'alertOverlay', '', 'alertOverlay');
+ Page.call(this, 'alertOverlay', '', 'alertOverlay');
+ // 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.
+ this.nestingLevelOverride = 99;
}
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
@@ -29,8 +34,7 @@ cr.define('options', function() {
/** @override */
initializePage: function() {
- // Call base class implementation to start preference initialization.
- OptionsPage.prototype.initializePage.call(this);
+ Page.prototype.initializePage.call(this);
var self = this;
$('alertOverlayOk').onclick = function(event) {
@@ -42,21 +46,13 @@ cr.define('options', function() {
};
},
- /** @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();
}
@@ -68,7 +64,7 @@ cr.define('options', function() {
* @private
*/
handleCancel_: function() {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
if (this.cancelCallback != undefined) {
this.cancelCallback.call();
}
@@ -141,7 +137,7 @@ cr.define('options', function() {
// 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
« no previous file with comments | « chrome/browser/resources/chromeos/proxy_settings.js ('k') | chrome/browser/resources/options/autofill_edit_address_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698