diff options
-rw-r--r-- | chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js index 61e3df3..afbd98f 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js @@ -33,6 +33,12 @@ cvox.TabsApiHandler = function(tts, braille, earcons) { this.earcons_ = earcons; /** @type {function(string)} @private */ this.msg_ = cvox.ChromeVox.msgs.getMsg.bind(cvox.ChromeVox.msgs); + /** + * Tracks whether the active tab has finished loading. + * @type {boolean} + * @private + */ + this.lastActiveTabLoaded_ = false; chrome.tabs.onCreated.addListener(this.onCreated.bind(this)); chrome.tabs.onRemoved.addListener(this.onRemoved.bind(this)); @@ -78,6 +84,7 @@ cvox.TabsApiHandler.prototype = { return; } chrome.tabs.get(activeInfo.tabId, function(tab) { + this.lastActiveTabLoaded_ = tab.status == 'complete'; if (tab.status == 'loading') { return; } @@ -106,8 +113,10 @@ cvox.TabsApiHandler.prototype = { return; } if (tab.status == 'loading') { + this.lastActiveTabLoaded_ = false; this.earcons_.playEarcon(cvox.AbstractEarcons.BUSY_PROGRESS_LOOP); - } else { + } else if (!this.lastActiveTabLoaded_) { + this.lastActiveTabLoaded_ = true; this.earcons_.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS); } }.bind(this)); |