WebContentConverter - //@line 39

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //@line 39 "e:\builds\moz2_slave\win32_build\build\browser\components\feeds\src\WebContentConv erter.js" Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; function LOG(str) { dump("*** " + str + "\n"); } const WCCR_CONTRACTID = "@mozilla.org/embeddor.implemented/web-content-handler- registrar;1"; const WCCR_CLASSID = Components.ID("{792a7e82-06a0-437c-af63-b2d12e808acc}"); const WCCR_CLASSNAME = "Web Content Handler Registrar"; const WCC_CLASSID = Components.ID("{db7ebf28-cc40-415f-8a51-1b111851df1e}"); const WCC_CLASSNAME = "Web Service Handler"; const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed"; const TYPE_ANY = "*/*"; const PREF_CONTENTHANDLERS_AUTO = "browser.contentHandlers.auto."; const PREF_CONTENTHANDLERS_BRANCH = "browser.contentHandlers.types."; const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice"; const PREF_SELECTED_ACTION = "browser.feeds.handler"; const PREF_SELECTED_READER = "browser.feeds.handler.default"; const PREF_HANDLER_EXTERNAL_PREFIX = "network.protocol-handler.external"; const PREF_ALLOW_DIFFERENT_HOST = "gecko.handlerService.allowRegisterFromDifferentHost"; const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties"; const NS_ERROR_MODULE_DOM = 2152923136; const NS_ERROR_DOM_SYNTAX_ERR = NS_ERROR_MODULE_DOM + 12; function WebContentConverter() { } WebContentConverter.prototype = { convert: function WCC_convert() { }, asyncConvertData: function WCC_asyncConvertData() { }, onDataAvailable: function WCC_onDataAvailable() { }, onStopRequest: function WCC_onStopRequest() { }, onStartRequest: function WCC_onStartRequest(request, context) { var wccr = Cc[WCCR_CONTRACTID]. getService(Ci.nsIWebContentConverterService); wccr.loadPreferredHandler(request); }, QueryInterface: function WCC_QueryInterface(iid) { if (iid.equals(Ci.nsIStreamConverter) || iid.equals(Ci.nsIStreamListener) || iid.equals(Ci.nsISupports)) return this; throw Cr.NS_ERROR_NO_INTERFACE; } }; var WebContentConverterFactory = { createInstance: function WCCF_createInstance(outer, iid) { if (outer != null) throw Cr.NS_ERROR_NO_AGGREGATION; return new WebContentConverter().QueryInterface(iid); }, QueryInterface: function WCC_QueryInterface(iid) { if (iid.equals(Ci.nsIFactory) || iid.equals(Ci.nsISupports)) return this; throw Cr.NS_ERROR_NO_INTERFACE; } }; function ServiceInfo(contentType, uri, name) { this._contentType = contentType; this._uri = uri; this._name = name; } ServiceInfo.prototype = { /** * See nsIHandlerApp */ get name() { return this._name; }, /** * See nsIHandlerApp */ equals: function SI_equals(aHandlerApp) { if (!aHandlerApp) throw Cr.NS_ERROR_NULL_POINTER; if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo && aHandlerApp.contentType == this.contentType && aHandlerApp.uri == this.uri) return true; return false; }, /** * See nsIWebContentHandlerInfo */ get contentType() { return this._contentType; }, /** * See nsIWebContentHandlerInfo */ get uri() { return this._uri; },...
View Full Document

Page1 / 18

WebContentConverter - //@line 39

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online