Skip to content

Commit

Permalink
Merge fx-team to m-c.
Browse files Browse the repository at this point in the history
  • Loading branch information
joewalker committed Mar 8, 2013
2 parents 2301004 + a8db768 commit 4af8414
Show file tree
Hide file tree
Showing 54 changed files with 1,331 additions and 425 deletions.
3 changes: 3 additions & 0 deletions browser/app/profile/firefox.js
Expand Up @@ -1146,6 +1146,9 @@ pref("devtools.editor.expandtab", true);
// indenting and bracket recognition.
pref("devtools.editor.component", "orion");

// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);

// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
Expand Down
4 changes: 2 additions & 2 deletions browser/devtools/commandline/gcli.jsm
Expand Up @@ -7022,8 +7022,8 @@ define("text!gcli/ui/intro.html", [], "\n" +
" <p>\n" +
" ${l10n.introTextCommands}\n" +
" <span class=\"gcli-out-shortcut\" onclick=\"${onclick}\"\n" +
" ondblclick=\"${ondblclick}\" data-command=\"help\">help</span>\n" +
" ${l10n.introTextKeys2} <code>${l10n.introTextF1Escape}</code>.\n" +
" ondblclick=\"${ondblclick}\" data-command=\"help\">help</span>${l10n.introTextKeys2}\n" +
" <code>${l10n.introTextF1Escape}</code>.\n" +
" </p>\n" +
"\n" +
" <button onclick=\"${onGotIt}\" if=\"${showHideButton}\">${l10n.introTextGo}</button>\n" +
Expand Down
14 changes: 11 additions & 3 deletions browser/devtools/commandline/test/browser_dbg_cmd.js
Expand Up @@ -47,13 +47,21 @@ function testCommands(dbg, cmd) {
is(output.value, "dbg continue", "debugger continued");
DeveloperToolbarTest.exec({
typed: "dbg close",
completed: false,
blankOutput: true
});

let target = TargetFactory.forTab(gBrowser.selectedTab);
ok(!gDevTools.getToolbox(target),
"Debugger was closed.");
finish();
let toolbox = gDevTools.getToolbox(target);
if (!toolbox) {
ok(true, "Debugger was closed.");
finish();
} else {
toolbox.on("destroyed", function () {
ok(true, "Debugger was closed.");
finish();
});
}
});
});
});
Expand Down
23 changes: 14 additions & 9 deletions browser/devtools/debugger/DebuggerPanel.jsm
Expand Up @@ -10,9 +10,11 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
this.EXPORTED_SYMBOLS = ["DebuggerPanel"];

Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource:///modules/devtools/EventEmitter.jsm");

XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/commonjs/sdk/core/promise.js");

XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
"resource://gre/modules/devtools/dbg-server.jsm");

Expand All @@ -37,13 +39,6 @@ DebuggerPanel.prototype = {

this._ensureOnlyOneRunningDebugger();

if (!this.target.isRemote) {
if (!DebuggerServer.initialized) {
DebuggerServer.init();
DebuggerServer.addBrowserActors();
}
}

let onDebuggerLoaded = function () {
this.panelWin.removeEventListener("Debugger:Loaded",
onDebuggerLoaded, true);
Expand All @@ -62,7 +57,16 @@ DebuggerPanel.prototype = {
this.panelWin.addEventListener("Debugger:Connected",
onDebuggerConnected, true);

return deferred.promise;
// Remote debugging gets the debuggee from a RemoteTarget object.
if (this.target.isRemote) {
this.panelWin._remoteFlag = true;
return deferred.promise;
}

// Local debugging needs to convert the TabTarget to a RemoteTarget.
return this.target.makeRemote().then(function success() {
return deferred.promise;
});
},

// DevToolPanel API
Expand All @@ -71,6 +75,7 @@ DebuggerPanel.prototype = {
get isReady() this._isReady,

destroy: function() {
this.emit("destroyed");
return Promise.resolve(null);
},

Expand Down
34 changes: 11 additions & 23 deletions browser/devtools/debugger/debugger-controller.js
Expand Up @@ -99,7 +99,7 @@ let DebuggerController = {
/**
* Prepares the hostname and port number for a remote debugger connection
* and handles connection retries and timeouts.
*
* XXX: remove all this (bug 823577)
* @return boolean
* True if connection should proceed normally, false otherwise.
*/
Expand Down Expand Up @@ -165,15 +165,11 @@ let DebuggerController = {
window.dispatchEvent("Debugger:Connected");
}

let client;

// Remote debugging gets the debuggee from a RemoteTarget object.
if (this._target && this._target.isRemote) {
window._isRemoteDebugger = true;

client = this.client = this._target.client;
if (!window._isChromeDebugger) {
let client = this.client = this._target.client;
this._target.on("close", this._onTabDetached);
this._target.on("navigate", this._onTabNavigated);
this._target.on("will-navigate", this._onTabNavigated);

if (this._target.chrome) {
let dbg = this._target.form.chromeDebugger;
Expand All @@ -184,25 +180,16 @@ let DebuggerController = {
return;
}

// Content or chrome debugging can connect directly to the debuggee.
// TODO: convert this to use a TabTarget.
let transport = window._isChromeDebugger
? debuggerSocketConnect(Prefs.remoteHost, Prefs.remotePort)
: DebuggerServer.connectPipe();
// Chrome debugging needs to make the connection to the debuggee.
let transport = debuggerSocketConnect(Prefs.remoteHost, Prefs.remotePort);

client = this.client = new DebuggerClient(transport);
let client = this.client = new DebuggerClient(transport);
client.addListener("tabNavigated", this._onTabNavigated);
client.addListener("tabDetached", this._onTabDetached);

client.connect(function(aType, aTraits) {
client.listTabs(function(aResponse) {
if (window._isChromeDebugger) {
let dbg = aResponse.chromeDebugger;
this._startChromeDebugging(client, dbg, callback);
} else {
let tab = aResponse.tabs[aResponse.selected];
this._startDebuggingTab(client, tab, callback);
}
this._startChromeDebugging(client, aResponse.chromeDebugger, callback);
}.bind(this));
}.bind(this));
},
Expand All @@ -218,8 +205,9 @@ let DebuggerController = {
this.client.removeListener("tabNavigated", this._onTabNavigated);
this.client.removeListener("tabDetached", this._onTabDetached);

// When remote debugging, the connection is closed by the RemoteTarget.
if (!window._isRemoteDebugger) {
// When debugging content or a remote instance, the connection is closed by
// the RemoteTarget.
if (window._isChromeDebugger) {
this.client.close();
}

Expand Down
13 changes: 13 additions & 0 deletions browser/devtools/fontinspector/Makefile.in
@@ -0,0 +1,13 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.

DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

include $(topsrcdir)/config/rules.mk
16 changes: 16 additions & 0 deletions browser/devtools/fontinspector/font-inspector.css
@@ -0,0 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */

.dim > #root,
.font:not(.has-code) .font-css-code,
.font-is-local,
.font-is-remote,
.font.is-local .font-format-url {
display: none;
}

.font.is-remote .font-is-remote,
.font.is-local .font-is-local {
display: inline;
}

0 comments on commit 4af8414

Please sign in to comment.