Merge fx-team to m-c. a=merge

This commit is contained in:
Ryan VanderMeulen 2014-06-08 13:15:44 -04:00
commit f2bade55ae
13 changed files with 193 additions and 33 deletions

View File

@ -198,12 +198,10 @@
</groupbox>
#ifdef HAVE_SHELL_SERVICE
<!-- System Defaults -->
<groupbox id="systemDefaultsGroup" orient="vertical">
<groupbox id="systemDefaultsGroup" orient="vertical" align="start">
<caption><label>&systemDefaults.label;</label></caption>
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
flex="1"/>
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"/>
<hbox class="indent">
<deck id="setDefaultPane">
<button id="setDefaultButton"
@ -293,11 +291,13 @@
label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
oncommand="gAdvancedPane.clearCache();"/>
</hbox>
<hbox>
<checkbox preference="browser.cache.disk.smart_size.enabled"
id="allowSmartSize" flex="1"
id="allowSmartSize"
onsyncfrompreference="return gAdvancedPane.readSmartSizeEnabled();"
label="&overrideSmartCacheSize.label;"
accesskey="&overrideSmartCacheSize.accesskey;"/>
</hbox>
<hbox align="center" class="indent">
<label id="useCacheBefore" control="cacheSize"
accesskey="&limitCacheSizeBefore.accesskey;">
@ -323,10 +323,11 @@
oncommand="gAdvancedPane.clearOfflineAppCache();"/>
</hbox>
<hbox align="center">
<checkbox id="offlineNotify" flex="1"
<checkbox id="offlineNotify"
label="&offlineNotify.label;" accesskey="&offlineNotify.accesskey;"
preference="browser.offline-apps.notify"
onsyncfrompreference="return gAdvancedPane.readOfflineNotify();"/>
<spacer flex="1"/>
<button id="offlineNotifyExceptions"
label="&offlineNotifyExceptions.label;"
accesskey="&offlineNotifyExceptions.accesskey;"
@ -356,7 +357,7 @@
<!-- Update -->
<tabpanel id="updatePanel" orient="vertical">
#ifdef MOZ_UPDATER
<groupbox id="updateApp">
<groupbox id="updateApp" align="start">
<caption><label>&updateApp.label;</label></caption>
<radiogroup id="updateRadioGroup"
oncommand="gAdvancedPane.updateWritePrefs();">
@ -408,7 +409,7 @@
#endif
</groupbox>
#endif
<groupbox id="updateOthers">
<groupbox id="updateOthers" align="start">
<caption><label>&updateOthers.label;</label></caption>
<checkbox id="enableSearchUpdate"
label="&enableSearchUpdate.label;"

View File

@ -188,16 +188,18 @@
preference="browser.download.folderList"
onsynctopreference="return gMainPane.getFolderListPref();"/>
</hbox>
<hbox>
<radio id="alwaysAsk"
value="false"
label="&alwaysAsk.label;"
accesskey="&alwaysAsk.accesskey;"/>
</hbox>
</radiogroup>
</groupbox>
<!-- Tab preferences -->
<groupbox data-category="paneGeneral"
hidden="true">
hidden="true" align="start">
<caption><label>&tabsGroup.label;</label></caption>
<checkbox id="linkTargeting" label="&newWindowsAsTabs.label;"
accesskey="&newWindowsAsTabs.accesskey;"

View File

@ -45,11 +45,12 @@
<caption><label>&general.label;</label></caption>
<hbox id="addonInstallBox">
<checkbox id="warnAddonInstall" flex="1"
<checkbox id="warnAddonInstall"
label="&warnAddonInstall.label;"
accesskey="&warnAddonInstall.accesskey;"
preference="xpinstall.whitelist.required"
onsyncfrompreference="return gSecurityPane.readWarnAddonInstall();"/>
<spacer flex="1"/>
<button id="addonExceptions"
label="&addonExceptions.label;"
accesskey="&addonExceptions.accesskey;"
@ -57,6 +58,7 @@
</hbox>
<separator class="thin"/>
<vbox align="start">
<checkbox id="blockAttackSites"
label="&blockAttackSites.label;"
accesskey="&blockAttackSites.accesskey;"
@ -65,6 +67,7 @@
label="&blockWebForgeries.label;"
accesskey="&blockWebForgeries.accesskey;"
preference="browser.safebrowsing.enabled" />
</vbox>
</groupbox>
<!-- Passwords -->
@ -72,10 +75,11 @@
<caption><label>&passwords.label;</label></caption>
<hbox id="savePasswordsBox">
<checkbox id="savePasswords" flex="1"
<checkbox id="savePasswords"
label="&rememberPasswords.label;" accesskey="&rememberPasswords.accesskey;"
preference="signon.rememberSignons"
onsyncfrompreference="return gSecurityPane.readSavePasswords();"/>
<spacer flex="1"/>
<button id="passwordExceptions"
label="&passwordExceptions.label;"
accesskey="&passwordExceptions.accesskey;"
@ -83,10 +87,11 @@
preference="pref.privacy.disable_button.view_passwords_exceptions"/>
</hbox>
<hbox id="masterPasswordBox">
<checkbox id="useMasterPassword" flex="1"
<checkbox id="useMasterPassword"
oncommand="gSecurityPane.updateMasterPasswordButton();"
label="&useMasterPassword.label;"
accesskey="&useMasterPassword.accesskey;"/>
<spacer flex="1"/>
<button id="changeMasterPassword"
label="&changeMasterPassword.label;"
accesskey="&changeMasterPassword.accesskey;"

