Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js |
| index 45e8716094163c0b464e360269cfd7d596bc0daf..e7fcb22ef30c1dba449cd5eec37d389e95588e43 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js |
| @@ -45,13 +45,11 @@ cvox.ChromeVox.MAX_INIT_TIMEOUT_ = 30000; |
| /** |
| * Flag indicating if ChromeVox Classic is enabled based on the Next |
| - * background page. Initializes to true for non-top level |
| - * (i.e. iframes) windows. For top level windows, left undefined and |
| - * set when background page replies. |
| + * background page which sends the state at page load. |
| * @type {boolean|undefined} |
| * @private |
| */ |
| -cvox.ChromeVox.isClassicEnabled_ = window.top == window ? undefined : true; |
|
dmazzoni
2016/01/20 06:31:05
Is this from a different patch?
|
| +cvox.ChromeVox.isClassicEnabled_ = undefined; |
| /** |
| @@ -62,9 +60,14 @@ cvox.ChromeVox.isClassicEnabled_ = window.top == window ? undefined : true; |
| */ |
| cvox.ChromeVox.recallInit_ = function(reason) { |
| if (cvox.ChromeVox.initTimeout_ > cvox.ChromeVox.MAX_INIT_TIMEOUT_) { |
| - window.console.log(reason + |
| - ' Taking too long - giving up.'); |
| - return; |
| + if (cvox.ChromeVox.isClassicEnabled_ !== undefined) { |
| + window.console.log(reason + |
| + ' Taking too long - giving up.'); |
| + return; |
| + } else { |
| + // Default to enabling classic after the timeout. |
| + cvox.ChromeVox.isClassicEnabled_ = true; |
| + } |
| } |
| window.console.log(reason + |
| ' Will try again in ' + |