Chromium Code Reviews| 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 e8ecced70c7d5397956ccc01fdceea85b7b6b777..5e107b777a5ac5b4b90d4c40ebee58ee966ac97f 100644 |
| --- a/chrome/browser/resources/options/alert_overlay.js |
| +++ b/chrome/browser/resources/options/alert_overlay.js |
| @@ -21,6 +21,13 @@ cr.define('options', function() { |
| __proto__: OptionsPage.prototype, |
| /** |
| + * Whether the page can be shown. Used to make sure the page is only |
| + * shown via AlertOverlay.Show(), and not via the address bar. |
| + * @private |
| + */ |
| + canShow_: false, |
| + |
| + /** |
| * Initialize the page. |
| */ |
| initializePage: function() { |
| @@ -59,7 +66,19 @@ cr.define('options', function() { |
| if (this.cancelCallback != undefined) { |
| this.cancelCallback.call(); |
| } |
| - } |
| + }, |
| + |
| + /** |
| + * The page is getting hidden. Don't let it be shown again. |
| + */ |
| + willHidePage: function() { |
| + canShow_ = false; |
| + }, |
| + |
| + /** @inheritDoc */ |
| + canShowPage: function() { |
| + return this.canShow_; |
| + }, |
| }; |
| /** |
| @@ -108,9 +127,13 @@ cr.define('options', function() { |
| $('alertOverlayCancel').style.display = 'none'; |
| } |
| - AlertOverlay.getInstance().okCallback = okCallback; |
| - AlertOverlay.getInstance().cancelCallback = cancelCallback; |
| + var alertOverlay = AlertOverlay.getInstance(); |
| + alertOverlay.okCallback = okCallback; |
| + alertOverlay.cancelCallback = cancelCallback; |
| + alertOverlay.canShow_ = true; |
| + // Intentionally don't show the URL in the location bar as we don't want |
|
stuartmorgan
2011/02/12 01:09:06
Fix the double space.
Evan Stade
2011/02/12 03:06:42
Done.
|
| + // people trying to navigate here by hand. |
| OptionsPage.showPageByName('alertOverlay', false); |
| } |