Commit 70281bf3 authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1499092 - rename/move code from 'feeds' and 'web content' to more...

Bug 1499092 - rename/move code from 'feeds' and 'web content' to more appropriate/obvious versions for registerProtocolHandler, r=nika

Differential Revision: https://phabricator.services.mozilla.com/D13699

--HG--
rename : browser/components/feeds/WebContentConverter.js => browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
rename : browser/components/feeds/moz.build => browser/components/protocolhandler/moz.build
rename : browser/components/feeds/test/.eslintrc.js => browser/components/protocolhandler/test/.eslintrc.js
rename : browser/components/feeds/test/browser/.eslintrc.js => browser/components/protocolhandler/test/browser/.eslintrc.js
rename : browser/components/feeds/test/browser/browser.ini => browser/components/protocolhandler/test/browser/browser.ini
rename : browser/components/feeds/test/browser/browser_registerProtocolHandler_notification.html => browser/components/protocolhandler/test/browser/browser_registerProtocolHandler_notification.html
rename : browser/components/feeds/test/browser/browser_registerProtocolHandler_notification.js => browser/components/protocolhandler/test/browser/browser_registerProtocolHandler_notification.js
rename : browser/components/feeds/test/mochitest.ini => browser/components/protocolhandler/test/mochitest.ini
rename : browser/components/feeds/test/test_registerHandler.html => browser/components/protocolhandler/test/test_registerHandler.html
rename : browser/components/feeds/test/test_registerHandler_disabled.html => browser/components/protocolhandler/test/test_registerHandler_disabled.html
rename : dom/interfaces/sidebar/nsIWebContentHandlerRegistrar.idl => dom/interfaces/sidebar/nsIWebProtocolHandlerRegistrar.idl
extra : moz-landing-system : lando
parent 7ab8abdd
......@@ -37,3 +37,7 @@ contract @mozilla.org/browser/browserglue;1 {eab9012e-5f74-4cbc-b2b5-a590235513c
category app-startup nsBrowserGlue service,@mozilla.org/browser/browserglue;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} application={aa3c5121-dab2-40e2-81ca-7ea25febc110}
component {d8903bf6-68d5-4e97-bcd1-e4d3012f721a} nsBrowserGlue.js
contract @mozilla.org/content-permission/prompt;1 {d8903bf6-68d5-4e97-bcd1-e4d3012f721a}
# RegisterProtocolHandler support
component {efbd7b87-9b15-4684-abf0-dc2679daadb1} WebProtocolHandlerRegistrar.js process=main
contract @mozilla.org/embeddor.implemented/web-protocol-handler-registrar;1 {efbd7b87-9b15-4684-abf0-dc2679daadb1} process=main
component {792a7e82-06a0-437c-af63-b2d12e808acc} WebContentConverter.js process=main
contract @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 {792a7e82-06a0-437c-af63-b2d12e808acc} process=main
......@@ -38,7 +38,6 @@ DIRS += [
'downloads',
'enterprisepolicies',
'extensions',
'feeds',
'library',
'migration',
'newtab',
......@@ -47,6 +46,7 @@ DIRS += [
'pocket',
'preferences',
'privatebrowsing',
'protocolhandler',
'resistfingerprinting',
'search',
'sessionstore',
......
......@@ -6,18 +6,16 @@
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
const WCCR_CLASSID = Components.ID("{792a7e82-06a0-437c-af63-b2d12e808acc}");
const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties";
function WebContentConverterRegistrar() {
function WebProtocolHandlerRegistrar() {
}
WebContentConverterRegistrar.prototype = {
WebProtocolHandlerRegistrar.prototype = {
get stringBundle() {
let sb = Services.strings.createBundle(STRING_BUNDLE_URI);
delete WebContentConverterRegistrar.prototype.stringBundle;
return WebContentConverterRegistrar.prototype.stringBundle = sb;
delete WebProtocolHandlerRegistrar.prototype.stringBundle;
return WebProtocolHandlerRegistrar.prototype.stringBundle = sb;
},
_getFormattedString(key, params) {
......@@ -29,7 +27,7 @@ WebContentConverterRegistrar.prototype = {
},
/**
* See nsIWebContentHandlerRegistrar
* See nsIWebProtocolHandlerRegistrar
*/
removeProtocolHandler(aProtocol, aURITemplate) {
let eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
......@@ -76,7 +74,7 @@ WebContentConverterRegistrar.prototype = {
},
/**
* See nsIWebContentHandlerRegistrar
* See nsIWebProtocolHandlerRegistrar
*/
registerProtocolHandler(aProtocol, aURI, aTitle, aDocumentURI, aBrowserOrWindow) {
aProtocol = (aProtocol || "").toLowerCase();
......@@ -148,13 +146,13 @@ WebContentConverterRegistrar.prototype = {
[addButton]);
},
classID: WCCR_CLASSID,
classID: Components.ID("{efbd7b87-9b15-4684-abf0-dc2679daadb1}"),
/**
* See nsISupports
*/
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebContentHandlerRegistrar]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProtocolHandlerRegistrar]),
};
this.NSGetFactory =
XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);
XPCOMUtils.generateNSGetFactory([WebProtocolHandlerRegistrar]);
......@@ -8,9 +8,8 @@ MOCHITEST_MANIFESTS += ['test/mochitest.ini']
BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
EXTRA_COMPONENTS += [
'BrowserFeeds.manifest',
'WebContentConverter.js',
'WebProtocolHandlerRegistrar.js',
]
with Files('**'):
BUG_COMPONENT = ('Firefox', 'RSS Discovery and Preview')
BUG_COMPONENT = ('Firefox', 'General')
......@@ -175,8 +175,6 @@
@BINPATH@/components/nsDNSServiceDiscovery.manifest
@BINPATH@/components/nsDNSServiceDiscovery.js
#endif
@RESPATH@/browser/components/BrowserFeeds.manifest
@RESPATH@/browser/components/WebContentConverter.js
@RESPATH@/browser/components/BrowserComponents.manifest
@RESPATH@/browser/components/nsBrowserContentHandler.js
@RESPATH@/browser/components/nsBrowserGlue.js
......@@ -197,6 +195,7 @@
@RESPATH@/browser/components/EnterprisePolicies.js
@RESPATH@/browser/components/EnterprisePoliciesContent.js
@RESPATH@/browser/components/EnterprisePolicies.manifest
@RESPATH@/browser/components/WebProtocolHandlerRegistrar.js
@RESPATH@/components/Downloads.manifest
@RESPATH@/components/DownloadLegacy.js
@RESPATH@/components/PageThumbsComponents.manifest
......
......@@ -24,7 +24,7 @@
#include "nsContentPolicyUtils.h"
#include "nsISupportsPriority.h"
#include "nsICachingChannel.h"
#include "nsIWebContentHandlerRegistrar.h"
#include "nsIWebProtocolHandlerRegistrar.h"
#include "nsICookiePermission.h"
#include "nsIScriptSecurityManager.h"
#include "nsCharSeparatedTokenizer.h"
......@@ -992,8 +992,8 @@ void Navigator::RegisterProtocolHandler(const nsAString& aScheme,
return;
}
nsCOMPtr<nsIWebContentHandlerRegistrar> registrar =
do_GetService(NS_WEBCONTENTHANDLERREGISTRAR_CONTRACTID);
nsCOMPtr<nsIWebProtocolHandlerRegistrar> registrar =
do_GetService(NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID);
if (registrar) {
aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, aTitle,
docURI, mWindow->GetOuterWindow());
......
......@@ -8,7 +8,7 @@ with Files("**"):
BUG_COMPONENT = ("Core", "DOM")
XPIDL_SOURCES += [
'nsIWebContentHandlerRegistrar.idl',
'nsIWebProtocolHandlerRegistrar.idl',
]
XPIDL_MODULE = 'dom_sidebar'
......
......@@ -9,23 +9,23 @@
interface nsIURI;
/**
* nsIWebContentHandlerRegistrar
* nsIWebProtocolHandlerRegistrar
*
* Applications wishing to use web content handlers need to implement this
* Applications wishing to use web protocol handlers need to implement this
* interface. Typically they will prompt the user to confirm adding an entry
* to the local list.
*
* The component must have the contract id defined below so that nsNavigator
* can invoke it.
* The component must have the contract id defined below so that the Navigator
* implementation can invoke it.
*/
[scriptable, uuid(65a3fafd-0e4a-4b06-8b4e-6a611da63d98)]
interface nsIWebContentHandlerRegistrar : nsISupports
[scriptable, uuid(1ce9ef8d-f462-49ca-b8e9-c946c4f37d6e)]
interface nsIWebProtocolHandlerRegistrar : nsISupports
{
/**
* See documentation in Navigator.webidl
* The additional contentWindow param for this method represents the dom
* content window from which the method has been called.
* content window from which the method has been called, or its browser window.
*/
void registerProtocolHandler(in AString protocol,
in nsIURI uri,
......@@ -47,5 +47,5 @@ interface nsIWebContentHandlerRegistrar : nsISupports
%{ C++
#define NS_WEBCONTENTHANDLERREGISTRAR_CONTRACTID "@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"
#define NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID "@mozilla.org/embeddor.implemented/web-protocol-handler-registrar;1"
%}
......@@ -63,7 +63,7 @@
#include "nsIURI.h"
#include "nsIWindowWatcher.h"
#include "nsIWebBrowserChrome.h"
#include "nsIWebContentHandlerRegistrar.h"
#include "nsIWebProtocolHandlerRegistrar.h"
#include "nsIXULBrowserWindow.h"
#include "nsIXULWindow.h"
#include "nsViewManager.h"
......@@ -2103,8 +2103,8 @@ mozilla::ipc::IPCResult TabParent::RecvSetHasBeforeUnload(
mozilla::ipc::IPCResult TabParent::RecvRegisterProtocolHandler(
const nsString& aScheme, nsIURI* aHandlerURI, const nsString& aTitle,
nsIURI* aDocURI) {
nsCOMPtr<nsIWebContentHandlerRegistrar> registrar =
do_GetService(NS_WEBCONTENTHANDLERREGISTRAR_CONTRACTID);
nsCOMPtr<nsIWebProtocolHandlerRegistrar> registrar =
do_GetService(NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID);
if (registrar) {
registrar->RegisterProtocolHandler(aScheme, aHandlerURI, aTitle, aDocURI,
mFrameElement);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment