mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Bug 1147329 - Handle in-process case for Cut/Copy/Paste feature. r=kanru
--HG-- extra : commitid : H2bSIbLfEXs
This commit is contained in:
parent
4b4ac7d1cb
commit
76c380be23
@ -41,7 +41,15 @@ if (!('BrowserElementIsPreloaded' in this)) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||
// general content apps
|
||||
if (isTopBrowserElement(docShell)) {
|
||||
Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementCopyPaste.js");
|
||||
}
|
||||
} else {
|
||||
// rocketbar in system app and other in-process case (ex. B2G desktop client)
|
||||
Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementCopyPaste.js");
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
dump("###################################### BrowserElementCopyPaste.js loaded\n");
|
||||
|
||||
let { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
||||
|
||||
let CopyPasteAssistent = {
|
||||
COMMAND_MAP: {
|
||||
'cut': 'cmd_cut',
|
||||
@ -81,6 +83,13 @@ let CopyPasteAssistent = {
|
||||
detail.rect.left += currentRect.left;
|
||||
detail.rect.right += currentRect.left;
|
||||
currentWindow = currentWindow.realFrameElement.ownerDocument.defaultView;
|
||||
|
||||
let targetDocShell = currentWindow
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation);
|
||||
if(targetDocShell.isBrowserOrApp) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sendAsyncMsg('caretstatechanged', detail);
|
||||
|
Loading…
x
Reference in New Issue
Block a user