mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 20:22:00 +00:00
Merge m-c to inbound, a=merge
This commit is contained in:
commit
83a7cbf448
@ -118,3 +118,6 @@ contract @mozilla.org/app-migrator;1 {7211ece0-b458-4635-9afc-f8d7f376ee95}
|
||||
component {4a300c26-e99b-4018-ab9b-c48cf9bc4de1} B2GPresentationDevicePrompt.js
|
||||
contract @mozilla.org/presentation-device/prompt;1 {4a300c26-e99b-4018-ab9b-c48cf9bc4de1}
|
||||
|
||||
# PresentationRequestUIGlue.js
|
||||
component {ccc8a839-0b64-422b-8a60-fb2af0e376d0} PresentationRequestUIGlue.js
|
||||
contract @mozilla.org/presentation/requestuiglue;1 {ccc8a839-0b64-422b-8a60-fb2af0e376d0}
|
||||
|
62
b2g/components/PresentationRequestUIGlue.js
Normal file
62
b2g/components/PresentationRequestUIGlue.js
Normal file
@ -0,0 +1,62 @@
|
||||
/* 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/. */
|
||||
|
||||
"use strict"
|
||||
|
||||
const { interfaces: Ci, utils: Cu, classes: Cc } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
|
||||
function PresentationRequestUIGlue() {
|
||||
// This is to store the session ID / resolver binding.
|
||||
// An example of the object literal is shown below:
|
||||
//
|
||||
// {
|
||||
// "sessionId1" : resolver1,
|
||||
// ...
|
||||
// }
|
||||
this._resolvers = {};
|
||||
|
||||
// Listen to the result for the opened iframe from front-end.
|
||||
SystemAppProxy.addEventListener("mozPresentationContentEvent", aEvent => {
|
||||
let detail = aEvent.detail;
|
||||
|
||||
if (detail.type != "presentation-receiver-launched") {
|
||||
return;
|
||||
}
|
||||
|
||||
let sessionId = detail.sessionId;
|
||||
let resolver = this._resolvers[sessionId];
|
||||
if (!resolver) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete this._resolvers[sessionId];
|
||||
resolver(detail.frame);
|
||||
});
|
||||
}
|
||||
|
||||
PresentationRequestUIGlue.prototype = {
|
||||
|
||||
sendRequest: function(aUrl, aSessionId) {
|
||||
SystemAppProxy._sendCustomEvent("mozPresentationChromeEvent",
|
||||
{ type: "presentation-launch-receiver",
|
||||
url: aUrl,
|
||||
id: aSessionId });
|
||||
|
||||
return new Promise(function(aResolve, aReject) {
|
||||
this._resolvers[aSessionId] = aResolve;
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
classID: Components.ID("{ccc8a839-0b64-422b-8a60-fb2af0e376d0}"),
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationRequestUIGlue])
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationRequestUIGlue]);
|
@ -23,6 +23,7 @@ EXTRA_COMPONENTS += [
|
||||
'OMAContentHandler.js',
|
||||
'PaymentGlue.js',
|
||||
'PaymentProviderStrategy.js',
|
||||
'PresentationRequestUIGlue.js',
|
||||
'ProcessGlobal.js',
|
||||
'SmsProtocolHandler.js',
|
||||
'SystemMessageGlue.js',
|
||||
|
@ -7,6 +7,7 @@ support-files =
|
||||
screenshot_helper.js
|
||||
systemapp_helper.js
|
||||
presentation_prompt_handler_chrome.js
|
||||
presentation_ui_glue_handler_chrome.js
|
||||
|
||||
[test_filepicker_path.html]
|
||||
[test_permission_deny.html]
|
||||
@ -17,3 +18,4 @@ skip-if = true # Bug 1019572 - frequent timeouts
|
||||
[test_systemapp.html]
|
||||
[test_presentation_device_prompt.html]
|
||||
[test_permission_visibilitychange.html]
|
||||
[test_presentation_request_ui_glue.html]
|
||||
|
@ -0,0 +1,35 @@
|
||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
'use strict';
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
const { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm');
|
||||
|
||||
const glue = Cc["@mozilla.org/presentation/requestuiglue;1"]
|
||||
.createInstance(Ci.nsIPresentationRequestUIGlue);
|
||||
|
||||
SystemAppProxy.addEventListener('mozPresentationChromeEvent', function(aEvent) {
|
||||
if (!aEvent.detail || aEvent.detail.type !== 'presentation-launch-receiver') {
|
||||
return;
|
||||
}
|
||||
sendAsyncMessage('presentation-launch-receiver', aEvent.detail);
|
||||
});
|
||||
|
||||
addMessageListener('trigger-ui-glue', function(aData) {
|
||||
var promise = glue.sendRequest(aData.url, aData.sessionId);
|
||||
promise.then(function(aFrame){
|
||||
sendAsyncMessage('iframe-resolved', aFrame);
|
||||
});
|
||||
});
|
||||
|
||||
addMessageListener('trigger-presentation-content-event', function(aData) {
|
||||
var detail = {
|
||||
type: 'presentation-receiver-launched',
|
||||
sessionId: aData.sessionId,
|
||||
frame: aData.frame
|
||||
};
|
||||
SystemAppProxy._sendCustomEvent('mozPresentationContentEvent', detail);
|
||||
});
|
@ -0,0 +1,78 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Presentation Device Selection</title>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Test for Presentation UI Glue</a>
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
'use strict';
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('presentation_ui_glue_handler_chrome.js'));
|
||||
|
||||
var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIObserverService);
|
||||
|
||||
var url = 'http://example.com';
|
||||
var sessionId = 'sessionId';
|
||||
|
||||
function testLaunchReceiver() {
|
||||
return new Promise(function(aResolve, aReject) {
|
||||
gScript.addMessageListener('presentation-launch-receiver', function launchReceiverHandler(aDetail) {
|
||||
gScript.removeMessageListener('presentation-launch-receiver', launchReceiverHandler);
|
||||
ok(true, "A presentation-launch-receiver mozPresentationChromeEvent should be received.");
|
||||
is(aDetail.url, url, "Url should be the same.");
|
||||
is(aDetail.id, sessionId, "Session ID should be the same.");
|
||||
|
||||
aResolve();
|
||||
});
|
||||
|
||||
gScript.sendAsyncMessage('trigger-ui-glue',
|
||||
{ url: url,
|
||||
sessionId : sessionId });
|
||||
});
|
||||
}
|
||||
|
||||
function testReceiverLaunched() {
|
||||
return new Promise(function(aResolve, aReject) {
|
||||
gScript.addMessageListener('iframe-resolved', function iframeResolvedHandler(aFrame) {
|
||||
gScript.removeMessageListener('iframe-resolved', iframeResolvedHandler);
|
||||
ok(true, "The promise should be resolved.");
|
||||
|
||||
aResolve();
|
||||
});
|
||||
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('remote', 'true');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
iframe.setAttribute('src', 'http://example.com');
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
gScript.sendAsyncMessage('trigger-presentation-content-event',
|
||||
{ sessionId : sessionId,
|
||||
frame: iframe });
|
||||
});
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
testLaunchReceiver()
|
||||
.then(testReceiverLaunched)
|
||||
.then(function() {
|
||||
info('test finished, teardown');
|
||||
gScript.destroy();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('load', runTests);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
@ -138,7 +138,7 @@
|
||||
<project name="platform/system/core" path="system/core" revision="4b989b1bec28b0838420c4d5bb454c78afa62bea"/>
|
||||
<project name="u-boot" path="u-boot" revision="f1502910977ac88f43da7bf9277c3523ad4b0b2f"/>
|
||||
<project name="vendor/sprd/gps" path="vendor/sprd/gps" revision="7d6e1269be7186b2073fa568958b357826692c4b"/>
|
||||
<project name="vendor/sprd/open-source" path="vendor/sprd/open-source" revision="17ea4b64fb0144e0cffeb52344d10215976945fe"/>
|
||||
<project name="vendor/sprd/open-source" path="vendor/sprd/open-source" revision="295ff253b74353751a99aafd687196a28c84a58e"/>
|
||||
<project name="vendor/sprd/partner" path="vendor/sprd/partner" revision="8649c7145972251af11b0639997edfecabfc7c2e"/>
|
||||
<project name="vendor/sprd/proprietories" path="vendor/sprd/proprietories" revision="d2466593022f7078aaaf69026adf3367c2adb7bb"/>
|
||||
</manifest>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "7f387f859d48f9ad0761637c78447dc524747738",
|
||||
"git_revision": "91068221506ff05692aa187ac314e15443db68fd",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "16423131f4a9b03659d92e8ffad7a6f80a8eae37",
|
||||
"revision": "ab36b7edaadc88ece94cc213db139d1615dadf64",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7f387f859d48f9ad0761637c78447dc524747738"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="91068221506ff05692aa187ac314e15443db68fd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -960,6 +960,7 @@ bin/libfreebl_32int64_3.so
|
||||
@RESPATH@/components/SystemMessageGlue.js
|
||||
@RESPATH@/components/B2GAppMigrator.js
|
||||
@RESPATH@/components/B2GPresentationDevicePrompt.js
|
||||
@RESPATH@/components/PresentationRequestUIGlue.js
|
||||
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
@RESPATH@/components/SimulatorScreen.js
|
||||
|
@ -271,8 +271,13 @@ pref("browser.urlbar.doubleClickSelectsAll", false);
|
||||
pref("browser.urlbar.autoFill", true);
|
||||
pref("browser.urlbar.autoFill.typed", true);
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
// Use the new unifiedComplete component
|
||||
pref("browser.urlbar.unifiedcomplete", true);
|
||||
#else
|
||||
// Don't use the new unifiedComplete component
|
||||
pref("browser.urlbar.unifiedcomplete", false);
|
||||
#endif
|
||||
|
||||
// 0: Match anywhere (e.g., middle of words)
|
||||
// 1: Match on word boundaries and then try matching anywhere
|
||||
@ -305,11 +310,7 @@ pref("browser.urlbar.match.url", "@");
|
||||
pref("browser.urlbar.suggest.history", true);
|
||||
pref("browser.urlbar.suggest.bookmark", true);
|
||||
pref("browser.urlbar.suggest.openpage", true);
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("browser.urlbar.suggest.searches", true);
|
||||
#else
|
||||
pref("browser.urlbar.suggest.searches", false);
|
||||
#endif
|
||||
|
||||
// Limit the number of characters sent to the current search engine to fetch
|
||||
// suggestions.
|
||||
@ -1929,6 +1930,10 @@ pref("browser.reader.detectedFirstArticle", false);
|
||||
// Don't limit how many nodes we care about on desktop:
|
||||
pref("reader.parse-node-limit", 0);
|
||||
|
||||
// On desktop, we want the URLs to be included here for ease of debugging,
|
||||
// and because (normally) these errors are not persisted anywhere.
|
||||
pref("reader.errors.includeURLs", true);
|
||||
|
||||
pref("browser.pocket.enabled", true);
|
||||
pref("browser.pocket.api", "api.getpocket.com");
|
||||
pref("browser.pocket.site", "getpocket.com");
|
||||
|
@ -11,6 +11,13 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const prefs = new Preferences("datareporting.healthreport.");
|
||||
|
||||
const PREF_UNIFIED = "toolkit.telemetry.unified";
|
||||
const PREF_UNIFIED_OPTIN = "toolkit.telemetry.unifiedIsOptIn";
|
||||
|
||||
// Whether v4 behavior is enabled, i.e. unified Telemetry features are on by default.
|
||||
const IS_V4 = Preferences.get(PREF_UNIFIED, false) &&
|
||||
!Preferences.get(PREF_UNIFIED_OPTIN, false);
|
||||
|
||||
let healthReportWrapper = {
|
||||
init: function () {
|
||||
let iframe = document.getElementById("remote-report");
|
||||
@ -28,7 +35,9 @@ let healthReportWrapper = {
|
||||
},
|
||||
|
||||
_getReportURI: function () {
|
||||
let url = Services.urlFormatter.formatURLPref("datareporting.healthreport.about.reportUrl");
|
||||
const pref = IS_V4 ? "datareporting.healthreport.about.reportUrl"
|
||||
: "datareporting.healthreport.about.reportUrlUnified";
|
||||
let url = Services.urlFormatter.formatURLPref(pref);
|
||||
return Services.io.newURI(url, null, null);
|
||||
},
|
||||
|
||||
|
@ -277,6 +277,7 @@ let gFxAccounts = {
|
||||
this.panelUIFooter.removeAttribute("fxastatus");
|
||||
this.panelUIFooter.removeAttribute("fxaprofileimage");
|
||||
this.panelUIAvatar.style.removeProperty("list-style-image");
|
||||
let showErrorBadge = false;
|
||||
|
||||
if (!this._inCustomizationMode && userData) {
|
||||
// At this point we consider the user as logged-in (but still can be in an error state)
|
||||
@ -285,6 +286,7 @@ let gFxAccounts = {
|
||||
this.panelUIFooter.setAttribute("fxastatus", "error");
|
||||
this.panelUILabel.setAttribute("label", errorLabel);
|
||||
this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription);
|
||||
showErrorBadge = true;
|
||||
} else {
|
||||
this.panelUIFooter.setAttribute("fxastatus", "signedin");
|
||||
this.panelUILabel.setAttribute("label", userData.email);
|
||||
@ -294,6 +296,11 @@ let gFxAccounts = {
|
||||
this.panelUIFooter.setAttribute("fxaprofileimage", "enabled");
|
||||
}
|
||||
}
|
||||
if (showErrorBadge) {
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication");
|
||||
} else {
|
||||
gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_FXA);
|
||||
}
|
||||
}
|
||||
|
||||
let updateWithProfile = (profile) => {
|
||||
|
@ -16,7 +16,6 @@ let gSyncUI = {
|
||||
_obs: ["weave:service:sync:start",
|
||||
"weave:service:sync:finish",
|
||||
"weave:service:sync:error",
|
||||
"weave:service:quota:remaining",
|
||||
"weave:service:setup-complete",
|
||||
"weave:service:login:start",
|
||||
"weave:service:login:finish",
|
||||
@ -124,6 +123,9 @@ let gSyncUI = {
|
||||
firstSync == "notReady";
|
||||
},
|
||||
|
||||
// Note that we don't show login errors in a notification bar here, but do
|
||||
// still need to track a login-failed state so the "Tools" menu updates
|
||||
// with the correct state.
|
||||
_loginFailed: function () {
|
||||
this.log.debug("_loginFailed has sync state=${sync}",
|
||||
{ sync: Weave.Status.login});
|
||||
@ -142,8 +144,8 @@ let gSyncUI = {
|
||||
if (CloudSync && CloudSync.ready && CloudSync().adapters.count) {
|
||||
document.getElementById("sync-syncnow-state").hidden = false;
|
||||
} else if (loginFailed) {
|
||||
// unhiding this element makes the menubar show the login failure state.
|
||||
document.getElementById("sync-reauth-state").hidden = false;
|
||||
this.showLoginError();
|
||||
} else if (needsSetup) {
|
||||
document.getElementById("sync-setup-state").hidden = false;
|
||||
} else {
|
||||
@ -167,7 +169,6 @@ let gSyncUI = {
|
||||
this._updateLastSyncTime();
|
||||
},
|
||||
|
||||
|
||||
// Functions called by observers
|
||||
onActivityStart() {
|
||||
if (!gBrowser)
|
||||
@ -184,6 +185,7 @@ let gSyncUI = {
|
||||
container.setAttribute("syncstatus", "active");
|
||||
}
|
||||
}
|
||||
this.updateUI();
|
||||
},
|
||||
|
||||
onActivityStop() {
|
||||
@ -209,72 +211,18 @@ let gSyncUI = {
|
||||
if (fxaContainer) {
|
||||
fxaContainer.removeAttribute("syncstatus");
|
||||
}
|
||||
},
|
||||
|
||||
onLoginFinish: function SUI_onLoginFinish() {
|
||||
// Clear out any login failure notifications
|
||||
let title = this._stringBundle.GetStringFromName("error.login.title");
|
||||
this.clearError(title);
|
||||
},
|
||||
|
||||
onSetupComplete: function SUI_onSetupComplete() {
|
||||
this.onLoginFinish();
|
||||
this.updateUI();
|
||||
},
|
||||
|
||||
onLoginError: function SUI_onLoginError() {
|
||||
this.log.debug("onLoginError: login=${login}, sync=${sync}", Weave.Status);
|
||||
Weave.Notifications.removeAll();
|
||||
|
||||
// if we haven't set up the client, don't show errors
|
||||
if (this._needsSetup()) {
|
||||
this.updateUI();
|
||||
return;
|
||||
}
|
||||
// if we are still waiting for the identity manager to initialize, or it's
|
||||
// a network/server error, don't show errors. If it weren't for the legacy
|
||||
// provider we could just check LOGIN_FAILED_LOGIN_REJECTED, but the legacy
|
||||
// provider has states like LOGIN_FAILED_INVALID_PASSPHRASE which we
|
||||
// probably do want to surface.
|
||||
if (Weave.Status.login == Weave.LOGIN_FAILED_NOT_READY ||
|
||||
Weave.Status.login == Weave.LOGIN_FAILED_NETWORK_ERROR ||
|
||||
Weave.Status.login == Weave.LOGIN_FAILED_SERVER_ERROR) {
|
||||
this.updateUI();
|
||||
return;
|
||||
}
|
||||
this.showLoginError();
|
||||
// We don't show any login errors here; browser-fxaccounts shows them in
|
||||
// the hamburger menu.
|
||||
this.updateUI();
|
||||
},
|
||||
|
||||
showLoginError() {
|
||||
let title = this._stringBundle.GetStringFromName("error.login.title");
|
||||
|
||||
let description;
|
||||
if (Weave.Status.sync == Weave.PROLONGED_SYNC_FAILURE) {
|
||||
this.log.debug("showLoginError has a prolonged login error");
|
||||
// Convert to days
|
||||
let lastSync =
|
||||
Services.prefs.getIntPref("services.sync.errorhandler.networkFailureReportTimeout") / 86400;
|
||||
description =
|
||||
this._stringBundle.formatStringFromName("error.sync.prolonged_failure", [lastSync], 1);
|
||||
} else {
|
||||
let reason = Weave.Utils.getErrorString(Weave.Status.login);
|
||||
description =
|
||||
this._stringBundle.formatStringFromName("error.sync.description", [reason], 1);
|
||||
this.log.debug("showLoginError has a non-prolonged error", reason);
|
||||
}
|
||||
|
||||
let buttons = [];
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.login.prefs.label"),
|
||||
this._stringBundle.GetStringFromName("error.login.prefs.accesskey"),
|
||||
function() { gSyncUI.openPrefs(); return true; }
|
||||
));
|
||||
|
||||
let notification = new Weave.Notification(title, description, null,
|
||||
Weave.Notifications.PRIORITY_WARNING, buttons);
|
||||
Weave.Notifications.replaceTitle(notification);
|
||||
},
|
||||
|
||||
onLogout: function SUI_onLogout() {
|
||||
this.updateUI();
|
||||
},
|
||||
@ -283,31 +231,11 @@ let gSyncUI = {
|
||||
this.clearError();
|
||||
},
|
||||
|
||||
onQuotaNotice: function onQuotaNotice(subject, data) {
|
||||
let title = this._stringBundle.GetStringFromName("warning.sync.quota.label");
|
||||
let description = this._stringBundle.GetStringFromName("warning.sync.quota.description");
|
||||
let buttons = [];
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"),
|
||||
function() { gSyncUI.openQuotaDialog(); return true; }
|
||||
));
|
||||
|
||||
let notification = new Weave.Notification(
|
||||
title, description, null, Weave.Notifications.PRIORITY_WARNING, buttons);
|
||||
Weave.Notifications.replaceTitle(notification);
|
||||
},
|
||||
|
||||
_getAppName: function () {
|
||||
let brand = new StringBundle("chrome://branding/locale/brand.properties");
|
||||
return brand.get("brandShortName");
|
||||
},
|
||||
|
||||
openServerStatus: function () {
|
||||
let statusURL = Services.prefs.getCharPref("services.sync.statusURL");
|
||||
window.openUILinkIn(statusURL, "tab");
|
||||
},
|
||||
|
||||
// Commands
|
||||
doSync: function SUI_doSync() {
|
||||
let needsSetup = this._needsSetup();
|
||||
@ -326,9 +254,6 @@ let gSyncUI = {
|
||||
this.doSync();
|
||||
},
|
||||
|
||||
//XXXzpao should be part of syncCommon.js - which we might want to make a module...
|
||||
// To be fixed in a followup (bug 583366)
|
||||
|
||||
/**
|
||||
* Invoke the Sync setup wizard.
|
||||
*
|
||||
@ -384,16 +309,6 @@ let gSyncUI = {
|
||||
"syncAddDevice", "centerscreen,chrome,resizable=no");
|
||||
},
|
||||
|
||||
openQuotaDialog: function SUI_openQuotaDialog() {
|
||||
let win = Services.wm.getMostRecentWindow("Sync:ViewQuota");
|
||||
if (win)
|
||||
win.focus();
|
||||
else
|
||||
Services.ww.activeWindow.openDialog(
|
||||
"chrome://browser/content/sync/quota.xul", "",
|
||||
"centerscreen,chrome,dialog,modal");
|
||||
},
|
||||
|
||||
openPrefs: function SUI_openPrefs() {
|
||||
openPreferences("paneSync");
|
||||
},
|
||||
@ -450,81 +365,6 @@ let gSyncUI = {
|
||||
this.clearError(title);
|
||||
},
|
||||
|
||||
onSyncError: function SUI_onSyncError() {
|
||||
this.log.debug("onSyncError: login=${login}, sync=${sync}", Weave.Status);
|
||||
let title = this._stringBundle.GetStringFromName("error.sync.title");
|
||||
|
||||
if (Weave.Status.login != Weave.LOGIN_SUCCEEDED) {
|
||||
this.onLoginError();
|
||||
return;
|
||||
}
|
||||
|
||||
let description;
|
||||
if (Weave.Status.sync == Weave.PROLONGED_SYNC_FAILURE) {
|
||||
// Convert to days
|
||||
let lastSync =
|
||||
Services.prefs.getIntPref("services.sync.errorhandler.networkFailureReportTimeout") / 86400;
|
||||
description =
|
||||
this._stringBundle.formatStringFromName("error.sync.prolonged_failure", [lastSync], 1);
|
||||
} else {
|
||||
let error = Weave.Utils.getErrorString(Weave.Status.sync);
|
||||
description =
|
||||
this._stringBundle.formatStringFromName("error.sync.description", [error], 1);
|
||||
}
|
||||
let priority = Weave.Notifications.PRIORITY_WARNING;
|
||||
let buttons = [];
|
||||
|
||||
// Check if the client is outdated in some way (but note: we've never in the
|
||||
// past, and probably never will, bump the relevent version numbers, so
|
||||
// this is effectively dead code!)
|
||||
let outdated = Weave.Status.sync == Weave.VERSION_OUT_OF_DATE;
|
||||
for (let [engine, reason] in Iterator(Weave.Status.engines))
|
||||
outdated = outdated || reason == Weave.VERSION_OUT_OF_DATE;
|
||||
|
||||
if (outdated) {
|
||||
description = this._stringBundle.GetStringFromName(
|
||||
"error.sync.needUpdate.description");
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.needUpdate.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.needUpdate.accesskey"),
|
||||
function() { window.openUILinkIn("https://services.mozilla.com/update/", "tab"); return true; }
|
||||
));
|
||||
}
|
||||
else if (Weave.Status.sync == Weave.OVER_QUOTA) {
|
||||
description = this._stringBundle.GetStringFromName(
|
||||
"error.sync.quota.description");
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName(
|
||||
"error.sync.viewQuotaButton.label"),
|
||||
this._stringBundle.GetStringFromName(
|
||||
"error.sync.viewQuotaButton.accesskey"),
|
||||
function() { gSyncUI.openQuotaDialog(); return true; } )
|
||||
);
|
||||
}
|
||||
else if (Weave.Status.enforceBackoff) {
|
||||
priority = Weave.Notifications.PRIORITY_INFO;
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
|
||||
function() { gSyncUI.openServerStatus(); return true; }
|
||||
));
|
||||
}
|
||||
else {
|
||||
priority = Weave.Notifications.PRIORITY_INFO;
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.tryAgainButton.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.tryAgainButton.accesskey"),
|
||||
function() { gSyncUI.doSync(); return true; }
|
||||
));
|
||||
}
|
||||
|
||||
let notification =
|
||||
new Weave.Notification(title, description, null, priority, buttons);
|
||||
Weave.Notifications.replaceTitle(notification);
|
||||
|
||||
this.updateUI();
|
||||
},
|
||||
|
||||
observe: function SUI_observe(subject, topic, data) {
|
||||
this.log.debug("observed", topic);
|
||||
if (this._unloaded) {
|
||||
@ -559,16 +399,8 @@ let gSyncUI = {
|
||||
this.onSyncFinish();
|
||||
break;
|
||||
case "weave:ui:sync:error":
|
||||
this.onSyncError();
|
||||
break;
|
||||
case "weave:service:quota:remaining":
|
||||
this.onQuotaNotice();
|
||||
break;
|
||||
case "weave:service:setup-complete":
|
||||
this.onSetupComplete();
|
||||
break;
|
||||
case "weave:service:login:finish":
|
||||
this.onLoginFinish();
|
||||
this.updateUI();
|
||||
break;
|
||||
case "weave:ui:login:error":
|
||||
this.onLoginError();
|
||||
|
@ -1391,6 +1391,8 @@ var gBrowserInit = {
|
||||
// Add Devtools menuitems and listeners
|
||||
gDevToolsBrowser.registerBrowserWindow(window);
|
||||
|
||||
gMenuButtonBadgeManager.init();
|
||||
|
||||
gMenuButtonUpdateBadge.init();
|
||||
|
||||
window.addEventListener("mousemove", MousePosTracker, false);
|
||||
@ -1546,6 +1548,8 @@ var gBrowserInit = {
|
||||
|
||||
gMenuButtonUpdateBadge.uninit();
|
||||
|
||||
gMenuButtonBadgeManager.uninit();
|
||||
|
||||
SidebarUI.uninit();
|
||||
|
||||
// Now either cancel delayedStartup, or clean up the services initialized from
|
||||
@ -2569,6 +2573,67 @@ function PageProxyClickHandler(aEvent)
|
||||
middleMousePaste(aEvent);
|
||||
}
|
||||
|
||||
let gMenuButtonBadgeManager = {
|
||||
BADGEID_APPUPDATE: "update",
|
||||
BADGEID_FXA: "fxa",
|
||||
|
||||
fxaBadge: null,
|
||||
appUpdateBadge: null,
|
||||
|
||||
init: function () {
|
||||
PanelUI.panel.addEventListener("popupshowing", this, true);
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
PanelUI.panel.removeEventListener("popupshowing", this, true);
|
||||
},
|
||||
|
||||
handleEvent: function (e) {
|
||||
if (e.type === "popupshowing") {
|
||||
this.clearBadges();
|
||||
}
|
||||
},
|
||||
|
||||
_showBadge: function () {
|
||||
let badgeToShow = this.appUpdateBadge || this.fxaBadge;
|
||||
|
||||
if (badgeToShow) {
|
||||
PanelUI.menuButton.setAttribute("badge-status", badgeToShow);
|
||||
} else {
|
||||
PanelUI.menuButton.removeAttribute("badge-status");
|
||||
}
|
||||
},
|
||||
|
||||
_changeBadge: function (badgeId, badgeStatus = null) {
|
||||
if (badgeId == this.BADGEID_APPUPDATE) {
|
||||
this.appUpdateBadge = badgeStatus;
|
||||
} else if (badgeId == this.BADGEID_FXA) {
|
||||
this.fxaBadge = badgeStatus;
|
||||
} else {
|
||||
Cu.reportError("This badge ID is unknown!");
|
||||
}
|
||||
this._showBadge();
|
||||
},
|
||||
|
||||
addBadge: function (badgeId, badgeStatus) {
|
||||
if (!badgeStatus) {
|
||||
Cu.reportError("badgeStatus must be defined");
|
||||
return;
|
||||
}
|
||||
this._changeBadge(badgeId, badgeStatus);
|
||||
},
|
||||
|
||||
removeBadge: function (badgeId) {
|
||||
this._changeBadge(badgeId);
|
||||
},
|
||||
|
||||
clearBadges: function () {
|
||||
this.appUpdateBadge = null;
|
||||
this.fxaBadge = null;
|
||||
this._showBadge();
|
||||
}
|
||||
};
|
||||
|
||||
// Setup the hamburger button badges for updates, if enabled.
|
||||
let gMenuButtonUpdateBadge = {
|
||||
enabled: false,
|
||||
@ -2585,7 +2650,6 @@ let gMenuButtonUpdateBadge = {
|
||||
} catch (e) {
|
||||
this.badgeWaitTime = 345600; // 4 days
|
||||
}
|
||||
PanelUI.menuButton.classList.add("badged-button");
|
||||
Services.obs.addObserver(this, "update-staged", false);
|
||||
Services.obs.addObserver(this, "update-downloaded", false);
|
||||
}
|
||||
@ -2597,7 +2661,6 @@ let gMenuButtonUpdateBadge = {
|
||||
if (this.enabled) {
|
||||
Services.obs.removeObserver(this, "update-staged");
|
||||
Services.obs.removeObserver(this, "update-downloaded");
|
||||
PanelUI.panel.removeEventListener("popupshowing", this, true);
|
||||
this.enabled = false;
|
||||
}
|
||||
},
|
||||
@ -2645,10 +2708,8 @@ let gMenuButtonUpdateBadge = {
|
||||
|
||||
displayBadge: function (succeeded) {
|
||||
let status = succeeded ? "succeeded" : "failed";
|
||||
PanelUI.menuButton.setAttribute("update-status", status);
|
||||
if (!succeeded) {
|
||||
PanelUI.menuButton.setAttribute("badge", "!");
|
||||
}
|
||||
let badgeStatus = "update-" + status;
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE, badgeStatus);
|
||||
|
||||
let stringId;
|
||||
let updateButtonText;
|
||||
@ -2667,15 +2728,6 @@ let gMenuButtonUpdateBadge = {
|
||||
updateButton.setAttribute("label", updateButtonText);
|
||||
updateButton.setAttribute("update-status", status);
|
||||
updateButton.hidden = false;
|
||||
|
||||
PanelUI.panel.addEventListener("popupshowing", this, true);
|
||||
},
|
||||
|
||||
handleEvent: function(e) {
|
||||
if (e.type === "popupshowing") {
|
||||
PanelUI.menuButton.removeAttribute("badge");
|
||||
PanelUI.panel.removeEventListener("popupshowing", this, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -7147,9 +7199,11 @@ var gIdentityHandler = {
|
||||
let position = elem.compareDocumentPosition(this._identityPopup);
|
||||
|
||||
if (!(position & (Node.DOCUMENT_POSITION_CONTAINS |
|
||||
Node.DOCUMENT_POSITION_CONTAINED_BY))) {
|
||||
Node.DOCUMENT_POSITION_CONTAINED_BY)) &&
|
||||
!this._identityPopup.hasAttribute("noautohide")) {
|
||||
// Hide the panel when focusing an element that is
|
||||
// neither an ancestor nor descendant.
|
||||
// neither an ancestor nor descendant unless the panel has
|
||||
// @noautohide (e.g. for a tour).
|
||||
this._identityPopup.hidePopup();
|
||||
}
|
||||
},
|
||||
|
@ -147,10 +147,12 @@
|
||||
|
||||
<!-- for url bar autocomplete -->
|
||||
<panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true">
|
||||
#ifdef NIGHTLY_BUILD
|
||||
<hbox id="urlbar-search-footer" flex="1" align="stretch" pack="end">
|
||||
<button id="urlbar-search-settings" label="&changeSearchSettings.button;"
|
||||
oncommand="BrowserUITelemetry.countSearchSettingsEvent('urlbar'); openPreferences('paneSearch')"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</panel>
|
||||
|
||||
<!-- for select dropdowns. The menupopup is what shows the list of options,
|
||||
@ -960,7 +962,7 @@
|
||||
class="chromeclass-toolbar-additional"
|
||||
removable="false">
|
||||
<toolbarbutton id="PanelUI-menu-button"
|
||||
class="toolbarbutton-1"
|
||||
class="toolbarbutton-1 badged-button"
|
||||
consumeanchor="PanelUI-button"
|
||||
label="&brandShortName;"
|
||||
tooltiptext="&appmenu.tooltip;"/>
|
||||
|
@ -789,6 +789,10 @@ input[type=button] {
|
||||
color: #4A90E2;
|
||||
}
|
||||
|
||||
#newtab-intro-text > p > a:hover {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#newtab-intro-text .newtab-control {
|
||||
background-size: 18px auto;
|
||||
height: 18px;
|
||||
|
@ -1,267 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
Cu.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
|
||||
let gSyncQuota = {
|
||||
|
||||
init: function init() {
|
||||
this.bundle = document.getElementById("quotaStrings");
|
||||
let caption = document.getElementById("treeCaption");
|
||||
caption.firstChild.nodeValue = this.bundle.getString("quota.treeCaption.label");
|
||||
|
||||
gUsageTreeView.init();
|
||||
this.tree = document.getElementById("usageTree");
|
||||
this.tree.view = gUsageTreeView;
|
||||
|
||||
this.loadData();
|
||||
},
|
||||
|
||||
loadData: function loadData() {
|
||||
this._usage_req = Weave.Service.getStorageInfo(Weave.INFO_COLLECTION_USAGE,
|
||||
function (error, usage) {
|
||||
delete gSyncQuota._usage_req;
|
||||
// displayUsageData handles null values, so no need to check 'error'.
|
||||
gUsageTreeView.displayUsageData(usage);
|
||||
});
|
||||
|
||||
let usageLabel = document.getElementById("usageLabel");
|
||||
let bundle = this.bundle;
|
||||
|
||||
this._quota_req = Weave.Service.getStorageInfo(Weave.INFO_QUOTA,
|
||||
function (error, quota) {
|
||||
delete gSyncQuota._quota_req;
|
||||
|
||||
if (error) {
|
||||
usageLabel.value = bundle.getString("quota.usageError.label");
|
||||
return;
|
||||
}
|
||||
let used = gSyncQuota.convertKB(quota[0]);
|
||||
if (!quota[1]) {
|
||||
// No quota on the server.
|
||||
usageLabel.value = bundle.getFormattedString(
|
||||
"quota.usageNoQuota.label", used);
|
||||
return;
|
||||
}
|
||||
let percent = Math.round(100 * quota[0] / quota[1]);
|
||||
let total = gSyncQuota.convertKB(quota[1]);
|
||||
usageLabel.value = bundle.getFormattedString(
|
||||
"quota.usagePercentage.label", [percent].concat(used).concat(total));
|
||||
});
|
||||
},
|
||||
|
||||
onCancel: function onCancel() {
|
||||
if (this._usage_req) {
|
||||
this._usage_req.abort();
|
||||
}
|
||||
if (this._quota_req) {
|
||||
this._quota_req.abort();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
onAccept: function onAccept() {
|
||||
let engines = gUsageTreeView.getEnginesToDisable();
|
||||
for each (let engine in engines) {
|
||||
Weave.Service.engineManager.get(engine).enabled = false;
|
||||
}
|
||||
if (engines.length) {
|
||||
// The 'Weave' object will disappear once the window closes.
|
||||
let Service = Weave.Service;
|
||||
Weave.Utils.nextTick(function() { Service.sync(); });
|
||||
}
|
||||
return this.onCancel();
|
||||
},
|
||||
|
||||
convertKB: function convertKB(value) {
|
||||
return DownloadUtils.convertByteUnits(value * 1024);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
let gUsageTreeView = {
|
||||
|
||||
_ignored: {keys: true,
|
||||
meta: true,
|
||||
clients: true},
|
||||
|
||||
/*
|
||||
* Internal data structures underlaying the tree.
|
||||
*/
|
||||
_collections: [],
|
||||
_byname: {},
|
||||
|
||||
init: function init() {
|
||||
let retrievingLabel = gSyncQuota.bundle.getString("quota.retrieving.label");
|
||||
for each (let engine in Weave.Service.engineManager.getEnabled()) {
|
||||
if (this._ignored[engine.name])
|
||||
continue;
|
||||
|
||||
// Some engines use the same pref, which means they can only be turned on
|
||||
// and off together. We need to combine them here as well.
|
||||
let existing = this._byname[engine.prefName];
|
||||
if (existing) {
|
||||
existing.engines.push(engine.name);
|
||||
continue;
|
||||
}
|
||||
|
||||
let obj = {name: engine.prefName,
|
||||
title: this._collectionTitle(engine),
|
||||
engines: [engine.name],
|
||||
enabled: true,
|
||||
sizeLabel: retrievingLabel};
|
||||
this._collections.push(obj);
|
||||
this._byname[engine.prefName] = obj;
|
||||
}
|
||||
},
|
||||
|
||||
_collectionTitle: function _collectionTitle(engine) {
|
||||
try {
|
||||
return gSyncQuota.bundle.getString(
|
||||
"collection." + engine.prefName + ".label");
|
||||
} catch (ex) {
|
||||
return engine.Name;
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Process the quota information as returned by info/collection_usage.
|
||||
*/
|
||||
displayUsageData: function displayUsageData(data) {
|
||||
for each (let coll in this._collections) {
|
||||
coll.size = 0;
|
||||
// If we couldn't retrieve any data, just blank out the label.
|
||||
if (!data) {
|
||||
coll.sizeLabel = "";
|
||||
continue;
|
||||
}
|
||||
|
||||
for each (let engineName in coll.engines)
|
||||
coll.size += data[engineName] || 0;
|
||||
let sizeLabel = "";
|
||||
sizeLabel = gSyncQuota.bundle.getFormattedString(
|
||||
"quota.sizeValueUnit.label", gSyncQuota.convertKB(coll.size));
|
||||
coll.sizeLabel = sizeLabel;
|
||||
}
|
||||
let sizeColumn = this.treeBox.columns.getNamedColumn("size");
|
||||
this.treeBox.invalidateColumn(sizeColumn);
|
||||
},
|
||||
|
||||
/*
|
||||
* Handle click events on the tree.
|
||||
*/
|
||||
onTreeClick: function onTreeClick(event) {
|
||||
if (event.button == 2)
|
||||
return;
|
||||
|
||||
let cell = this.treeBox.getCellAt(event.clientX, event.clientY);
|
||||
if (cell.col && cell.col.id == "enabled")
|
||||
this.toggle(cell.row);
|
||||
},
|
||||
|
||||
/*
|
||||
* Toggle enabled state of an engine.
|
||||
*/
|
||||
toggle: function toggle(row) {
|
||||
// Update the tree
|
||||
let collection = this._collections[row];
|
||||
collection.enabled = !collection.enabled;
|
||||
this.treeBox.invalidateRow(row);
|
||||
|
||||
// Display which ones will be removed
|
||||
let freeup = 0;
|
||||
let toremove = [];
|
||||
for each (collection in this._collections) {
|
||||
if (collection.enabled)
|
||||
continue;
|
||||
toremove.push(collection.name);
|
||||
freeup += collection.size;
|
||||
}
|
||||
|
||||
let caption = document.getElementById("treeCaption");
|
||||
if (!toremove.length) {
|
||||
caption.className = "";
|
||||
caption.firstChild.nodeValue = gSyncQuota.bundle.getString(
|
||||
"quota.treeCaption.label");
|
||||
return;
|
||||
}
|
||||
|
||||
toremove = [this._byname[coll].title for each (coll in toremove)];
|
||||
toremove = toremove.join(gSyncQuota.bundle.getString("quota.list.separator"));
|
||||
caption.firstChild.nodeValue = gSyncQuota.bundle.getFormattedString(
|
||||
"quota.removal.label", [toremove]);
|
||||
if (freeup)
|
||||
caption.firstChild.nodeValue += gSyncQuota.bundle.getFormattedString(
|
||||
"quota.freeup.label", gSyncQuota.convertKB(freeup));
|
||||
caption.className = "captionWarning";
|
||||
},
|
||||
|
||||
/*
|
||||
* Return a list of engines (or rather their pref names) that should be
|
||||
* disabled.
|
||||
*/
|
||||
getEnginesToDisable: function getEnginesToDisable() {
|
||||
return [coll.name for each (coll in this._collections) if (!coll.enabled)];
|
||||
},
|
||||
|
||||
// nsITreeView
|
||||
|
||||
get rowCount() {
|
||||
return this._collections.length;
|
||||
},
|
||||
|
||||
getRowProperties: function(index) { return ""; },
|
||||
getCellProperties: function(row, col) { return ""; },
|
||||
getColumnProperties: function(col) { return ""; },
|
||||
isContainer: function(index) { return false; },
|
||||
isContainerOpen: function(index) { return false; },
|
||||
isContainerEmpty: function(index) { return false; },
|
||||
isSeparator: function(index) { return false; },
|
||||
isSorted: function() { return false; },
|
||||
canDrop: function(index, orientation, dataTransfer) { return false; },
|
||||
drop: function(row, orientation, dataTransfer) {},
|
||||
getParentIndex: function(rowIndex) {},
|
||||
hasNextSibling: function(rowIndex, afterIndex) { return false; },
|
||||
getLevel: function(index) { return 0; },
|
||||
getImageSrc: function(row, col) {},
|
||||
|
||||
getCellValue: function(row, col) {
|
||||
return this._collections[row].enabled;
|
||||
},
|
||||
|
||||
getCellText: function getCellText(row, col) {
|
||||
let collection = this._collections[row];
|
||||
switch (col.id) {
|
||||
case "collection":
|
||||
return collection.title;
|
||||
case "size":
|
||||
return collection.sizeLabel;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
},
|
||||
|
||||
setTree: function setTree(tree) {
|
||||
this.treeBox = tree;
|
||||
},
|
||||
|
||||
toggleOpenState: function(index) {},
|
||||
cycleHeader: function(col) {},
|
||||
selectionChanged: function() {},
|
||||
cycleCell: function(row, col) {},
|
||||
isEditable: function(row, col) { return false; },
|
||||
isSelectable: function (row, col) { return false; },
|
||||
setCellValue: function(row, col, value) {},
|
||||
setCellText: function(row, col, value) {},
|
||||
performAction: function(action) {},
|
||||
performActionOnRow: function(action, row) {},
|
||||
performActionOnCell: function(action, row, col) {}
|
||||
|
||||
};
|
@ -1,65 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- 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/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/syncQuota.css"?>
|
||||
|
||||
<!DOCTYPE dialog [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
|
||||
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
|
||||
<!ENTITY % syncQuotaDTD SYSTEM "chrome://browser/locale/syncQuota.dtd">
|
||||
%brandDTD;
|
||||
%syncBrandDTD;
|
||||
%syncQuotaDTD;
|
||||
]>
|
||||
<dialog id="quotaDialog"
|
||||
windowtype="Sync:ViewQuota"
|
||||
persist="screenX screenY width height"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
onload="gSyncQuota.init()"
|
||||
buttons="accept,cancel"
|
||||
title=""a.dialogTitle.label;"
|
||||
ondialogcancel="return gSyncQuota.onCancel();"
|
||||
ondialogaccept="return gSyncQuota.onAccept();">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/sync/quota.js"/>
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="quotaStrings"
|
||||
src="chrome://browser/locale/syncQuota.properties"/>
|
||||
</stringbundleset>
|
||||
|
||||
<vbox flex="1">
|
||||
<label id="usageLabel"
|
||||
value=""a.retrievingInfo.label;"/>
|
||||
<separator/>
|
||||
<tree id="usageTree"
|
||||
seltype="single"
|
||||
hidecolumnpicker="true"
|
||||
onclick="gUsageTreeView.onTreeClick(event);"
|
||||
flex="1">
|
||||
<treecols>
|
||||
<treecol id="enabled"
|
||||
type="checkbox"
|
||||
fixed="true"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="collection"
|
||||
label=""a.typeColumn.label;"
|
||||
flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="size"
|
||||
label=""a.sizeColumn.label;"
|
||||
flex="1"/>
|
||||
</treecols>
|
||||
<treechildren flex="1"/>
|
||||
</tree>
|
||||
<separator/>
|
||||
<description id="treeCaption"> </description>
|
||||
</vbox>
|
||||
|
||||
</dialog>
|
@ -282,7 +282,7 @@ skip-if = os == "mac" || e10s # bug 967013; e10s: bug 1094761 - test hits the ne
|
||||
[browser_datareporting_notification.js]
|
||||
skip-if = !datareporting
|
||||
[browser_datachoices_notification.js]
|
||||
skip-if = !datareporting
|
||||
skip-if = !datareporting || e10s # bug 1113930
|
||||
[browser_devedition.js]
|
||||
[browser_devices_get_user_media.js]
|
||||
skip-if = buildapp == 'mulet' || (os == "linux" && debug) || e10s # linux: bug 976544; e10s: bug 1071623
|
||||
@ -509,3 +509,4 @@ support-files =
|
||||
support-files =
|
||||
readerModeArticle.html
|
||||
[browser_domFullscreen_fullscreenMode.js]
|
||||
[browser_menuButtonBadgeManager.js]
|
||||
|
@ -13,6 +13,9 @@ const HTTPS_BASE = "https://example.com/browser/browser/base/content/test/genera
|
||||
const TELEMETRY_LOG_PREF = "toolkit.telemetry.log.level";
|
||||
const telemetryOriginalLogPref = Preferences.get(TELEMETRY_LOG_PREF, null);
|
||||
|
||||
const originalReportUrl = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrl");
|
||||
const originalReportUrlUnified = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrlUnified");
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
// Ensure we don't pollute prefs for next tests.
|
||||
if (telemetryOriginalLogPref) {
|
||||
@ -22,7 +25,8 @@ registerCleanupFunction(function() {
|
||||
}
|
||||
|
||||
try {
|
||||
Services.prefs.clearUserPref("datareporting.healthreport.about.reportUrl");
|
||||
Services.prefs.setCharPref("datareporting.healthreport.about.reportUrl", originalReportUrl);
|
||||
Services.prefs.setCharPref("datareporting.healthreport.about.reportUrlUnified", originalReportUrlUnified);
|
||||
let policy = Cc["@mozilla.org/datareporting/service;1"]
|
||||
.getService(Ci.nsISupports)
|
||||
.wrappedJSObject
|
||||
@ -70,6 +74,8 @@ let gTests = [
|
||||
yield setupPingArchive();
|
||||
Preferences.set("datareporting.healthreport.about.reportUrl",
|
||||
HTTPS_BASE + "healthreport_testRemoteCommands.html");
|
||||
Preferences.set("datareporting.healthreport.about.reportUrlUnified",
|
||||
HTTPS_BASE + "healthreport_testRemoteCommands.html");
|
||||
}),
|
||||
run: function (iframe)
|
||||
{
|
||||
|
@ -0,0 +1,37 @@
|
||||
/* 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/. */
|
||||
|
||||
let menuButton = document.getElementById("PanelUI-menu-button");
|
||||
|
||||
add_task(function* testButtonActivities() {
|
||||
is(menuButton.hasAttribute("badge-status"), false, "Should not have a badge status");
|
||||
is(menuButton.hasAttribute("badge"), false, "Should not have the badge attribute set");
|
||||
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication");
|
||||
is(menuButton.getAttribute("badge-status"), "fxa-needs-authentication", "Should have fxa-needs-authentication badge status");
|
||||
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE, "update-succeeded");
|
||||
is(menuButton.getAttribute("badge-status"), "update-succeeded", "Should have update-succeeded badge status (update > fxa)");
|
||||
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE, "update-failed");
|
||||
is(menuButton.getAttribute("badge-status"), "update-failed", "Should have update-failed badge status");
|
||||
|
||||
gMenuButtonBadgeManager.addBadge("unknownbadge", "attr");
|
||||
is(menuButton.getAttribute("badge-status"), "update-failed", "Should not have changed badge status");
|
||||
|
||||
gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE);
|
||||
is(menuButton.getAttribute("badge-status"), "fxa-needs-authentication", "Should have fxa-needs-authentication badge status");
|
||||
|
||||
gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_FXA);
|
||||
is(menuButton.hasAttribute("badge-status"), false, "Should not have a badge status");
|
||||
|
||||
yield PanelUI.show();
|
||||
is(menuButton.hasAttribute("badge-status"), false, "Should not have a badge status (Hamburger menu opened)");
|
||||
PanelUI.hide();
|
||||
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication");
|
||||
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_UPDATE, "update-succeeded");
|
||||
gMenuButtonBadgeManager.clearBadges();
|
||||
is(menuButton.hasAttribute("badge-status"), false, "Should not have a badge status (clearBadges called)");
|
||||
});
|
@ -12,6 +12,18 @@ let stringBundle = Cc["@mozilla.org/intl/stringbundle;1"]
|
||||
// ensure test output sees log messages.
|
||||
Log.repository.getLogger("browserwindow.syncui").addAppender(new Log.DumpAppender());
|
||||
|
||||
// Sync manages 3 broadcasters so the menus correctly reflect the Sync state.
|
||||
// Only one of these 3 should ever be visible - pass the ID of the broadcaster
|
||||
// you expect to be visible and it will check it's the only one that is.
|
||||
function checkBroadcasterVisible(broadcasterId) {
|
||||
let all = ["sync-reauth-state", "sync-setup-state", "sync-syncnow-state"];
|
||||
Assert.ok(all.indexOf(broadcasterId) >= 0, "valid id");
|
||||
for (let check of all) {
|
||||
let eltHidden = document.getElementById(check).hidden;
|
||||
Assert.equal(eltHidden, check == broadcasterId ? false : true, check);
|
||||
}
|
||||
}
|
||||
|
||||
function promiseObserver(topic) {
|
||||
return new Promise(resolve => {
|
||||
let obs = (subject, topic, data) => {
|
||||
@ -27,105 +39,39 @@ add_task(function* prepare() {
|
||||
.getService(Components.interfaces.nsISupports)
|
||||
.wrappedJSObject;
|
||||
yield xps.whenLoaded();
|
||||
checkBroadcasterVisible("sync-setup-state");
|
||||
// mock out the "_needsSetup()" function so we don't short-circuit.
|
||||
let oldNeedsSetup = window.gSyncUI._needsSetup;
|
||||
window.gSyncUI._needsSetup = () => false;
|
||||
registerCleanupFunction(() => {
|
||||
window.gSyncUI._needsSetup = oldNeedsSetup;
|
||||
});
|
||||
});
|
||||
|
||||
add_task(function* testProlongedSyncError() {
|
||||
let promiseNotificationAdded = promiseObserver("weave:notification:added");
|
||||
Assert.equal(Notifications.notifications.length, 0, "start with no notifications");
|
||||
|
||||
// Pretend we are in the "prolonged error" state.
|
||||
Weave.Status.sync = Weave.PROLONGED_SYNC_FAILURE;
|
||||
Weave.Status.login = Weave.LOGIN_SUCCEEDED;
|
||||
Services.obs.notifyObservers(null, "weave:ui:sync:error", null);
|
||||
|
||||
let subject = yield promiseNotificationAdded;
|
||||
let notification = subject.wrappedJSObject.object; // sync's observer abstraction is abstract!
|
||||
Assert.equal(notification.title, stringBundle.GetStringFromName("error.sync.title"));
|
||||
Assert.equal(Notifications.notifications.length, 1, "exactly 1 notification");
|
||||
|
||||
// Now pretend we just had a successful sync - the error notification should go away.
|
||||
let promiseNotificationRemoved = promiseObserver("weave:notification:removed");
|
||||
Weave.Status.sync = Weave.STATUS_OK;
|
||||
Services.obs.notifyObservers(null, "weave:ui:sync:finish", null);
|
||||
yield promiseNotificationRemoved;
|
||||
Assert.equal(Notifications.notifications.length, 0, "no notifications left");
|
||||
// and a notification to have the state change away from "needs setup"
|
||||
Services.obs.notifyObservers(null, "weave:ui:clear-error", null);
|
||||
checkBroadcasterVisible("sync-syncnow-state");
|
||||
});
|
||||
|
||||
add_task(function* testSyncLoginError() {
|
||||
let promiseNotificationAdded = promiseObserver("weave:notification:added");
|
||||
Assert.equal(Notifications.notifications.length, 0, "start with no notifications");
|
||||
checkBroadcasterVisible("sync-syncnow-state");
|
||||
|
||||
// Pretend we are in the "prolonged error" state.
|
||||
// Pretend we are in a "login failed" error state
|
||||
Weave.Status.sync = Weave.LOGIN_FAILED;
|
||||
Weave.Status.login = Weave.LOGIN_FAILED_LOGIN_REJECTED;
|
||||
Services.obs.notifyObservers(null, "weave:ui:sync:error", null);
|
||||
|
||||
let subject = yield promiseNotificationAdded;
|
||||
let notification = subject.wrappedJSObject.object; // sync's observer abstraction is abstract!
|
||||
Assert.equal(notification.title, stringBundle.GetStringFromName("error.login.title"));
|
||||
Assert.equal(Notifications.notifications.length, 1, "exactly 1 notification");
|
||||
Assert.equal(Notifications.notifications.length, 0, "no notifications shown on login error");
|
||||
// But the menu *should* reflect the login error.
|
||||
checkBroadcasterVisible("sync-reauth-state");
|
||||
|
||||
// Now pretend we just had a successful login - the error notification should go away.
|
||||
Weave.Status.sync = Weave.STATUS_OK;
|
||||
Weave.Status.login = Weave.LOGIN_SUCCEEDED;
|
||||
let promiseNotificationRemoved = promiseObserver("weave:notification:removed");
|
||||
Services.obs.notifyObservers(null, "weave:service:login:start", null);
|
||||
Services.obs.notifyObservers(null, "weave:service:login:finish", null);
|
||||
yield promiseNotificationRemoved;
|
||||
Assert.equal(Notifications.notifications.length, 0, "no notifications left");
|
||||
});
|
||||
|
||||
add_task(function* testSyncLoginNetworkError() {
|
||||
Assert.equal(Notifications.notifications.length, 0, "start with no notifications");
|
||||
|
||||
// This test relies on the fact that observers are synchronous, and that error
|
||||
// notifications synchronously create the error notification, which itself
|
||||
// fires an observer notification.
|
||||
// ie, we should see the error notification *during* the notifyObservers call.
|
||||
|
||||
// To prove that, we cause a notification that *does* show an error and make
|
||||
// sure we see the error notification during that call. We then cause a
|
||||
// notification that *should not* show an error, and the lack of the
|
||||
// notification during the call implies the error was ignored.
|
||||
|
||||
// IOW, if this first part of the test fails in the future, it means the
|
||||
// above is no longer true and we need a different strategy to check for
|
||||
// ignored errors.
|
||||
|
||||
let sawNotificationAdded = false;
|
||||
let obs = (subject, topic, data) => {
|
||||
sawNotificationAdded = true;
|
||||
}
|
||||
Services.obs.addObserver(obs, "weave:notification:added", false);
|
||||
try {
|
||||
// notify of a display-able error - we should synchronously see our flag set.
|
||||
Weave.Status.sync = Weave.LOGIN_FAILED;
|
||||
Weave.Status.login = Weave.LOGIN_FAILED_LOGIN_REJECTED;
|
||||
Services.obs.notifyObservers(null, "weave:ui:login:error", null);
|
||||
Assert.ok(sawNotificationAdded);
|
||||
|
||||
// reset the flag and test what should *not* show an error.
|
||||
sawNotificationAdded = false;
|
||||
Weave.Status.sync = Weave.LOGIN_FAILED;
|
||||
Weave.Status.login = Weave.LOGIN_FAILED_NETWORK_ERROR;
|
||||
Services.obs.notifyObservers(null, "weave:ui:login:error", null);
|
||||
Assert.ok(!sawNotificationAdded);
|
||||
|
||||
// ditto for LOGIN_FAILED_SERVER_ERROR
|
||||
Weave.Status.sync = Weave.LOGIN_FAILED;
|
||||
Weave.Status.login = Weave.LOGIN_FAILED_SERVER_ERROR;
|
||||
Services.obs.notifyObservers(null, "weave:ui:login:error", null);
|
||||
Assert.ok(!sawNotificationAdded);
|
||||
// we are done.
|
||||
} finally {
|
||||
Services.obs.removeObserver(obs, "weave:notification:added");
|
||||
}
|
||||
// The menus should be back to "all good"
|
||||
checkBroadcasterVisible("sync-syncnow-state");
|
||||
});
|
||||
|
||||
function checkButtonsStatus(shouldBeActive) {
|
||||
|
@ -4,6 +4,12 @@
|
||||
"use strict";
|
||||
|
||||
add_task(function*() {
|
||||
let button = document.getElementById("urlbar-search-settings");
|
||||
if (!button) {
|
||||
ok("Skipping test");
|
||||
return;
|
||||
}
|
||||
|
||||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* () {
|
||||
let popupopened = BrowserTestUtils.waitForEvent(gURLBar.popup, "popupshown");
|
||||
|
||||
@ -14,7 +20,7 @@ add_task(function*() {
|
||||
// Since the current tab is blank the preferences pane will load there
|
||||
let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
let popupclosed = BrowserTestUtils.waitForEvent(gURLBar.popup, "popuphidden");
|
||||
EventUtils.synthesizeMouseAtCenter(document.getElementById("urlbar-search-settings"), {});
|
||||
EventUtils.synthesizeMouseAtCenter(button, {});
|
||||
yield loaded;
|
||||
yield popupclosed;
|
||||
|
||||
|
@ -130,8 +130,6 @@ browser.jar:
|
||||
content/browser/sync/genericChange.js (content/sync/genericChange.js)
|
||||
content/browser/sync/key.xhtml (content/sync/key.xhtml)
|
||||
content/browser/sync/notification.xml (content/sync/notification.xml)
|
||||
content/browser/sync/quota.xul (content/sync/quota.xul)
|
||||
content/browser/sync/quota.js (content/sync/quota.js)
|
||||
content/browser/sync/utils.js (content/sync/utils.js)
|
||||
* content/browser/sync/customize.xul (content/sync/customize.xul)
|
||||
content/browser/sync/customize.js (content/sync/customize.js)
|
||||
|
@ -27,6 +27,8 @@ BROWSER_CHROME_MANIFESTS += [
|
||||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
|
||||
|
||||
DEFINES['NIGHTLY_BUILD'] = CONFIG['NIGHTLY_BUILD']
|
||||
|
||||
DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
|
||||
|
@ -71,58 +71,120 @@ body {
|
||||
}
|
||||
|
||||
.tab-view {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
color: #000;
|
||||
border-top-right-radius: 2px;
|
||||
border-top-left-radius: 2px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 4rem;
|
||||
line-height: 3.7rem;
|
||||
color: #4A4A4A;
|
||||
list-style: none;
|
||||
border-bottom: 2px solid #ccc;
|
||||
}
|
||||
|
||||
.tab-view > li {
|
||||
flex: 1;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
line-height: 1.2rem;
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
-moz-border-end: 1px solid #ccc;
|
||||
padding: 0 10px;
|
||||
height: 16px;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.tab-view > li:last-child {
|
||||
-moz-border-end-style: none;
|
||||
.tab-view > .slide-bar {
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
left: 0;
|
||||
height: .2em;
|
||||
width: 50%;
|
||||
background: #00A9DC;
|
||||
border: none;
|
||||
transition: margin .3s ease-in-out;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="call"],
|
||||
.tab-view > li[data-tab-name="rooms"] {
|
||||
background-image: url("../shared/img/icons-16x16.svg#precall");
|
||||
.tab-view li:nth-child(1).selected ~ .slide-bar {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="call"]:hover,
|
||||
.tab-view > li[data-tab-name="rooms"]:hover {
|
||||
background-image: url("../shared/img/icons-16x16.svg#precall-hover");
|
||||
.tab-view li:nth-child(2).selected ~ .slide-bar {
|
||||
margin-left: 50%;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="call"].selected,
|
||||
.tab-view > li[data-tab-name="rooms"].selected {
|
||||
background-image: url("../shared/img/icons-16x16.svg#precall-active");
|
||||
html[dir="rtl"] .tab-view li:nth-child(1).selected ~ .slide-bar {
|
||||
margin-left: 50%;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="contacts"] {
|
||||
background-image: url("../shared/img/icons-16x16.svg#contacts");
|
||||
html[dir="rtl"] .tab-view li:nth-child(2).selected ~ .slide-bar {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="contacts"]:hover {
|
||||
background-image: url("../shared/img/icons-16x16.svg#contacts-hover");
|
||||
.tab-view > li > div {
|
||||
font-size: 1.2rem;
|
||||
pointer-events: none;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="contacts"].selected {
|
||||
background-image: url("../shared/img/icons-16x16.svg#contacts-active");
|
||||
.tab-view > li:before {
|
||||
content: "";
|
||||
pointer-events: none;
|
||||
display: inline-block;
|
||||
-moz-margin-end: .5rem;
|
||||
vertical-align: middle;
|
||||
height: 1.4rem;
|
||||
width: 1.4rem;
|
||||
transition-property: background-image;
|
||||
}
|
||||
|
||||
.tab-view > li.selected {
|
||||
transition-delay: .3s;
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="rooms"]:before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#hello");
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="rooms"]:hover:before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#hello-hover");
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="rooms"].selected:before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#hello-active");
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="contacts"]:before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#contacts");
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="contacts"]:hover:before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#contacts-hover");
|
||||
}
|
||||
|
||||
.tab-view > li[data-tab-name="contacts"].selected:before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#contacts-active");
|
||||
}
|
||||
|
||||
/* Styling for one tab */
|
||||
.tab-view li:first-child:nth-last-child(2) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tab-view li:first-child:nth-last-child(2) > span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-view li:first-child:nth-last-child(2) > span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-view li:first-child:nth-last-child(2):before {
|
||||
background-image: url("../shared/img/icons-14x14.svg#hello-hover");
|
||||
}
|
||||
|
||||
.tab-view li:first-child:nth-last-child(2) ~ div {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-view li:first-child:nth-last-child(3),
|
||||
.tab-view li:first-child:nth-last-child(3) ~ li {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tab {
|
||||
|
@ -81,12 +81,14 @@ loop.panel = (function(_, mozL10n) {
|
||||
}
|
||||
var isSelected = (this.state.selectedTab == tabName);
|
||||
if (!tab.props.hidden) {
|
||||
var label = mozL10n.get(tabName + "_tab_button");
|
||||
tabButtons.push(
|
||||
React.createElement("li", {className: cx({selected: isSelected}),
|
||||
"data-tab-name": tabName,
|
||||
key: i,
|
||||
onClick: this.handleSelectTab,
|
||||
title: mozL10n.get(tabName + "_tab_button_tooltip")})
|
||||
onClick: this.handleSelectTab},
|
||||
React.createElement("div", null, label)
|
||||
)
|
||||
);
|
||||
}
|
||||
tabs.push(
|
||||
@ -97,7 +99,10 @@ loop.panel = (function(_, mozL10n) {
|
||||
}, this);
|
||||
return (
|
||||
React.createElement("div", {className: "tab-view-container"},
|
||||
React.createElement("ul", {className: "tab-view"}, tabButtons),
|
||||
React.createElement("ul", {className: "tab-view"},
|
||||
tabButtons,
|
||||
React.createElement("div", {className: "slide-bar"})
|
||||
),
|
||||
tabs
|
||||
)
|
||||
);
|
||||
|
@ -81,12 +81,14 @@ loop.panel = (function(_, mozL10n) {
|
||||
}
|
||||
var isSelected = (this.state.selectedTab == tabName);
|
||||
if (!tab.props.hidden) {
|
||||
var label = mozL10n.get(tabName + "_tab_button");
|
||||
tabButtons.push(
|
||||
<li className={cx({selected: isSelected})}
|
||||
data-tab-name={tabName}
|
||||
key={i}
|
||||
onClick={this.handleSelectTab}
|
||||
title={mozL10n.get(tabName + "_tab_button_tooltip")} />
|
||||
onClick={this.handleSelectTab}>
|
||||
<div>{label}</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
tabs.push(
|
||||
@ -97,7 +99,10 @@ loop.panel = (function(_, mozL10n) {
|
||||
}, this);
|
||||
return (
|
||||
<div className="tab-view-container">
|
||||
<ul className="tab-view">{tabButtons}</ul>
|
||||
<ul className="tab-view">
|
||||
{tabButtons}
|
||||
<div className="slide-bar" />
|
||||
</ul>
|
||||
{tabs}
|
||||
</div>
|
||||
);
|
||||
|
@ -1468,7 +1468,7 @@ html[dir="rtl"] .room-context-btn-close {
|
||||
flex-direction: row;
|
||||
margin-right: .2em;
|
||||
margin-bottom: .5em;
|
||||
text-align: end;
|
||||
text-align: start;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-content: stretch;
|
||||
|
@ -40,16 +40,24 @@
|
||||
<path fill-rule="evenodd" d="M3.513,4.404H1.896c-0.417,0-0.756,0.338-0.756,0.755v3.679 c0,0.417,0.338,0.755,0.756,0.755H3.51l2.575,2.575c0.261,0.261,0.596,0.4,0.938,0.422V1.409C6.682,1.431,6.346,1.57,6.085,1.831 L3.513,4.404z M8.555,5.995C8.619,6.32,8.653,6.656,8.653,7c0,0.344-0.034,0.679-0.098,1.004l0.218,0.142 C8.852,7.777,8.895,7.393,8.895,7c0-0.394-0.043-0.777-0.123-1.147L8.555,5.995z M12.224,3.6l-0.475,0.31 c0.359,0.962,0.557,2.003,0.557,3.09c0,1.087-0.198,2.128-0.557,3.09l0.475,0.31c0.41-1.054,0.635-2.201,0.635-3.4 C12.859,5.8,12.634,4.654,12.224,3.6z M10.061,5.012C10.25,5.642,10.353,6.308,10.353,7c0,0.691-0.103,1.358-0.293,1.987 l0.351,0.229C10.634,8.517,10.756,7.772,10.756,7c0-0.773-0.121-1.517-0.345-2.216L10.061,5.012z"/>
|
||||
<path d="M7.164,12.74l-0.15-0.009c-0.389-0.024-0.754-0.189-1.028-0.463L3.452,9.735H1.896 C1.402,9.735,1,9.333,1,8.838V5.16c0-0.494,0.402-0.896,0.896-0.896h1.558l2.531-2.531C6.26,1.458,6.625,1.293,7.014,1.269 l0.15-0.009V12.74z M1.896,4.545c-0.339,0-0.615,0.276-0.615,0.615v3.679c0,0.339,0.276,0.615,0.615,0.615h1.672l2.616,2.616 c0.19,0.19,0.434,0.316,0.697,0.363V1.568C6.619,1.615,6.375,1.741,6.185,1.931L3.571,4.545H1.896z M12.292,10.612l-0.714-0.467 l0.039-0.105C11.981,9.067,12.165,8.044,12.165,7c0-1.044-0.184-2.067-0.548-3.041l-0.039-0.105l0.714-0.467l0.063,0.162 C12.783,4.649,13,5.81,13,7s-0.217,2.351-0.645,3.451L12.292,10.612z M11.92,10.033l0.234,0.153 c0.374-1.019,0.564-2.09,0.564-3.186s-0.19-2.167-0.564-3.186L11.92,3.966C12.27,4.94,12.447,5.96,12.447,7 C12.447,8.04,12.27,9.059,11.92,10.033z M10.489,9.435L9.895,9.047l0.031-0.101C10.116,8.315,10.212,7.66,10.212,7 c0-0.661-0.096-1.316-0.287-1.947L9.895,4.952l0.594-0.388l0.056,0.176C10.779,5.471,10.897,6.231,10.897,7 c0,0.769-0.118,1.529-0.351,2.259L10.489,9.435z M10.225,8.926l0.106,0.069C10.52,8.348,10.615,7.677,10.615,7 c0-0.677-0.095-1.348-0.284-1.996l-0.106,0.07C10.403,5.699,10.494,6.347,10.494,7C10.494,7.652,10.403,8.3,10.225,8.926z M8.867,8.376L8.398,8.07l0.018-0.093C8.48,7.654,8.512,7.325,8.512,7S8.48,6.345,8.417,6.022L8.398,5.929l0.469-0.306l0.043,0.2 C8.994,6.211,9.036,6.607,9.036,7c0,0.393-0.042,0.789-0.126,1.176L8.867,8.376z"/>
|
||||
</g>
|
||||
<path id="contacts-shape" fill-rule="evenodd" transform="translate(-79.000000, -59.000000)" d="M91.5000066,69.9765672 C91.5000066,68.2109401 91.0859436,65.4999994 88.7968783,65.4999994 C88.5546906,65.4999994 87.5312518,66.5859382 86,66.5859382 C84.4687482,66.5859382 83.4453095,65.4999994 83.2031217,65.4999994 C80.9140564,65.4999994 80.4999935,68.2109401 80.4999935,69.9765672 C80.4999935,71.2421938 81.3437445,72.0000072 82.5859334,72.0000072 L89.4140666,72.0000072 C90.6562555,72.0000072 91.5000066,71.2421938 91.5000066,69.9765672 L91.5000066,69.9765672 L91.5000066,69.9765672 Z M89.0000036,62.9999964 C89.0000036,61.3437444 87.656252,59.9999928 86,59.9999928 C84.343748,59.9999928 82.9999964,61.3437444 82.9999964,62.9999964 C82.9999964,64.6562484 84.343748,66 86,66 C87.656252,66 89.0000036,64.6562484 89.0000036,62.9999964 L89.0000036,62.9999964 L89.0000036,62.9999964 Z" />
|
||||
<path id="hello-shape" fill-rule="evenodd" transform="translate(-261.000000, -59.000000)" d="M268.273778,60 C264.809073,60 262,62.4730749 262,65.523237 C262,67.0417726 262.697086,68.4174001 263.822897,69.4155754 C263.627626,70.1061164 263.240356,71.0442922 262.474542,71.959559 C262.605451,72.1919211 264.761073,71.3737446 266.2807,70.7617485 C266.907968,70.946111 267.577782,71.046474 268.274868,71.046474 C271.740664,71.046474 274.549737,68.5733991 274.549737,65.523237 C274.549737,62.4730749 271.739573,60 268.274868,60 L268.273778,60 Z M270.15122,63.3119786 C270.609399,63.3119786 270.980306,63.6850671 270.980306,64.1432459 C270.980306,64.6036066 270.609399,64.9756042 270.15122,64.9756042 C269.693041,64.9756042 269.321044,64.6036066 269.321044,64.1432459 C269.321044,63.6850671 269.693041,63.3119786 270.15122,63.3119786 L270.15122,63.3119786 Z M266.36579,63.3119786 C266.823969,63.3119786 267.195966,63.6850671 267.195966,64.1432459 C267.195966,64.6036066 266.823969,64.9756042 266.36579,64.9756042 C265.907611,64.9756042 265.535613,64.6036066 265.535613,64.1432459 C265.535613,63.6850671 265.907611,63.3119786 266.36579,63.3119786 L266.36579,63.3119786 Z M268.283596,69.3675757 L268.258505,69.3664848 L268.233414,69.3675757 C266.557789,69.3675757 264.685801,68.2777646 264.254894,66.4428674 C265.38616,66.9675913 266.967968,67.1966807 268.258505,67.1966807 C269.549042,67.1966807 271.13085,66.9675913 272.262115,66.4428674 C271.8323,68.2777646 269.959221,69.3675757 268.283596,69.3675757 L268.283596,69.3675757 Z" />
|
||||
</defs>
|
||||
<use id="audio" xlink:href="#audio-shape"/>
|
||||
<use id="audio-active" xlink:href="#audio-shape"/>
|
||||
<use id="audio-disabled" xlink:href="#audio-shape"/>
|
||||
<use id="contacts" xlink:href="#contacts-shape"/>
|
||||
<use id="contacts-hover" xlink:href="#contacts-shape"/>
|
||||
<use id="contacts-active" xlink:href="#contacts-shape"/>
|
||||
<use id="facemute" xlink:href="#facemute-shape"/>
|
||||
<use id="facemute-active" xlink:href="#facemute-shape"/>
|
||||
<use id="facemute-disabled" xlink:href="#facemute-shape"/>
|
||||
<use id="hangup" xlink:href="#hangup-shape"/>
|
||||
<use id="hangup-active" xlink:href="#hangup-shape"/>
|
||||
<use id="hangup-disabled" xlink:href="#hangup-shape"/>
|
||||
<use id="hello" xlink:href="#hello-shape"/>
|
||||
<use id="hello-hover" xlink:href="#hello-shape"/>
|
||||
<use id="hello-active" xlink:href="#hello-shape"/>
|
||||
<use id="incoming" xlink:href="#incoming-shape"/>
|
||||
<use id="incoming-active" xlink:href="#incoming-shape"/>
|
||||
<use id="incoming-disabled" xlink:href="#incoming-shape"/>
|
||||
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 11 KiB |
@ -40,7 +40,6 @@
|
||||
<path fill-rule="evenodd" d="M8,0C3.582,0,0,3.582,0,8s3.582,8,8,8c4.418,0,8-3.582,8-8 S12.418,0,8,0z M10.544,4.471c0.17,0.453,0.194,0.954,0.021,1.416c-0.163,0.436-0.495,0.811-0.982,1.096 C9.307,7.146,9.167,7.351,9.151,7.548c-0.045,0.575,0.658,0.993,1.064,1.297c0.889,0.666,1.236,1.758,0.648,2.813 c-0.562,1.007-1.901,1.457-3.322,1.462c-1.766-0.008-2.88-0.817-2.938-1.918C4.527,9.779,5.987,9.101,7.307,8.947 c0.369-0.043,0.7-0.036,1.01-0.014C7.85,8.625,7.675,7.998,7.914,7.58c0.062-0.109,0.023-0.072-0.095-0.054 C6.739,7.689,5.628,6.985,5.367,5.92c-0.132-0.54-0.05-1.105,0.156-1.547C5.97,3.413,6.964,2.88,8.067,2.88 c1.147,0,2.209,0,3.334,0.009L10.612,3.4H9.714C10.093,3.665,10.384,4.046,10.544,4.471z"/>
|
||||
</g>
|
||||
<path id="history-shape" fill-rule="evenodd" d="M8,16c-4.418,0-8-3.582-8-8c0-4.418,3.582-8,8-8 c4.418,0,8,3.582,8,8C16,12.418,12.418,16,8,16z M8,2.442C4.911,2.442,2.408,4.931,2.408,8c0,3.069,2.504,5.557,5.592,5.557 S13.592,11.069,13.592,8C13.592,4.931,11.089,2.442,8,2.442z M7.649,9.048C7.206,8.899,6.882,8.493,6.882,8V4.645 c0-0.618,0.501-1.119,1.118-1.119c0.618,0,1.119,0.501,1.119,1.119v3.078c1.176,1.22,2.237,3.633,2.237,3.633 S8.844,10.252,7.649,9.048z"/>
|
||||
<path id="precall-shape" fill-rule="evenodd" d="M8.014,0.003c-4.411,0-7.987,3.576-7.987,7.986 c0,1.642,0.496,3.168,1.346,4.437L0,15.997l3.568-1.372c1.271,0.853,2.8,1.352,4.446,1.352c4.411,0,7.986-3.576,7.986-7.987 C16,3.579,12.424,0.003,8.014,0.003z"/>
|
||||
<path id="settings-shape" fill-rule="evenodd" d="M14.77,8c0,0.804,0.262,1.548,0.634,1.678L16,9.887 c-0.205,0.874-0.553,1.692-1.011,2.434l-0.567-0.272c-0.355-0.171-1.066,0.17-1.635,0.738c-0.569,0.569-0.909,1.279-0.738,1.635 l0.273,0.568c-0.741,0.46-1.566,0.79-2.438,0.998l-0.205-0.584c-0.13-0.372-0.874-0.634-1.678-0.634s-1.548,0.262-1.678,0.634 l-0.209,0.596c-0.874-0.205-1.692-0.553-2.434-1.011l0.272-0.567c0.171-0.355-0.17-1.066-0.739-1.635 c-0.568-0.568-1.279-0.909-1.635-0.738l-0.568,0.273c-0.46-0.741-0.79-1.566-0.998-2.439l0.584-0.205 C0.969,9.547,1.231,8.804,1.231,8c0-0.804-0.262-1.548-0.634-1.678L0,6.112c0.206-0.874,0.565-1.685,1.025-2.427l0.554,0.266 c0.355,0.171,1.066-0.17,1.635-0.738c0.569-0.568,0.909-1.28,0.739-1.635L3.686,1.025c0.742-0.46,1.553-0.818,2.427-1.024 l0.209,0.596C6.453,0.969,7.197,1.23,8.001,1.23s1.548-0.262,1.678-0.634l0.209-0.596c0.874,0.205,1.692,0.553,2.434,1.011 l-0.272,0.567c-0.171,0.355,0.17,1.066,0.738,1.635c0.569,0.568,1.279,0.909,1.635,0.738l0.568-0.273 c0.46,0.741,0.79,1.566,0.998,2.438l-0.584,0.205C15.032,6.452,14.77,7.196,14.77,8z M8.001,3.661C5.604,3.661,3.661,5.603,3.661,8 c0,2.397,1.943,4.34,4.339,4.34c2.397,0,4.339-1.943,4.339-4.34C12.34,5.603,10.397,3.661,8.001,3.661z"/>
|
||||
<g id="share-shape">
|
||||
<path fill-rule="evenodd" d="M8.999,10.654L8.69,10.6L8.999,16l2.56-3.754L8.999,10.654z M8.658,10.041l0.341-0.043l6,2.898V0L1,10.998l4.55-0.569L8.999,16l-1.892-5.68l-0.283-0.05l0.256-0.032L7,9.998l6.999-8.003 L8.656,9.998L8.658,10.041z"/>
|
||||
@ -113,9 +112,6 @@
|
||||
<use id="history-hover" xlink:href="#history-shape"/>
|
||||
<use id="history-active" xlink:href="#history-shape"/>
|
||||
<use id="leave" xlink:href="#leave-shape"/>
|
||||
<use id="precall" xlink:href="#precall-shape"/>
|
||||
<use id="precall-hover" xlink:href="#precall-shape"/>
|
||||
<use id="precall-active" xlink:href="#precall-shape"/>
|
||||
<use id="settings" xlink:href="#settings-shape"/>
|
||||
<use id="settings-hover" xlink:href="#settings-shape"/>
|
||||
<use id="settings-active" xlink:href="#settings-shape"/>
|
||||
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
@ -508,7 +508,8 @@
|
||||
],
|
||||
"14x14": ["audio", "audio-active", "audio-disabled", "facemute",
|
||||
"facemute-active", "facemute-disabled", "hangup", "hangup-active",
|
||||
"hangup-disabled", "incoming", "incoming-active", "incoming-disabled",
|
||||
"hangup-disabled", "hello", "hello-hover", "hello-active",
|
||||
"incoming", "incoming-active", "incoming-disabled",
|
||||
"link", "link-active", "link-disabled", "mute", "mute-active",
|
||||
"mute-disabled", "pause", "pause-active", "pause-disabled", "video",
|
||||
"video-white", "video-active", "video-disabled", "volume", "volume-active",
|
||||
@ -518,11 +519,10 @@
|
||||
"block", "block-red", "block-hover", "block-active", "contacts", "contacts-hover",
|
||||
"contacts-active", "copy", "checkmark", "delete", "globe", "google", "google-hover",
|
||||
"google-active", "history", "history-hover", "history-active", "leave",
|
||||
"precall", "precall-hover", "precall-active", "screen-white", "screenmute-white",
|
||||
"settings", "settings-hover", "settings-active", "share-darkgrey", "tag",
|
||||
"tag-hover", "tag-active", "trash", "unblock", "unblock-hover", "unblock-active",
|
||||
"video", "video-hover", "video-active", "tour", "status-available",
|
||||
"status-unavailable"
|
||||
"screen-white", "screenmute-white", "settings", "settings-hover", "settings-active",
|
||||
"share-darkgrey", "tag", "tag-hover", "tag-active", "trash", "unblock",
|
||||
"unblock-hover", "unblock-active", "video", "video-hover", "video-active", "tour",
|
||||
"status-available", "status-unavailable"
|
||||
]
|
||||
},
|
||||
|
||||
|
@ -508,7 +508,8 @@
|
||||
],
|
||||
"14x14": ["audio", "audio-active", "audio-disabled", "facemute",
|
||||
"facemute-active", "facemute-disabled", "hangup", "hangup-active",
|
||||
"hangup-disabled", "incoming", "incoming-active", "incoming-disabled",
|
||||
"hangup-disabled", "hello", "hello-hover", "hello-active",
|
||||
"incoming", "incoming-active", "incoming-disabled",
|
||||
"link", "link-active", "link-disabled", "mute", "mute-active",
|
||||
"mute-disabled", "pause", "pause-active", "pause-disabled", "video",
|
||||
"video-white", "video-active", "video-disabled", "volume", "volume-active",
|
||||
@ -518,11 +519,10 @@
|
||||
"block", "block-red", "block-hover", "block-active", "contacts", "contacts-hover",
|
||||
"contacts-active", "copy", "checkmark", "delete", "globe", "google", "google-hover",
|
||||
"google-active", "history", "history-hover", "history-active", "leave",
|
||||
"precall", "precall-hover", "precall-active", "screen-white", "screenmute-white",
|
||||
"settings", "settings-hover", "settings-active", "share-darkgrey", "tag",
|
||||
"tag-hover", "tag-active", "trash", "unblock", "unblock-hover", "unblock-active",
|
||||
"video", "video-hover", "video-active", "tour", "status-available",
|
||||
"status-unavailable"
|
||||
"screen-white", "screenmute-white", "settings", "settings-hover", "settings-active",
|
||||
"share-darkgrey", "tag", "tag-hover", "tag-active", "trash", "unblock",
|
||||
"unblock-hover", "unblock-active", "video", "video-hover", "video-active", "tour",
|
||||
"status-available", "status-unavailable"
|
||||
]
|
||||
},
|
||||
|
||||
|
@ -1,13 +1,23 @@
|
||||
component {6F8BB968-C14F-4D6F-9733-6C6737B35DCE} ProfileMigrator.js
|
||||
contract @mozilla.org/toolkit/profile-migrator;1 {6F8BB968-C14F-4D6F-9733-6C6737B35DCE}
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
component {4bf85aa5-4e21-46ca-825f-f9c51a5e8c76} ChromeProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=canary {4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}
|
||||
#endif
|
||||
component {4cec1de4-1671-4fc3-a53e-6c539dc77a26} ChromeProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=chrome {4cec1de4-1671-4fc3-a53e-6c539dc77a26}
|
||||
component {8cece922-9720-42de-b7db-7cef88cb07ca} ChromeProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=chromium {8cece922-9720-42de-b7db-7cef88cb07ca}
|
||||
|
||||
component {91185366-ba97-4438-acba-48deaca63386} FirefoxProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=firefox {91185366-ba97-4438-acba-48deaca63386}
|
||||
|
||||
#ifdef HAS_IE_MIGRATOR
|
||||
component {3d2532e3-4932-4774-b7ba-968f5899d3a4} IEProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=ie {3d2532e3-4932-4774-b7ba-968f5899d3a4}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SAFARI_MIGRATOR
|
||||
component {4b609ecf-60b2-4655-9df4-dc149e474da1} SafariProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=safari {4b609ecf-60b2-4655-9df4-dc149e474da1}
|
||||
|
@ -461,4 +461,51 @@ ChromeProfileMigrator.prototype.classDescription = "Chrome Profile Migrator";
|
||||
ChromeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome";
|
||||
ChromeProfileMigrator.prototype.classID = Components.ID("{4cec1de4-1671-4fc3-a53e-6c539dc77a26}");
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);
|
||||
|
||||
/**
|
||||
* Chromium migration
|
||||
**/
|
||||
function ChromiumProfileMigrator() {
|
||||
let chromiumUserDataFolder = FileUtils.getDir(
|
||||
#ifdef XP_WIN
|
||||
"LocalAppData", ["Chromium", "User Data"]
|
||||
#elifdef XP_MACOSX
|
||||
"ULibDir", ["Application Support", "Chromium"]
|
||||
#else
|
||||
"Home", [".config", "chromium"]
|
||||
#endif
|
||||
, false);
|
||||
this._chromeUserDataFolder = chromiumUserDataFolder.exists() ? chromiumUserDataFolder : null;
|
||||
}
|
||||
|
||||
ChromiumProfileMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
|
||||
ChromiumProfileMigrator.prototype.classDescription = "Chromium Profile Migrator";
|
||||
ChromiumProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chromium";
|
||||
ChromiumProfileMigrator.prototype.classID = Components.ID("{8cece922-9720-42de-b7db-7cef88cb07ca}");
|
||||
|
||||
let componentsArray = [ChromeProfileMigrator, ChromiumProfileMigrator];
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
/**
|
||||
* Chrome Canary
|
||||
* Not available on Linux
|
||||
**/
|
||||
function CanaryProfileMigrator() {
|
||||
let chromeUserDataFolder = FileUtils.getDir(
|
||||
#ifdef XP_WIN
|
||||
"LocalAppData", ["Google", "Chrome SxS", "User Data"]
|
||||
#elifdef XP_MACOSX
|
||||
"ULibDir", ["Application Support", "Google", "Chrome Canary"]
|
||||
#endif
|
||||
, false);
|
||||
this._chromeUserDataFolder = chromeUserDataFolder.exists() ? chromeUserDataFolder : null;
|
||||
}
|
||||
CanaryProfileMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
|
||||
CanaryProfileMigrator.prototype.classDescription = "Chrome Canary Profile Migrator";
|
||||
CanaryProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=canary";
|
||||
CanaryProfileMigrator.prototype.classID = Components.ID("{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}");
|
||||
|
||||
componentsArray.push(CanaryProfileMigrator);
|
||||
#endif
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(componentsArray);
|
||||
|
@ -6,10 +6,7 @@
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];
|
||||
|
||||
const Cu = Components.utils;
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
|
||||
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
||||
const TOPIC_WILL_IMPORT_BOOKMARKS = "initial-migration-will-import-default-bookmarks";
|
||||
const TOPIC_DID_IMPORT_BOOKMARKS = "initial-migration-did-import-default-bookmarks";
|
||||
|
||||
@ -37,17 +34,20 @@ function getMigrationBundle() {
|
||||
/**
|
||||
* Figure out what is the default browser, and if there is a migrator
|
||||
* for it, return that migrator's internal name.
|
||||
* For the time being, the "internal name" of a migraotr is its contract-id
|
||||
* For the time being, the "internal name" of a migrator is its contract-id
|
||||
* trailer (e.g. ie for @mozilla.org/profile/migrator;1?app=browser&type=ie),
|
||||
* but it will soon be exposed properly.
|
||||
*/
|
||||
function getMigratorKeyForDefaultBrowser() {
|
||||
// Canary uses the same description as Chrome so we can't distinguish them.
|
||||
const APP_DESC_TO_KEY = {
|
||||
"Internet Explorer": "ie",
|
||||
"Safari": "safari",
|
||||
"Firefox": "firefox",
|
||||
"Google Chrome": "chrome", // Windows, Linux
|
||||
"Chrome": "chrome", // OS X
|
||||
"Chromium": "chromium", // Windows, OS X
|
||||
"Chromium Web Browser": "chromium", // Linux
|
||||
"360\u5b89\u5168\u6d4f\u89c8\u5668": "360se",
|
||||
};
|
||||
|
||||
@ -399,13 +399,15 @@ this.MigrationUtils = Object.freeze({
|
||||
*
|
||||
* @param aKey
|
||||
* The key of the string to retrieve.
|
||||
* @param aReplacemts
|
||||
* @param aReplacements
|
||||
* [optioanl] Array of replacements to run on the retrieved string.
|
||||
* @return the retrieved string.
|
||||
*
|
||||
* @see nsIStringBundle
|
||||
*/
|
||||
getLocalizedString: function MU_getLocalizedString(aKey, aReplacements) {
|
||||
aKey = aKey.replace(/_(canary|chromium)$/, "_chrome");
|
||||
|
||||
const OVERRIDES = {
|
||||
"4_firefox": "4_firefox_history_and_bookmarks",
|
||||
"64_firefox": "64_firefox_other"
|
||||
@ -450,7 +452,9 @@ this.MigrationUtils = Object.freeze({
|
||||
* @param aKey internal name of the migration source.
|
||||
* Supported values: ie (windows),
|
||||
* safari (mac/windows),
|
||||
* canary (mac/windows),
|
||||
* chrome (mac/windows/linux),
|
||||
* chromium (mac/windows/linux),
|
||||
* 360se (windows),
|
||||
* firefox.
|
||||
*
|
||||
@ -484,11 +488,11 @@ this.MigrationUtils = Object.freeze({
|
||||
get migrators() {
|
||||
let migratorKeysOrdered = [
|
||||
#ifdef XP_WIN
|
||||
"firefox", "ie", "chrome", "safari", "360se"
|
||||
"firefox", "ie", "chrome", "chromium", "safari", "360se", "canary"
|
||||
#elifdef XP_MACOSX
|
||||
"firefox", "safari", "chrome"
|
||||
"firefox", "safari", "chrome", "chromium", "canary"
|
||||
#elifdef XP_UNIX
|
||||
"firefox", "chrome"
|
||||
"firefox", "chrome", "chromium"
|
||||
#endif
|
||||
];
|
||||
|
||||
|
@ -286,9 +286,15 @@ var MigrationWizard = {
|
||||
case "safari":
|
||||
source = "sourceNameSafari";
|
||||
break;
|
||||
case "canary":
|
||||
source = "sourceNameCanary";
|
||||
break;
|
||||
case "chrome":
|
||||
source = "sourceNameChrome";
|
||||
break;
|
||||
case "chromium":
|
||||
source = "sourceNameChromium";
|
||||
break;
|
||||
case "firefox":
|
||||
source = "sourceNameFirefox";
|
||||
break;
|
||||
|
@ -36,13 +36,18 @@
|
||||
#ifdef XP_WIN
|
||||
<radio id="ie" label="&importFromIE.label;" accesskey="&importFromIE.accesskey;"/>
|
||||
<radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
|
||||
<radio id="chromium" label="&importFromChromium.label;" accesskey="&importFromChromium.accesskey;"/>
|
||||
<radio id="safari" label="&importFromSafari.label;" accesskey="&importFromSafari.accesskey;"/>
|
||||
<radio id="canary" label="&importFromCanary.label;" accesskey="&importFromCanary.accesskey;"/>
|
||||
<radio id="360se" label="&importFrom360se.label;" accesskey="&importFrom360se.accesskey;"/>
|
||||
#elifdef XP_MACOSX
|
||||
<radio id="safari" label="&importFromSafari.label;" accesskey="&importFromSafari.accesskey;"/>
|
||||
<radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
|
||||
<radio id="chromium" label="&importFromChromium.label;" accesskey="&importFromChromium.accesskey;"/>
|
||||
<radio id="canary" label="&importFromCanary.label;" accesskey="&importFromCanary.accesskey;"/>
|
||||
#elifdef XP_UNIX
|
||||
<radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
|
||||
<radio id="chromium" label="&importFromChromium.label;" accesskey="&importFromChromium.accesskey;"/>
|
||||
#endif
|
||||
<radio id="nothing" label="&importFromNothing.label;" accesskey="&importFromNothing.accesskey;" hidden="true"/>
|
||||
</radiogroup>
|
||||
|
@ -117,7 +117,8 @@ var gPrivacyPane = {
|
||||
setEventListener("clearDataSettings", "command",
|
||||
gPrivacyPane.showClearPrivateDataSettings);
|
||||
|
||||
document.getElementById("searchesSuggestion").hidden = !AppConstants.NIGHTLY_BUILD;
|
||||
document.getElementById("searchesSuggestion").hidden =
|
||||
!Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
|
||||
},
|
||||
|
||||
// HISTORY MODE
|
||||
|
@ -193,7 +193,6 @@ let gSyncPane = {
|
||||
aEvent.stopPropagation();
|
||||
gSyncPane.openSetup('pair');
|
||||
});
|
||||
setEventListener("syncViewQuota", "command", gSyncPane.openQuotaDialog);
|
||||
setEventListener("syncChangePassword", "command",
|
||||
() => gSyncUtils.changePassword());
|
||||
setEventListener("syncResetPassphrase", "command",
|
||||
@ -714,15 +713,6 @@ let gSyncPane = {
|
||||
});
|
||||
},
|
||||
|
||||
openQuotaDialog: function () {
|
||||
let win = Services.wm.getMostRecentWindow("Sync:ViewQuota");
|
||||
if (win)
|
||||
win.focus();
|
||||
else
|
||||
window.openDialog("chrome://browser/content/sync/quota.xul", "",
|
||||
"centerscreen,chrome,dialog,modal");
|
||||
},
|
||||
|
||||
openAddDevice: function () {
|
||||
if (!Weave.Utils.ensureMPUnlocked())
|
||||
return;
|
||||
|
@ -97,8 +97,6 @@
|
||||
label="&manageAccount.label;"
|
||||
accesskey="&manageAccount.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem id="syncViewQuota" label="&viewQuota.label;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="syncChangePassword" label="&changePassword2.label;"/>
|
||||
<menuitem id="syncResetPassphrase" label="&myRecoveryKey.label;"/>
|
||||
<menuseparator/>
|
||||
|
@ -20,7 +20,7 @@ function test() {
|
||||
test_locbar_suggestion_retention("history", false),
|
||||
];
|
||||
|
||||
if (AppConstants.NIGHTLY_BUILD)
|
||||
if (Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete"))
|
||||
tests.push(test_locbar_suggestion_retention("searches", true));
|
||||
|
||||
run_test_subset(tests);
|
||||
|
@ -71,7 +71,8 @@ var gPrivacyPane = {
|
||||
#endif
|
||||
this._initAutocomplete();
|
||||
|
||||
document.getElementById("searchesSuggestion").hidden = !AppConstants.NIGHTLY_BUILD;
|
||||
document.getElementById("searchesSuggestion").hidden =
|
||||
!Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
|
||||
},
|
||||
|
||||
// HISTORY MODE
|
||||
|
@ -454,16 +454,6 @@ let gSyncPane = {
|
||||
});
|
||||
},
|
||||
|
||||
openQuotaDialog: function () {
|
||||
let win = Services.wm.getMostRecentWindow("Sync:ViewQuota");
|
||||
if (win) {
|
||||
win.focus();
|
||||
} else {
|
||||
window.openDialog("chrome://browser/content/sync/quota.xul", "",
|
||||
"centerscreen,chrome,dialog,modal");
|
||||
}
|
||||
},
|
||||
|
||||
openAddDevice: function () {
|
||||
if (!Weave.Utils.ensureMPUnlocked()) {
|
||||
return;
|
||||
|
@ -95,9 +95,6 @@
|
||||
label="&manageAccount.label;"
|
||||
accesskey="&manageAccount.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&viewQuota.label;"
|
||||
oncommand="gSyncPane.openQuotaDialog();"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&changePassword2.label;"
|
||||
oncommand="gSyncUtils.changePassword();"/>
|
||||
<menuitem label="&myRecoveryKey.label;"
|
||||
|
@ -20,7 +20,7 @@ function test() {
|
||||
test_locbar_suggestion_retention("history", false),
|
||||
];
|
||||
|
||||
if (AppConstants.NIGHTLY_BUILD)
|
||||
if (Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete"))
|
||||
tests.push(test_locbar_suggestion_retention("searches", true));
|
||||
|
||||
run_test_subset(tests);
|
||||
|
@ -17,6 +17,10 @@ let tests = [
|
||||
is_element_hidden(CONTROL_CENTER_PANEL, "Panel should initially be hidden");
|
||||
yield showMenuPromise(CONTROL_CENTER_MENU_NAME);
|
||||
is_element_visible(CONTROL_CENTER_PANEL, "Panel should be visible after showMenu");
|
||||
|
||||
yield gURLBar.focus();
|
||||
is_element_visible(CONTROL_CENTER_PANEL, "Panel should remain visible after focus outside");
|
||||
|
||||
yield showMenuPromise(CONTROL_CENTER_MENU_NAME);
|
||||
is_element_visible(CONTROL_CENTER_PANEL,
|
||||
"Panel should remain visible and callback called after a 2nd showMenu");
|
||||
|
@ -9,17 +9,15 @@
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
let { devtools: loader, require } = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/Console.jsm");
|
||||
Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
|
||||
|
||||
devtools.lazyRequireGetter(this, "promise");
|
||||
devtools.lazyRequireGetter(this, "EventEmitter",
|
||||
"devtools/toolkit/event-emitter");
|
||||
devtools.lazyRequireGetter(this, "AnimationsFront",
|
||||
"devtools/server/actors/animation", true);
|
||||
|
||||
const require = devtools.require;
|
||||
loader.lazyRequireGetter(this, "promise");
|
||||
loader.lazyRequireGetter(this, "EventEmitter",
|
||||
"devtools/toolkit/event-emitter");
|
||||
loader.lazyRequireGetter(this, "AnimationsFront",
|
||||
"devtools/server/actors/animation", true);
|
||||
|
||||
const STRINGS_URI = "chrome://browser/locale/devtools/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
|
@ -6,13 +6,12 @@
|
||||
|
||||
const Cu = Components.utils;
|
||||
const {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
const TargetFactory = devtools.TargetFactory;
|
||||
const {TargetFactory} = require("devtools/framework/target");
|
||||
const {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
|
||||
const {ViewHelpers} = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
|
||||
const DevToolsUtils = devtools.require("devtools/toolkit/DevToolsUtils");
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
|
||||
// All tests are asynchronous
|
||||
waitForExplicitFinish();
|
||||
|
@ -7,9 +7,7 @@
|
||||
"use strict";
|
||||
|
||||
const Cu = Components.utils;
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {findOptimalTimeInterval} = require("devtools/animationinspector/utils");
|
||||
|
||||
// This test array contains objects that are used to test the
|
||||
|
@ -6,9 +6,7 @@
|
||||
"use strict";
|
||||
|
||||
const Cu = Components.utils;
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {TimeScale} = require("devtools/animationinspector/components");
|
||||
|
||||
const TEST_ANIMATIONS = [{
|
||||
|
@ -9,8 +9,7 @@ Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
const {Simulator} = Cu.import("resource://gre/modules/devtools/Simulator.jsm")
|
||||
const {Devices} = Cu.import("resource://gre/modules/devtools/Devices.jsm");
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {ConnectionManager, Connection} = require("devtools/client/connection-manager");
|
||||
const {getDeviceFront} = require("devtools/server/actors/device");
|
||||
|
@ -7,8 +7,8 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
const {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {TargetFactory} = require("devtools/framework/target");
|
||||
|
||||
const {ConnectionManager, Connection}
|
||||
= require("devtools/client/connection-manager");
|
||||
@ -167,7 +167,7 @@ let UI = {
|
||||
client: this.connection.client,
|
||||
chrome: true
|
||||
};
|
||||
devtools.TargetFactory.forRemoteTab(options).then((target) => {
|
||||
TargetFactory.forRemoteTab(options).then((target) => {
|
||||
top.UI.openAndShowToolboxForTarget(target, "Main process", null);
|
||||
});
|
||||
},
|
||||
@ -193,7 +193,7 @@ let UI = {
|
||||
chrome: false
|
||||
};
|
||||
let deferred = promise.defer();
|
||||
return devtools.TargetFactory.forRemoteTab(options);
|
||||
return TargetFactory.forRemoteTab(options);
|
||||
},
|
||||
|
||||
openToolboxForTab: function (aNode) {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
const {utils: Cu, interfaces: Ci} = Components;
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {Toolbox} = require("devtools/framework/toolbox");
|
||||
const {ConnectionManager, Connection} = require("devtools/client/connection-manager");
|
||||
const promise = require("devtools/toolkit/deprecated-sync-thenables");
|
||||
const prefs = require("sdk/preferences/service");
|
||||
@ -164,7 +164,7 @@ let UI = {
|
||||
},
|
||||
|
||||
openAndShowToolboxForTarget: function(target, name, icon) {
|
||||
let host = devtools.Toolbox.HostType.CUSTOM;
|
||||
let host = Toolbox.HostType.CUSTOM;
|
||||
let toolbox = gDevTools.getToolbox(target);
|
||||
if (!toolbox) {
|
||||
let uid = "uid" + this._toolboxTabCursor++;
|
||||
|
@ -7,8 +7,7 @@ const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {ConnectionManager, Connection} = require("devtools/client/connection-manager");
|
||||
const {AppProjects} = require("devtools/app-manager/app-projects");
|
||||
const {AppValidator} = require("devtools/app-manager/app-validator");
|
||||
|
@ -14,8 +14,7 @@
|
||||
let Utils = (function() {
|
||||
const Cu = Components.utils;
|
||||
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
|
||||
|
||||
|
@ -6,9 +6,8 @@ const {utils: Cu, classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
const {Promise: promise} =
|
||||
Cu.import("resource://gre/modules/devtools/deprecated-sync-thenables.js", {});
|
||||
const {devtools} =
|
||||
const {require} =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
|
||||
const {AppProjects} = require("devtools/app-manager/app-projects");
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
|
@ -18,8 +18,7 @@
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {AppValidator} = require("devtools/app-manager/app-validator");
|
||||
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -38,8 +38,7 @@ Bug 901519 - [app manager] data store for connections
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {ConnectionManager} = require("devtools/client/connection-manager");
|
||||
const ConnectionStore = require("devtools/app-manager/connection-store");
|
||||
|
@ -37,13 +37,12 @@ Bug 901520 - [app manager] data store for device
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {ConnectionManager} = require("devtools/client/connection-manager");
|
||||
const DeviceStore = require("devtools/app-manager/device-store");
|
||||
|
||||
let {getDeviceFront} = devtools.require("devtools/server/actors/device");
|
||||
let {getDeviceFront} = require("devtools/server/actors/device");
|
||||
|
||||
let connection = ConnectionManager.createConnection();
|
||||
let store = new DeviceStore(connection);
|
||||
|
@ -22,8 +22,7 @@ Bug 907206 - data store for local apps
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const { AppProjects } = require("devtools/app-manager/app-projects");
|
||||
|
||||
|
@ -31,9 +31,10 @@ Bug 912646 - Closing app toolbox causes phone to disconnect
|
||||
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
const {devtools} =
|
||||
const {require} =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {TargetFactory} = require("devtools/framework/target");
|
||||
const {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
const {Connection, ConnectionManager} =
|
||||
require("devtools/client/connection-manager");
|
||||
@ -76,8 +77,8 @@ Bug 912646 - Closing app toolbox causes phone to disconnect
|
||||
client: connection.client,
|
||||
chrome: true
|
||||
};
|
||||
devtools.TargetFactory.forRemoteTab(options).then(target => {
|
||||
let hostType = devtools.Toolbox.HostType.WINDOW;
|
||||
TargetFactory.forRemoteTab(options).then(target => {
|
||||
let hostType = Toolbox.HostType.WINDOW;
|
||||
gDevTools.showToolbox(target,
|
||||
null,
|
||||
hostType).then(toolbox => {
|
||||
|
@ -159,8 +159,7 @@
|
||||
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require} = devtools;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const ObservableObject = require("devtools/shared/observable-object");
|
||||
|
||||
let data = {
|
||||
|
@ -11,8 +11,7 @@ Cu.import("resource:///modules/devtools/SideMenuWidget.jsm");
|
||||
Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/Console.jsm");
|
||||
|
||||
const devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
const { require } = devtools;
|
||||
const { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
const { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
||||
|
@ -15,16 +15,16 @@ let { generateUUID } = Cc['@mozilla.org/uuid-generator;1'].getService(Ci.nsIUUID
|
||||
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
let { CallWatcherFront } = devtools.require("devtools/server/actors/call-watcher");
|
||||
let { CanvasFront } = devtools.require("devtools/server/actors/canvas");
|
||||
let { setTimeout } = devtools.require("sdk/timers");
|
||||
let DevToolsUtils = devtools.require("devtools/toolkit/DevToolsUtils");
|
||||
let TiltGL = devtools.require("devtools/tilt/tilt-gl");
|
||||
let TargetFactory = devtools.TargetFactory;
|
||||
let Toolbox = devtools.Toolbox;
|
||||
let { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
||||
let { CanvasFront } = require("devtools/server/actors/canvas");
|
||||
let { setTimeout } = require("sdk/timers");
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
let TiltGL = require("devtools/tilt/tilt-gl");
|
||||
let { TargetFactory } = require("devtools/framework/target");
|
||||
let { Toolbox } = require("devtools/framework/toolbox");
|
||||
let mm = null
|
||||
|
||||
const FRAME_SCRIPT_UTILS_URL = "chrome://browser/content/devtools/frame-script-utils.js";
|
||||
|
@ -5,9 +5,8 @@
|
||||
const TEST_BASE_HTTP = "http://example.com/browser/browser/devtools/commandline/test/";
|
||||
const TEST_BASE_HTTPS = "https://example.com/browser/browser/devtools/commandline/test/";
|
||||
|
||||
let { require } =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
let console = require("resource://gre/modules/devtools/Console.jsm").console;
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { console } = require("resource://gre/modules/devtools/Console.jsm");
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
|
||||
// Import the GCLI test helper
|
||||
|
@ -22,8 +22,8 @@ var { helpers, assert } = (function() {
|
||||
|
||||
var helpers = {};
|
||||
|
||||
var TargetFactory = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.TargetFactory;
|
||||
var require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
|
||||
var { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
var { TargetFactory } = require("devtools/framework/target");
|
||||
|
||||
var assert = { ok: ok, is: is, log: info };
|
||||
var util = require('gcli/util/util');
|
||||
|
@ -102,9 +102,10 @@ Cu.import("resource:///modules/devtools/SideMenuWidget.jsm");
|
||||
Cu.import("resource:///modules/devtools/VariablesView.jsm");
|
||||
Cu.import("resource:///modules/devtools/VariablesViewController.jsm");
|
||||
Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
|
||||
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const require = devtools.require;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {TargetFactory} = require("devtools/framework/target");
|
||||
const {Toolbox} = require("devtools/framework/toolbox")
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
const promise = require("devtools/toolkit/deprecated-sync-thenables");
|
||||
const Editor = require("devtools/sourceeditor/editor");
|
||||
@ -126,7 +127,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
|
||||
|
||||
Object.defineProperty(this, "NetworkHelper", {
|
||||
get: function() {
|
||||
return devtools.require("devtools/toolkit/webconsole/network-helper");
|
||||
return require("devtools/toolkit/webconsole/network-helper");
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
@ -491,9 +492,9 @@ Workers.prototype = {
|
||||
|
||||
_onWorkerSelect: function (workerActor) {
|
||||
let workerClient = this._workerClients.get(workerActor);
|
||||
gDevTools.showToolbox(devtools.TargetFactory.forWorker(workerClient),
|
||||
gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
|
||||
"jsdebugger",
|
||||
devtools.Toolbox.HostType.WINDOW);
|
||||
Toolbox.HostType.WINDOW);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
const TAB_URL = EXAMPLE_URL + "doc_auto-pretty-print-01.html";
|
||||
|
||||
let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
let { RootActor } = devtools.require("devtools/server/actors/root");
|
||||
let { RootActor } = require("devtools/server/actors/root");
|
||||
|
||||
function test() {
|
||||
let gTab, gDebuggee, gPanel, gDebugger;
|
||||
|
@ -5,8 +5,7 @@
|
||||
* Make sure the root actor's live tab list implementation works as specified.
|
||||
*/
|
||||
|
||||
let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
let { BrowserTabList } = devtools.require("devtools/server/actors/webbrowser");
|
||||
let { BrowserTabList } = require("devtools/server/actors/webbrowser");
|
||||
|
||||
let gTestPage = "data:text/html;charset=utf-8," + encodeURIComponent(
|
||||
"<title>JS Debugger BrowserTabList test page</title><body>Yo.</body>");
|
||||
|
@ -61,7 +61,7 @@ function testPause() {
|
||||
is(gFocusedWindow, window,
|
||||
"Main window is the top level window before pause.");
|
||||
|
||||
if (gToolbox.hostType == devtools.Toolbox.HostType.WINDOW) {
|
||||
if (gToolbox.hostType == Toolbox.HostType.WINDOW) {
|
||||
gToolbox._host._window.addEventListener("focus", function onFocus() {
|
||||
gToolbox._host._window.removeEventListener("focus", onFocus, true);
|
||||
gFocusedWindow = gToolbox._host._window;
|
||||
@ -69,7 +69,7 @@ function testPause() {
|
||||
}
|
||||
|
||||
gDebugger.gThreadClient.addOneTimeListener("paused", () => {
|
||||
if (gToolbox.hostType == devtools.Toolbox.HostType.WINDOW) {
|
||||
if (gToolbox.hostType == Toolbox.HostType.WINDOW) {
|
||||
is(gFocusedWindow, gToolbox._host._window,
|
||||
"Toolbox window is the top level window on pause.");
|
||||
} else {
|
||||
@ -116,19 +116,19 @@ function testResume() {
|
||||
}
|
||||
|
||||
function maybeEndTest() {
|
||||
if (gToolbox.hostType == devtools.Toolbox.HostType.BOTTOM) {
|
||||
if (gToolbox.hostType == Toolbox.HostType.BOTTOM) {
|
||||
info("Switching to a toolbox window host.");
|
||||
gToolbox.switchHost(devtools.Toolbox.HostType.WINDOW).then(focusMainWindow);
|
||||
gToolbox.switchHost(Toolbox.HostType.WINDOW).then(focusMainWindow);
|
||||
} else {
|
||||
info("Switching to main window host.");
|
||||
gToolbox.switchHost(devtools.Toolbox.HostType.BOTTOM).then(() => closeDebuggerAndFinish(gPanel));
|
||||
gToolbox.switchHost(Toolbox.HostType.BOTTOM).then(() => closeDebuggerAndFinish(gPanel));
|
||||
}
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
// Revert to the default toolbox host, so that the following tests proceed
|
||||
// normally and not inside a non-default host.
|
||||
Services.prefs.setCharPref("devtools.toolbox.host", devtools.Toolbox.HostType.BOTTOM);
|
||||
Services.prefs.setCharPref("devtools.toolbox.host", Toolbox.HostType.BOTTOM);
|
||||
|
||||
gTab = null;
|
||||
gPanel = null;
|
||||
|
@ -8,8 +8,8 @@
|
||||
"use strict";
|
||||
|
||||
const TAB_URL = EXAMPLE_URL + "doc_promise-get-allocation-stack.html";
|
||||
const { PromisesFront } = devtools.require("devtools/server/actors/promises");
|
||||
let events = devtools.require("sdk/event/core");
|
||||
const { PromisesFront } = require("devtools/server/actors/promises");
|
||||
let events = require("sdk/event/core");
|
||||
|
||||
function test() {
|
||||
Task.spawn(function* () {
|
||||
|
@ -9,8 +9,8 @@
|
||||
"use strict";
|
||||
|
||||
const SOURCE_URL = "browser_dbg_promises-chrome-allocation-stack.js";
|
||||
const { PromisesFront } = devtools.require("devtools/server/actors/promises");
|
||||
let events = devtools.require("sdk/event/core");
|
||||
const { PromisesFront } = require("devtools/server/actors/promises");
|
||||
let events = require("sdk/event/core");
|
||||
|
||||
const STACK_DATA = [
|
||||
{ functionDisplayName: "test/</<" },
|
||||
|
@ -4,7 +4,8 @@ function a(){b()}function b(){debugger}
|
||||
// Generate this file by evaluating the following in a browser-environment
|
||||
// scratchpad:
|
||||
//
|
||||
// Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm');
|
||||
// let { require } = Components.utils.import('resource://gre/modules/devtools/Loader.jsm', {});
|
||||
// let { SourceNode } = require("source-map");
|
||||
//
|
||||
// let dataUrl = s => "data:text/javascript," + s;
|
||||
//
|
||||
|
@ -15,8 +15,7 @@ Services.prefs.setBoolPref("devtools.debugger.log", false);
|
||||
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/devtools/deprecated-sync-thenables.js", {});
|
||||
let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { require } = devtools;
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
let { BrowserToolboxProcess } = Cu.import("resource:///modules/devtools/ToolboxProcess.jsm", {});
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
@ -25,8 +24,8 @@ let { DebuggerClient, ObjectClient } =
|
||||
let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
|
||||
let EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
const { promiseInvoke } = require("devtools/async-utils");
|
||||
let TargetFactory = devtools.TargetFactory;
|
||||
let Toolbox = devtools.Toolbox;
|
||||
let { TargetFactory } = require("devtools/framework/target");
|
||||
let { Toolbox } = require("devtools/framework/toolbox")
|
||||
|
||||
const EXAMPLE_URL = "http://example.com/browser/browser/devtools/debugger/test/";
|
||||
const FRAME_SCRIPT_URL = getRootDirectory(gTestPath) + "code_frame-script.js";
|
||||
@ -601,8 +600,8 @@ AddonDebugger.prototype = {
|
||||
customIframe: this.frame
|
||||
};
|
||||
|
||||
this.target = devtools.TargetFactory.forTab(targetOptions);
|
||||
let toolbox = yield gDevTools.showToolbox(this.target, "jsdebugger", devtools.Toolbox.HostType.CUSTOM, toolboxOptions);
|
||||
this.target = TargetFactory.forTab(targetOptions);
|
||||
let toolbox = yield gDevTools.showToolbox(this.target, "jsdebugger", Toolbox.HostType.CUSTOM, toolboxOptions);
|
||||
|
||||
info("Addon debugger panel shown successfully.");
|
||||
|
||||
|
@ -94,7 +94,7 @@ Tools.inspector = {
|
||||
},
|
||||
inMenu: true,
|
||||
commands: [
|
||||
"devtools/resize-commands",
|
||||
"devtools/responsivedesign/resize-commands",
|
||||
"devtools/inspector/inspector-commands",
|
||||
"devtools/eyedropper/commands.js"
|
||||
],
|
||||
|
@ -39,11 +39,11 @@ devtoolsCommandlineHandler.prototype = {
|
||||
handleConsoleFlag: function(cmdLine) {
|
||||
let window = Services.wm.getMostRecentWindow("devtools:webconsole");
|
||||
if (!window) {
|
||||
let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
// Load the browser devtools main module as the loader's main module.
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
let hudservice = devtools.require("devtools/webconsole/hudservice");
|
||||
let console = Cu.import("resource://gre/modules/devtools/Console.jsm", {}).console;
|
||||
let hudservice = require("devtools/webconsole/hudservice");
|
||||
let { console } = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
|
||||
hudservice.toggleBrowserConsole().then(null, console.error);
|
||||
} else {
|
||||
window.focus(); // the Browser Console was already open
|
||||
|
@ -5,7 +5,7 @@
|
||||
Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/browser/devtools/framework/test/shared-head.js", this);
|
||||
Services.scriptloader.loadSubScript(TEST_DIR + "../../../commandline/test/helpers.js", this);
|
||||
|
||||
const { Eyedropper, EyedropperManager } = devtools.require("devtools/eyedropper/eyedropper");
|
||||
const { Eyedropper, EyedropperManager } = require("devtools/eyedropper/eyedropper");
|
||||
|
||||
function waitForClipboard(setup, expected) {
|
||||
let deferred = promise.defer();
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
// Test that the preview images are updated when the theme changes.
|
||||
|
||||
const { getTheme, setTheme } = devtools.require("devtools/shared/theme");
|
||||
const { getTheme, setTheme } = require("devtools/shared/theme");
|
||||
|
||||
const TEST_URI = BASE_URI + "browser_fontinspector.html";
|
||||
const originalTheme = getTheme();
|
||||
|
@ -12,17 +12,13 @@ const CHROME_DEBUGGER_PROFILE_NAME = "chrome_debugger_profile";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm")
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DevToolsLoader",
|
||||
"resource://gre/modules/devtools/Loader.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "devtools",
|
||||
"resource://gre/modules/devtools/Loader.jsm");
|
||||
const { require, DevToolsLoader } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "Telemetry", function () {
|
||||
return devtools.require("devtools/shared/telemetry");
|
||||
return require("devtools/shared/telemetry");
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(this, "EventEmitter", function () {
|
||||
return devtools.require("devtools/toolkit/event-emitter");
|
||||
return require("devtools/toolkit/event-emitter");
|
||||
});
|
||||
const { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
|
||||
|
@ -12,7 +12,9 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
let {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let {TargetFactory} = require("devtools/framework/target");
|
||||
let {Toolbox} = require("devtools/framework/toolbox")
|
||||
let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
|
||||
let gClient;
|
||||
@ -236,8 +238,8 @@ function openToolbox(form, chrome=false, tool="webconsole", isTabActor) {
|
||||
chrome: chrome,
|
||||
isTabActor: isTabActor
|
||||
};
|
||||
devtools.TargetFactory.forRemoteTab(options).then((target) => {
|
||||
let hostType = devtools.Toolbox.HostType.WINDOW;
|
||||
TargetFactory.forRemoteTab(options).then((target) => {
|
||||
let hostType = Toolbox.HostType.WINDOW;
|
||||
gDevTools.showToolbox(target, tool, hostType).then((toolbox) => {
|
||||
toolbox.once("destroyed", function() {
|
||||
gClient.close();
|
||||
|
@ -10,7 +10,10 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
const {require, devtools: loader} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
// Load target and toolbox lazily as they need gDevTools to be fully initialized
|
||||
loader.lazyRequireGetter(this, "TargetFactory", "devtools/framework/target", true);
|
||||
loader.lazyRequireGetter(this, "Toolbox", "devtools/framework/toolbox", true);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "promise",
|
||||
"resource://gre/modules/Promise.jsm", "Promise");
|
||||
@ -23,8 +26,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerClient",
|
||||
"resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
const EventEmitter = devtools.require("devtools/toolkit/event-emitter");
|
||||
const Telemetry = devtools.require("devtools/shared/telemetry");
|
||||
const DefaultTools = require("definitions").defaultTools;
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
const Telemetry = require("devtools/shared/telemetry");
|
||||
|
||||
const TABS_OPEN_PEAK_HISTOGRAM = "DEVTOOLS_TABS_OPEN_PEAK_LINEAR";
|
||||
const TABS_OPEN_AVG_HISTOGRAM = "DEVTOOLS_TABS_OPEN_AVERAGE_LINEAR";
|
||||
@ -96,7 +100,7 @@ DevTools.prototype = {
|
||||
// Make sure that additional tools will always be able to be hidden.
|
||||
// When being called from main.js, defaultTools has not yet been exported.
|
||||
// But, we can assume that in this case, it is a default tool.
|
||||
if (devtools.defaultTools && devtools.defaultTools.indexOf(toolDefinition) == -1) {
|
||||
if (DefaultTools && DefaultTools.indexOf(toolDefinition) == -1) {
|
||||
toolDefinition.visibilityswitch = "devtools." + toolId + ".enabled";
|
||||
}
|
||||
|
||||
@ -142,13 +146,13 @@ DevTools.prototype = {
|
||||
},
|
||||
|
||||
getDefaultTools: function DT_getDefaultTools() {
|
||||
return devtools.defaultTools.sort(this.ordinalSort);
|
||||
return DefaultTools.sort(this.ordinalSort);
|
||||
},
|
||||
|
||||
getAdditionalTools: function DT_getAdditionalTools() {
|
||||
let tools = [];
|
||||
for (let [key, value] of this._tools) {
|
||||
if (devtools.defaultTools.indexOf(value) == -1) {
|
||||
if (DefaultTools.indexOf(value) == -1) {
|
||||
tools.push(value);
|
||||
}
|
||||
}
|
||||
@ -394,7 +398,7 @@ DevTools.prototype = {
|
||||
}
|
||||
else {
|
||||
// No toolbox for target, create one
|
||||
toolbox = new devtools.Toolbox(target, toolId, hostType, hostOptions);
|
||||
toolbox = new Toolbox(target, toolId, hostType, hostOptions);
|
||||
|
||||
this.emit("toolbox-created", toolbox);
|
||||
|
||||
@ -537,18 +541,18 @@ let gDevToolsBrowser = {
|
||||
* of there
|
||||
*/
|
||||
toggleToolboxCommand: function(gBrowser) {
|
||||
let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
let toolbox = gDevTools.getToolbox(target);
|
||||
|
||||
// If a toolbox exists, using toggle from the Main window :
|
||||
// - should close a docked toolbox
|
||||
// - should focus a windowed toolbox
|
||||
let isDocked = toolbox && toolbox.hostType != devtools.Toolbox.HostType.WINDOW;
|
||||
let isDocked = toolbox && toolbox.hostType != Toolbox.HostType.WINDOW;
|
||||
isDocked ? toolbox.destroy() : gDevTools.showToolbox(target);
|
||||
},
|
||||
|
||||
toggleBrowserToolboxCommand: function(gBrowser) {
|
||||
let target = devtools.TargetFactory.forWindow(gBrowser.ownerDocument.defaultView);
|
||||
let target = TargetFactory.forWindow(gBrowser.ownerDocument.defaultView);
|
||||
let toolbox = gDevTools.getToolbox(target);
|
||||
|
||||
toolbox ? toolbox.destroy()
|
||||
@ -650,7 +654,7 @@ let gDevToolsBrowser = {
|
||||
* and the host is a window, we raise the toolbox window
|
||||
*/
|
||||
selectToolCommand: function(gBrowser, toolId) {
|
||||
let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
let toolbox = gDevTools.getToolbox(target);
|
||||
let toolDefinition = gDevTools.getToolDefinition(toolId);
|
||||
|
||||
@ -660,7 +664,7 @@ let gDevToolsBrowser = {
|
||||
{
|
||||
toolbox.fireCustomKey(toolId);
|
||||
|
||||
if (toolDefinition.preventClosingOnKey || toolbox.hostType == devtools.Toolbox.HostType.WINDOW) {
|
||||
if (toolDefinition.preventClosingOnKey || toolbox.hostType == Toolbox.HostType.WINDOW) {
|
||||
toolbox.raise();
|
||||
} else {
|
||||
toolbox.destroy();
|
||||
@ -668,7 +672,7 @@ let gDevToolsBrowser = {
|
||||
gDevTools.emit("select-tool-command", toolId);
|
||||
} else {
|
||||
gDevTools.showToolbox(target, toolId).then(() => {
|
||||
let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
let toolbox = gDevTools.getToolbox(target);
|
||||
|
||||
toolbox.fireCustomKey(toolId);
|
||||
@ -734,7 +738,7 @@ let gDevToolsBrowser = {
|
||||
chrome: true,
|
||||
isTabActor: false
|
||||
};
|
||||
return devtools.TargetFactory.forRemoteTab(options);
|
||||
return TargetFactory.forRemoteTab(options);
|
||||
})
|
||||
.then(target => {
|
||||
// Ensure closing the connection in order to cleanup
|
||||
@ -756,7 +760,7 @@ let gDevToolsBrowser = {
|
||||
.then(target => {
|
||||
// Display a new toolbox, in a new window, with debugger by default
|
||||
return gDevTools.showToolbox(target, "jsdebugger",
|
||||
devtools.Toolbox.HostType.WINDOW);
|
||||
Toolbox.HostType.WINDOW);
|
||||
});
|
||||
},
|
||||
|
||||
@ -872,7 +876,7 @@ let gDevToolsBrowser = {
|
||||
let tm = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
|
||||
|
||||
function slowScriptDebugHandler(aTab, aCallback) {
|
||||
let target = devtools.TargetFactory.forTab(aTab);
|
||||
let target = TargetFactory.forTab(aTab);
|
||||
|
||||
gDevTools.showToolbox(target, "jsdebugger").then(toolbox => {
|
||||
let threadClient = toolbox.getCurrentPanel().panelWin.gThreadClient;
|
||||
@ -1174,8 +1178,8 @@ let gDevToolsBrowser = {
|
||||
for (let win of gDevToolsBrowser._trackedBrowserWindows) {
|
||||
|
||||
let hasToolbox = false;
|
||||
if (devtools.TargetFactory.isKnownTab(win.gBrowser.selectedTab)) {
|
||||
let target = devtools.TargetFactory.forTab(win.gBrowser.selectedTab);
|
||||
if (TargetFactory.isKnownTab(win.gBrowser.selectedTab)) {
|
||||
let target = TargetFactory.forTab(win.gBrowser.selectedTab);
|
||||
if (gDevTools._toolboxes.has(target)) {
|
||||
hasToolbox = true;
|
||||
}
|
||||
@ -1323,4 +1327,4 @@ gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox);
|
||||
Services.obs.addObserver(gDevToolsBrowser.destroy, "quit-application", false);
|
||||
|
||||
// Load the browser devtools main module as the loader's main module.
|
||||
devtools.main("main");
|
||||
loader.main("main");
|
||||
|
@ -7,13 +7,15 @@
|
||||
|
||||
const URL = "data:text/html;charset=utf8,test page";
|
||||
|
||||
let {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
add_task(function*() {
|
||||
info("Create a test tab and open the toolbox");
|
||||
let tab = yield addTab(URL);
|
||||
let target = TargetFactory.forTab(tab);
|
||||
let toolbox = yield gDevTools.showToolbox(target, "webconsole");
|
||||
|
||||
let {SIDE, BOTTOM} = devtools.Toolbox.HostType;
|
||||
let {SIDE, BOTTOM} = Toolbox.HostType;
|
||||
for (let type of [SIDE, BOTTOM, SIDE]) {
|
||||
info("Switch to host type " + type);
|
||||
yield toolbox.switchHost(type);
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
const URL = "data:text/html;charset=utf8,test page for toolbox switching";
|
||||
|
||||
let {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
add_task(function*() {
|
||||
info("Create a test tab and open the toolbox");
|
||||
let tab = yield addTab(URL);
|
||||
@ -16,7 +18,7 @@ add_task(function*() {
|
||||
|
||||
let keyElement = toolbox.doc.getElementById("toolbox-toggle-host-key");
|
||||
|
||||
let {SIDE, BOTTOM, WINDOW} = devtools.Toolbox.HostType;
|
||||
let {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
|
||||
checkHostType(toolbox, BOTTOM, SIDE);
|
||||
|
||||
info ("Switching from bottom to side");
|
||||
|
@ -1,9 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let { devtools } =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
// Ensure target is closed if client is closed directly
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
@ -15,7 +12,7 @@ function test() {
|
||||
chrome: true
|
||||
};
|
||||
|
||||
devtools.TargetFactory.forRemoteTab(options).then(target => {
|
||||
TargetFactory.forRemoteTab(options).then(target => {
|
||||
target.on("close", () => {
|
||||
ok(true, "Target was closed");
|
||||
finish();
|
||||
|
@ -4,12 +4,10 @@
|
||||
// Test support methods on Target, such as `hasActor`, `getActorDescription`,
|
||||
// `actorHasMethod` and `getTrait`.
|
||||
|
||||
let { devtools } =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { Task } =
|
||||
Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
let { WebAudioFront } =
|
||||
devtools.require("devtools/server/actors/webaudio");
|
||||
require("devtools/server/actors/webaudio");
|
||||
|
||||
function* testTarget (client, target) {
|
||||
yield target.makeRemote();
|
||||
@ -63,7 +61,7 @@ function test() {
|
||||
chrome: true
|
||||
};
|
||||
|
||||
devtools.TargetFactory.forRemoteTab(options).then(Task.async(testTarget).bind(null, client));
|
||||
TargetFactory.forRemoteTab(options).then(Task.async(testTarget).bind(null, client));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,7 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
let Toolbox = devtools.Toolbox;
|
||||
let {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
let toolbox, iframe, target, tab;
|
||||
|
||||
|
@ -1,11 +1,8 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let Toolbox = devtools.Toolbox;
|
||||
let temp = {};
|
||||
Cu.import("resource://gre/modules/Services.jsm", temp);
|
||||
let Services = temp.Services;
|
||||
temp = null;
|
||||
let {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
let toolbox = null;
|
||||
|
||||
function test() {
|
||||
|
@ -4,7 +4,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
let {SIDE, BOTTOM, WINDOW} = devtools.Toolbox.HostType;
|
||||
let {Toolbox} = require("devtools/framework/toolbox");
|
||||
let {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
|
||||
let toolbox, target;
|
||||
|
||||
const URL = "data:text/html;charset=utf8,test for opening toolbox in different hosts";
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
const URL = "data:text/html;charset=utf8,test for host sizes";
|
||||
|
||||
let {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
add_task(function*() {
|
||||
// Set size prefs to make the hosts way too big, so that the size has
|
||||
// to be clamped to fit into the browser window.
|
||||
@ -27,7 +29,7 @@ add_task(function*() {
|
||||
let iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
|
||||
is (iframe.clientHeight, nboxHeight - 25, "The iframe fits within the available space");
|
||||
|
||||
yield toolbox.switchHost(devtools.Toolbox.HostType.SIDE);
|
||||
yield toolbox.switchHost(Toolbox.HostType.SIDE);
|
||||
iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
|
||||
iframe.style.minWidth = "1px"; // Disable the min width set in css
|
||||
is (iframe.clientWidth, nboxWidth - 25, "The iframe fits within the available space");
|
||||
@ -52,7 +54,7 @@ add_task(function*() {
|
||||
let iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
|
||||
is (iframe.clientHeight, 100, "The iframe is resized properly");
|
||||
|
||||
yield toolbox.switchHost(devtools.Toolbox.HostType.SIDE);
|
||||
yield toolbox.switchHost(Toolbox.HostType.SIDE);
|
||||
iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
|
||||
iframe.style.minWidth = "1px"; // Disable the min width set in css
|
||||
is (iframe.clientWidth, 100, "The iframe is resized properly");
|
||||
|
@ -10,6 +10,7 @@
|
||||
// Finally test that the minimize button doesn't exist in other host types.
|
||||
|
||||
const URL = "data:text/html;charset=utf8,test page";
|
||||
const {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
add_task(function*() {
|
||||
info("Create a test tab and open the toolbox");
|
||||
@ -61,7 +62,7 @@ add_task(function*() {
|
||||
yield onMaximized;
|
||||
|
||||
info("Switch to a different host");
|
||||
yield toolbox.switchHost(devtools.Toolbox.HostType.SIDE);
|
||||
yield toolbox.switchHost(Toolbox.HostType.SIDE);
|
||||
button = toolbox.doc.querySelector("#toolbox-dock-bottom-minimize");
|
||||
ok(!button, "The minimize button doesn't exist in the side host");
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user