Bug 1363169 - Add support for native windows share. r=gijs, r=aklotz

MozReview-Commit-ID: 7quON7Somvr
This commit is contained in:
Dale Harvey
2018-09-26 21:09:00 +01:00
parent 4bded69b0b
commit eb18642496
10 changed files with 234 additions and 5 deletions

View File

@@ -1203,6 +1203,12 @@ BrowserPageActions.addSearchEngine = {
// share URL
BrowserPageActions.shareURL = {
onCommand(event, buttonNode) {
let browser = gBrowser.selectedBrowser;
let currentURI = gURLBar.makeURIReadable(browser.currentURI).displaySpec;
this._windowsUIUtils.shareUrl(currentURI, browser.contentTitle);
},
onShowingInPanel(buttonNode) {
this._cached = false;
},
@@ -1264,7 +1270,7 @@ BrowserPageActions.shareURL = {
};
// Attach sharingService here so tests can override the implementation
XPCOMUtils.defineLazyServiceGetter(BrowserPageActions.shareURL,
"_sharingService",
"@mozilla.org/widget/macsharingservice;1",
"nsIMacSharingService");
XPCOMUtils.defineLazyServiceGetters(BrowserPageActions.shareURL, {
_sharingService: ["@mozilla.org/widget/macsharingservice;1", "nsIMacSharingService"],
_windowsUIUtils: ["@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils"],
});