Skip to content
This repository has been archived by the owner on Dec 4, 2017. It is now read-only.

Commit

Permalink
Address Mark's review comment about updating the default provider wit…
Browse files Browse the repository at this point in the history
…h a preference observer instead of at startup.
  • Loading branch information
fqueze committed Feb 6, 2013
1 parent 0939057 commit 1f7f42a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
12 changes: 8 additions & 4 deletions addon/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ function startup(data, reason) {
switch (reason) {
case BOOTSTRAP_REASONS.APP_STARTUP:
Services.obs.addObserver(webrtcbrowser, "browser-delayed-startup-finished", false);
var siteURL = kSiteURL;
if (Services.prefs.prefHasUserValue(kWrappsSiteURLPref))
siteURL = Services.prefs.getCharPref(kWrappsSiteURLPref);
setDefaultProvider(siteURL);
break;
case BOOTSTRAP_REASONS.ADDON_ENABLE:
case BOOTSTRAP_REASONS.ADDON_INSTALL:
Expand All @@ -215,10 +211,14 @@ function startup(data, reason) {
webrtcbrowser.init();
break;
}
Services.prefs.addObserver(kWrappsSiteURLPref, prefChangeListener, false);

}

function shutdown(data, reason) {
webrtcbrowser.uninit();
Services.prefs.removeObserver(kWrappsSiteURLPref, prefChangeListener);

/*
switch(reason) {
case BOOTSTRAP_REASONS.APP_SHUTDOWN:
Expand Down Expand Up @@ -252,6 +252,10 @@ function setDefaultProvider(aSiteURL) {
Services.prefs.setBoolPref("social.enabled", true);
}

function prefChangeListener(aSubject, aTopic, aData) {
setDefaultProvider(Services.prefs.getCharPref(kWrappsSiteURLPref));
}

function install(data, reason) {
switch(reason) {
case BOOTSTRAP_REASONS.ADDON_INSTALL:
Expand Down
3 changes: 1 addition & 2 deletions addon/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>WebRTC Demo Improvements</em:name>
<em:version>0.9</em:version>
<em:version>0.10</em:version>
<em:description>Adds default variables for webrtc and some extra features</em:description>
<em:bootstrap>true</em:bootstrap>
<em:updateURL>https://webrtc-demo.vcap.mozillalabs.com/update.rdf</em:updateURL>
Expand All @@ -17,4 +17,3 @@
</em:targetApplication>
</Description>
</RDF>

2 changes: 1 addition & 1 deletion static/update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<em:maxVersion>21.0a1</em:maxVersion>
<em:updateLink>https://webrtc-demo.vcap.mozillalabs.com/webrtc.xpi</em:updateLink>
<em:updateInfoURL>https://webrtc-demo.vcap.mozillalabs.com/update.txt</em:updateInfoURL>
<em:updateHash>sha256:9fb2aa621f8389766289f8706fb53fb482baba129a39fe9dfa0aa22defc2709e</em:updateHash>
<em:updateHash>sha256:24f2459029905bfcdab14e6d3bc0562213281c0d7d5d8ce13b05f4dfe8a90168</em:updateHash>
</RDF:Description>
</em:targetApplication>
</RDF:Description>
Expand Down
Binary file modified static/webrtc.xpi
Binary file not shown.

0 comments on commit 1f7f42a

Please sign in to comment.