зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1091260 - Badge the Browser Toolbox dock icon on OS X to differentiate it from the main process. r=jryans,fitzgen
--HG-- extra : rebase_source : 561016578d5a23c769090faf6c735b3060d4e741
This commit is contained in:
Родитель
f1815f5243
Коммит
b87382dd24
|
@ -18,6 +18,5 @@ EXTRA_JS_MODULES.devtools.framework += [
|
|||
'toolbox-highlighter-utils.js',
|
||||
'toolbox-hosts.js',
|
||||
'toolbox-options.js',
|
||||
'toolbox-process-window.js',
|
||||
'toolbox.js',
|
||||
]
|
||||
|
|
|
@ -92,6 +92,37 @@ function onNewToolbox(toolbox) {
|
|||
function bindToolboxHandlers() {
|
||||
gToolbox.once("destroyed", quitApp);
|
||||
window.addEventListener("unload", onUnload);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// Badge the dock icon to differentiate this process from the main application process.
|
||||
updateBadgeText(false);
|
||||
|
||||
// Check if the debugger panel is already loaded otherwise listen for it to be.
|
||||
if (gToolbox.getPanel("jsdebugger")) {
|
||||
setupThreadListeners(gToolbox.getPanel("jsdebugger"));
|
||||
} else {
|
||||
gToolbox.once("jsdebugger-ready", (e, panel) => setupThreadListeners(panel));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
function setupThreadListeners(panel) {
|
||||
updateBadgeText(panel._controller.activeThread.state == "paused");
|
||||
|
||||
let onPaused = updateBadgeText.bind(null, true);
|
||||
let onResumed = updateBadgeText.bind(null, false);
|
||||
panel.target.on("thread-paused", onPaused);
|
||||
panel.target.on("thread-resumed", onResumed);
|
||||
|
||||
panel.once("destroyed", () => {
|
||||
panel.off("thread-paused", onPaused);
|
||||
panel.off("thread-resumed", onResumed);
|
||||
});
|
||||
}
|
||||
|
||||
function updateBadgeText(paused) {
|
||||
let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"].getService(Ci.nsIMacDockSupport);
|
||||
dockSupport.badgeText = paused ? "▐▐ " : " ▶";
|
||||
}
|
||||
|
||||
function onUnload() {
|
||||
|
|
|
@ -102,7 +102,7 @@ browser.jar:
|
|||
content/browser/devtools/framework/toolbox.xul (framework/toolbox.xul)
|
||||
content/browser/devtools/framework/options-panel.css (framework/options-panel.css)
|
||||
content/browser/devtools/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
|
||||
content/browser/devtools/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
|
||||
* content/browser/devtools/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
|
||||
content/browser/devtools/framework/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul)
|
||||
content/browser/devtools/framework/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
|
||||
content/browser/devtools/framework/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
|
||||
|
|
Загрузка…
Ссылка в новой задаче