Bug 761319 Use a more reliable way of resolving the feed handler URI r=gavin

This commit is contained in:
Neil Rashbrook 2012-07-06 22:05:46 +01:00
Родитель 5f989addb3
Коммит bf2f971a94
1 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -51,7 +51,7 @@ const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
const URI_BUNDLE = "chrome://browser/locale/feeds/subscribe.properties";
const SUBSCRIBE_PAGE_URI = "chrome://browser/content/feeds/subscribe.xhtml";
const FEEDHANDLER_URI = "about:feeds";
const PREF_SELECTED_APP = "browser.feeds.handlers.application";
const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice";
@ -673,7 +673,7 @@ FeedWriter.prototype = {
*/
_getFileIconURL: function FW__getFileIconURL(file) {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
getService(Ci.nsIIOService);
var fph = ios.getProtocolHandler("file")
.QueryInterface(Ci.nsIFileProtocolHandler);
var urlSpec = fph.getURLSpecFromFile(file);
@ -1089,10 +1089,9 @@ FeedWriter.prototype = {
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShell).currentDocumentChannel;
var uri = makeURI(SUBSCRIBE_PAGE_URI);
var resolvedURI = Cc["@mozilla.org/chrome/chrome-registry;1"].
getService(Ci.nsIChromeRegistry).
convertChromeURL(uri);
var resolvedURI = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).
newChannel(FEEDHANDLER_URI, null, null).URI;
if (resolvedURI.equals(chan.URI))
return chan.originalURI;