Bug 1472491: Part 5x - Add SelectionSourceChild actor. r=mconley

MozReview-Commit-ID: 6RioXbevgRO

--HG--
rename : toolkit/modules/SelectionSourceContent.jsm => toolkit/actors/SelectionSourceChild.jsm
extra : rebase_source : 6c0c76cbea4e203ba715a05a68241794e6c11213
This commit is contained in:
Kris Maglione 2018-07-29 23:28:10 -07:00
Родитель 96bdaf839b
Коммит dbbb50d17a
5 изменённых файлов: 18 добавлений и 13 удалений

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

@ -3,11 +3,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = ["SelectionSourceContent"];
var EXPORTED_SYMBOLS = ["SelectionSourceChild"];
ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var SelectionSourceContent = {
class SelectionSourceChild extends ActorChild {
receiveMessage(message) {
const global = message.target;
@ -19,7 +20,7 @@ var SelectionSourceContent = {
global.sendAsyncMessage("ViewSource:GetSelectionDone", selectionDetails);
}
}
},
}
/**
* A helper to get a path like FIXptr, but with an array instead of the
@ -45,7 +46,7 @@ var SelectionSourceContent = {
p = n.parentNode;
} while (n != ancestor && p);
return path;
},
}
getSelection(global) {
const {content} = global;
@ -177,9 +178,9 @@ var SelectionSourceContent = {
+ encodeURIComponent(tmpNode.innerHTML),
drawSelection: canDrawSelection,
baseURI: doc.baseURI };
},
}
get wrapLongLines() {
return Services.prefs.getBoolPref("view_source.wrap_long_lines");
},
};
}
}

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

@ -9,6 +9,7 @@ FINAL_TARGET_FILES.actors += [
'FindBarChild.jsm',
'PrintingChild.jsm',
'SelectChild.jsm',
'SelectionSourceChild.jsm',
'ThumbnailsChild.jsm',
'ZoomChild.jsm',
]

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

@ -44,9 +44,6 @@ XPCOMUtils.defineLazyProxy(this, "UITourListener", () => {
return new tmp.UITourListener(global);
});
XPCOMUtils.defineLazyProxy(this, "SelectionSourceContent",
"resource://gre/modules/SelectionSourceContent.jsm");
XPCOMUtils.defineLazyProxy(this, "WebChannelContent",
"resource://gre/modules/WebChannelContent.jsm");
@ -138,8 +135,6 @@ addMessageListener("Browser:PurgeSessionHistory", function BrowserPurgeHistory()
}
});
addMessageListener("ViewSource:GetSelection", SelectionSourceContent);
let AutoComplete = {
_connected: false,

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

@ -148,6 +148,15 @@ let ACTORS = {
},
},
SelectionSource: {
child: {
module: "resource://gre/actors/SelectionSourceChild.jsm",
messages: [
"ViewSource:GetSelection",
],
},
},
Thumbnails: {
child: {
module: "resource://gre/actors/ThumbnailsChild.jsm",

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

@ -241,7 +241,6 @@ EXTRA_JS_MODULES += [
'RemoteWebProgress.jsm',
'ResetProfile.jsm',
'ResponsivenessMonitor.jsm',
'SelectionSourceContent.jsm',
'SelectParentHelper.jsm',
'ServiceRequest.jsm',
'Services.jsm',