View File

@ -195,7 +195,7 @@
<spacer flex="1"/>
</vbox>
<vbox id="noFxaAccount">
<vbox id="noFxaAccount" align="start">
<label>&welcome.description;</label>
<label class="text-link"
onclick="gSyncPane.signUp(); return false;">

View File

@ -27,6 +27,7 @@ support-files =
[browser_toolbox_sidebar.js]
[browser_toolbox_tabsswitch_shortcuts.js]
[browser_toolbox_tool_ready.js]
[browser_toolbox_window_reload_target.js]
[browser_toolbox_window_shortcuts.js]
[browser_toolbox_window_title_changes.js]
[browser_toolbox_zoom.js]

View File

@ -0,0 +1,101 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
let Toolbox = devtools.Toolbox;
let target, toolbox, description, reloadsSent, toolIDs;
function test() {
waitForExplicitFinish();
addTab("data:text/html;charset=utf-8,"+
"<html><head><title>Test reload</title></head>"+
"<body><h1>Testing reload from devtools</h1></body></html>",
() => {
target = TargetFactory.forTab(gBrowser.selectedTab);
target.makeRemote().then(() => {
toolIDs = gDevTools.getToolDefinitionArray()
.filter(def => def.isTargetSupported(target))
.map(def => def.id);
gDevTools.showToolbox(target, toolIDs[0], Toolbox.HostType.BOTTOM)
.then(startReloadTest);
});
});
}
function startReloadTest(aToolbox) {
toolbox = aToolbox;
reloadsSent = 0;
let reloads = 0;
let reloadCounter = (event) => {
reloads++;
info("Detected reload #"+reloads);
is(reloads, reloadsSent, "Reloaded from devtools window once and only for "+description+"");
};
gBrowser.selectedBrowser.addEventListener('load', reloadCounter, true);
testAllTheTools("docked", () => {
let origHostType = toolbox.hostType;
toolbox.switchHost(Toolbox.HostType.WINDOW).then(() => {
toolbox.doc.defaultView.focus();
testAllTheTools("undocked", () => {
toolbox.switchHost(origHostType).then(() => {
gBrowser.selectedBrowser.removeEventListener('load', reloadCounter, true);
// If we finish too early, the inspector breaks promises:
toolbox.getPanel("inspector").once("new-root", finishUp);
});
});
});
}, toolIDs.length-1 /* only test 1 tool in docked mode, to cut down test time */);
}
function testAllTheTools(docked, callback, toolNum=0) {
if (toolNum >= toolIDs.length) {
return callback();
}
toolbox.selectTool(toolIDs[toolNum]).then(() => {
testReload("toolbox-reload-key", docked, toolIDs[toolNum], () => {
testReload("toolbox-reload-key2", docked, toolIDs[toolNum], () => {
testReload("toolbox-force-reload-key", docked, toolIDs[toolNum], () => {
testReload("toolbox-force-reload-key2", docked, toolIDs[toolNum], () => {
testAllTheTools(docked, callback, toolNum+1);
});
});
});
});
});
}
function synthesizeKeyForToolbox(keyId) {
let el = toolbox.doc.getElementById(keyId);
let key = el.getAttribute("key") || el.getAttribute("keycode");
let mod = {};
el.getAttribute("modifiers").split(" ").forEach((m) => mod[m+"Key"] = true);
info("Synthesizing: key="+key+", mod="+JSON.stringify(mod));
EventUtils.synthesizeKey(key, mod, toolbox.doc.defaultView);
}
function testReload(key, docked, toolID, callback) {
let complete = () => {
gBrowser.selectedBrowser.removeEventListener('load', complete, true);
return callback();
};
gBrowser.selectedBrowser.addEventListener('load', complete, true);
description = docked+" devtools with tool "+toolID+", key #" + key;
info("Testing reload in "+description);
synthesizeKeyForToolbox(key);
reloadsSent++;
}
function finishUp() {
toolbox.destroy().then(() => {
gBrowser.removeCurrentTab();
target = toolbox = description = reloadsSent = toolIDs = null;
finish();
});
}

