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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js

Issue 1592513002: Use a predicate that isn't so granular during continuous read. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ' +
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698