diff options
author | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-03 06:52:47 +0000 |
---|---|---|
committer | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-03 06:52:47 +0000 |
commit | ee8bbd97d968ed755b1bc602d1ec8bf9152a85ab (patch) | |
tree | dcb163cb0a5b01bc031fe1d8c9c7845184e1a44e /chrome/third_party | |
parent | 2cb680cadff11b4063dbe3a20f2150ed3f49605c (diff) | |
download | chromium_src-ee8bbd97d968ed755b1bc602d1ec8bf9152a85ab.zip chromium_src-ee8bbd97d968ed755b1bc602d1ec8bf9152a85ab.tar.gz chromium_src-ee8bbd97d968ed755b1bc602d1ec8bf9152a85ab.tar.bz2 |
No longer observe listener addition/removal in ChromeVox unload.
This simplifies the unload codepath for ChromeVox.
- remove event listener observer
- remove loaded ChromeVox profile tracking
- send events to ChromeVox for load using lazy dispatch
TEST=Manual. Verify load speaks "ChromeVox, spoken feedback enabled" the first time only.
BUG=339775,332461
Review URL: https://codereview.chromium.org/151093003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/third_party')
-rw-r--r-- | chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js b/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js index 6cb97b1..ce852369 100644 --- a/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js +++ b/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js @@ -1579,5 +1579,5 @@ break;case cvox.TypingEcho.NONE:c=cvox.ChromeVox.msgs.getMsg("none_echo")}c&&thi function(){b.postMessage({message:"TTS_CALLBACK",id:a.endCallbackId})});try{this.onTtsMessage(a)}catch(f){console.log(f)}break;case "EARCON":this.onEarconMessage(a);break;case "BRAILLE":try{this.onBrailleMessage(a)}catch(g){console.log(g)}}},this))};cvox.ChromeVoxBackground.prototype.checkVersionNumber=function(){this.isIncognito_()||(this.localStorageVersion=localStorage.versionString,this.showNotesIfNewVersion())};cvox.ChromeVoxBackground.prototype.displayReleaseNotes=function(){chrome.tabs.create({url:"http://chromevox.com/release_notes.html"})}; cvox.ChromeVoxBackground.prototype.showNotesIfNewVersion=function(){var a=chrome.extension.getURL("manifest.json"),b=new XMLHttpRequest,c=this;b.onreadystatechange=function(){if(4==b.readyState){var a=JSON.parse(b.responseText);console.log("Version: "+a.version);var e=c.localStorageVersion!=a.version;-1!=navigator.userAgent.indexOf("CrOS")&&void 0==c.localStorageVersion&&(e=!1);e&&c.displayReleaseNotes();this.localStorageVersion=localStorage.versionString=a.version}};b.open("GET",a);b.send()}; cvox.ChromeVoxBackground.prototype.readPrefs=function(){var a=this.prefs.getPrefs();cvox.ChromeVoxEditableTextBase.useIBeamCursor="true"==a.useIBeamCursor;cvox.ChromeVox.isActive="true"==a.active||cvox.ChromeVox.isChromeOS;cvox.ChromeVox.isStickyOn="true"==a.sticky};cvox.ChromeVoxBackground.prototype.isIncognito_=function(){var a=!1;chrome.tabs.getCurrent(function(b){a=b?b.incognito:!0});return a}; -cvox.ChromeVoxBackground.prototype.onLoadStateChanged=function(a,b){a?b&&(cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("chromevox_intro"),1,{doNotInterrupt:!0}),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(cvox.ChromeVox.msgs.getMsg("intro_brl")))):(cvox.ChromeVox.tts.stop(),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText("")),window.setTimeout(function(){chrome.accessibilityPrivate.onChromeVoxLoadStateChanged.destroy_()},0))};var background$$inline_14=new cvox.ChromeVoxBackground; -background$$inline_14.init();window.speak=goog.bind(background$$inline_14.tts.speak,background$$inline_14.tts);window.prefs=background$$inline_14.prefs;window.braille=cvox.ChromeVox.braille; +cvox.ChromeVoxBackground.prototype.onLoadStateChanged=function(a,b){a?b&&(cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("chromevox_intro"),1,{doNotInterrupt:!0}),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(cvox.ChromeVox.msgs.getMsg("intro_brl")))):(cvox.ChromeVox.tts.stop(),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText("")),window.setTimeout(function(){chrome.accessibilityPrivate.onChromeVoxLoadStateChanged.removeListener(cvox.ChromeVoxBackground.prototype.onLoadStateChanged)}, +0))};var background$$inline_14=new cvox.ChromeVoxBackground;background$$inline_14.init();window.speak=goog.bind(background$$inline_14.tts.speak,background$$inline_14.tts);window.prefs=background$$inline_14.prefs;window.braille=cvox.ChromeVox.braille; |