зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
96bdaf839b
Коммит
dbbb50d17a
|
@ -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',
|
||||
|
|
Загрузка…
Ссылка в новой задаче