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..eb1fb8e80aeb09095beeeb413a2b975bfd78d037 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; |
Vitaly Pavlenko
2014/10/01 23:29:53
This should be
this.canShow_ = false;
right?
Evan Stade
2014/10/13 16:21:55
yes
|
+ }, |
+ |
+ /** @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 |
+ // people trying to navigate here by hand. |
OptionsPage.showPageByName('alertOverlay', false); |
} |