View File

@ -247,6 +247,7 @@ Toolbox.prototype = {
this._buildTabs();
this._buildButtons();
this._addKeysToWindow();
this._addReloadKeys();
this._addToolSwitchingKeys();
this._addZoomKeys();
this._loadInitialZoom();
@ -295,6 +296,19 @@ Toolbox.prototype = {
}
},
_addReloadKeys: function() {
[
["toolbox-reload-key", false],
["toolbox-reload-key2", false],
["toolbox-force-reload-key", true],
["toolbox-force-reload-key2", true]
].forEach(([id, force]) => {
this.doc.getElementById(id).addEventListener("command", (event) => {
this.reloadTarget(force);
}, true);
});
},
_addToolSwitchingKeys: function() {
let nextKey = this.doc.getElementById("toolbox-next-tool-key");
nextKey.addEventListener("command", this.selectNextTool.bind(this), true);
@ -914,6 +928,13 @@ Toolbox.prototype = {
}
},
/**
* Tells the target tab to reload.
*/
reloadTarget: function(force) {
this.target.activeTab.reload({ force: force });
},
/**
* Loads the tool next to the currently selected tool.
*/

View File

@ -47,6 +47,22 @@
key="&toolboxZoomReset.key;"
oncommand="void(0);"
modifiers="accel"/>
<key id="toolbox-reload-key"
key="&toolboxReload.key;"
oncommand="void(0);"
modifiers="accel"/>
<key id="toolbox-force-reload-key"
key="&toolboxReload.key;"
oncommand="void(0);"
modifiers="accel shift"/>
<key id="toolbox-reload-key2"
keycode="VK_F5"
oncommand="void(0);"
modifiers=""/>
<key id="toolbox-force-reload-key2"
keycode="VK_F5"
oncommand="void(0);"
modifiers="accel"/>
</keyset>
<notificationbox id="toolbox-notificationbox" flex="1">

View File

@ -17,6 +17,8 @@
<!ENTITY toolboxZoomOut.key "-">
<!ENTITY toolboxZoomReset.key "0">
<!ENTITY toolboxReload.key "r">
<!-- LOCALIZATION NOTE (options.context.advancedSettings): This is the label for
- the heading of the advanced settings group in the options panel. -->
<!ENTITY options.context.advancedSettings "Advanced settings">

View File

@ -149,6 +149,7 @@ public class ButtonToast {
// If we are showing a toast and go in the background
// onAnimationEnd will be called when the app is restored
public void onPropertyAnimationEnd() {
mView.clearAnimation();
mView.setVisibility(View.GONE);
}
public void onPropertyAnimationStart() { }

View File

@ -1261,9 +1261,17 @@ TabClient.prototype = {
/**
* Reload the page in this tab.
*
* @param [optional] object options
* An object with a `force` property indicating whether or not
* this reload should skip the cache
*/
reload: DebuggerClient.requester({
type: "reload"
reload: function(options = { force: false }) {
return this._reload(options);
},
_reload: DebuggerClient.requester({
type: "reload",
options: args(0)
}, {
telemetry: "RELOAD"
}),

View File

@ -828,10 +828,12 @@ TabActor.prototype = {
* Reload the page in this tab.
*/
onReload: function(aRequest) {
let force = aRequest && aRequest.options && aRequest.options.force;
// Wait a tick so that the response packet can be dispatched before the
// subsequent navigation event packet.
Services.tm.currentThread.dispatch(DevToolsUtils.makeInfallible(() => {
this.window.location.reload();
this.webNavigation.reload(force ? Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE
: Ci.nsIWebNavigation.LOAD_FLAGS_NONE);
}, "TabActor.prototype.onReload's delayed body"), 0);
return {};
},

View File

@ -693,7 +693,7 @@ Barrier.prototype = Object.freeze({
" At least one completion condition failed to complete" +
" within a reasonable amount of time. Causing a crash to" +
" ensure that we do not leave the user with an unresponsive" +
" process draining resources." +
" process draining resources.";
err(msg);
if (gCrashReporter && gCrashReporter.enabled) {
let data = {