Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-04-15 14:58:23 +02:00
commit 270cf9a9e5
100 changed files with 1142 additions and 269 deletions

View File

@ -142,7 +142,7 @@ function create(options) {
node.setAttribute('label', label); node.setAttribute('label', label);
node.setAttribute('tooltiptext', label); node.setAttribute('tooltiptext', label);
node.setAttribute('image', image); node.setAttribute('image', image);
node.setAttribute('sdk-button', 'true'); node.setAttribute('constrain-size', 'true');
views.set(id, { views.set(id, {
area: this.currentArea, area: this.currentArea,

View File

@ -57,7 +57,7 @@ exports['test exceptions'] = function(assert) {
} + '();'); } + '();');
} }
catch (error) { catch (error) {
assert.equal(error.fileName, '', 'no fileName reported'); assert.equal(error.fileName, '[System Principal]', 'No specific fileName reported');
assert.equal(error.lineNumber, 3, 'reports correct line number'); assert.equal(error.lineNumber, 3, 'reports correct line number');
} }

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db"> <project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -19,8 +19,8 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="46e1877c0d88b085f7ebc5f432d5bb8f1e2d1f3b"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="46e1877c0d88b085f7ebc5f432d5bb8f1e2d1f3b"/>

View File

@ -17,8 +17,8 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db"> <project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8"> <project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -19,8 +19,8 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="46e1877c0d88b085f7ebc5f432d5bb8f1e2d1f3b"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="46e1877c0d88b085f7ebc5f432d5bb8f1e2d1f3b"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db"> <project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -17,8 +17,8 @@
</project> </project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

View File

@ -1,9 +1,9 @@
{ {
"git": { "git": {
"git_revision": "8e28588496f82f8f069c171c65842d622b9d8d7d", "git_revision": "2dd89fef4fae4d86fd313037ef384086c2e0e8a5",
"remote": "https://git.mozilla.org/releases/gaia.git", "remote": "https://git.mozilla.org/releases/gaia.git",
"branch": "" "branch": ""
}, },
"revision": "ff36a42838b338d750be214ac110c5cc4369b180", "revision": "9b4f4ec031e567ece9b707841fa50d27d346cd83",
"repo_path": "integration/gaia-central" "repo_path": "integration/gaia-central"
} }

View File

@ -17,8 +17,8 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8"> <project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="2dd89fef4fae4d86fd313037ef384086c2e0e8a5"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f2f2f0cbee2f2517070dd194051d509c07cdacff"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/> <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -252,7 +252,7 @@ let ReadingListUI = {
if (this.enabled && state == "valid") { if (this.enabled && state == "valid") {
uri = gBrowser.currentURI; uri = gBrowser.currentURI;
if (uri.schemeIs("about")) if (uri.schemeIs("about"))
uri = ReaderParent.parseReaderUrl(uri.spec); uri = ReaderMode.getOriginalUrl(uri.spec);
else if (!uri.schemeIs("http") && !uri.schemeIs("https")) else if (!uri.schemeIs("http") && !uri.schemeIs("https"))
uri = null; uri = null;
} }
@ -309,7 +309,7 @@ let ReadingListUI = {
togglePageByBrowser: Task.async(function* (browser) { togglePageByBrowser: Task.async(function* (browser) {
let uri = browser.currentURI; let uri = browser.currentURI;
if (uri.spec.startsWith("about:reader?")) if (uri.spec.startsWith("about:reader?"))
uri = ReaderParent.parseReaderUrl(uri.spec); uri = ReaderMode.getOriginalUrl(uri.spec);
if (!uri) if (!uri)
return; return;
@ -330,7 +330,7 @@ let ReadingListUI = {
isItemForCurrentBrowser(item) { isItemForCurrentBrowser(item) {
let currentURL = gBrowser.currentURI.spec; let currentURL = gBrowser.currentURI.spec;
if (currentURL.startsWith("about:reader?")) if (currentURL.startsWith("about:reader?"))
currentURL = ReaderParent.parseReaderUrl(currentURL); currentURL = ReaderMode.getOriginalUrl(currentURL);
if (item.url == currentURL || item.resolvedURL == currentURL) { if (item.url == currentURL || item.resolvedURL == currentURL) {
return true; return true;

View File

@ -213,6 +213,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "CastingApps",
XPCOMUtils.defineLazyModuleGetter(this, "SimpleServiceDiscovery", XPCOMUtils.defineLazyModuleGetter(this, "SimpleServiceDiscovery",
"resource://gre/modules/SimpleServiceDiscovery.jsm"); "resource://gre/modules/SimpleServiceDiscovery.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
"resource://gre/modules/ReaderMode.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent", XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
"resource:///modules/ReaderParent.jsm"); "resource:///modules/ReaderParent.jsm");

View File

@ -578,6 +578,7 @@ nsContextMenu.prototype = {
this.linkURI = null; this.linkURI = null;
this.linkText = ""; this.linkText = "";
this.linkProtocol = ""; this.linkProtocol = "";
this.linkDownload = "";
this.linkHasNoReferrer = false; this.linkHasNoReferrer = false;
this.onMathML = false; this.onMathML = false;
this.inFrame = false; this.inFrame = false;
@ -751,6 +752,14 @@ nsContextMenu.prototype = {
this.onMailtoLink = (this.linkProtocol == "mailto"); this.onMailtoLink = (this.linkProtocol == "mailto");
this.onSaveableLink = this.isLinkSaveable( this.link ); this.onSaveableLink = this.isLinkSaveable( this.link );
this.linkHasNoReferrer = BrowserUtils.linkHasNoReferrer(elem); this.linkHasNoReferrer = BrowserUtils.linkHasNoReferrer(elem);
try {
if (elem.download) {
// Ignore download attribute on cross-origin links
this.principal.checkMayLoad(this.linkURI, false, true);
this.linkDownload = elem.download;
}
}
catch (ex) {}
} }
// Background image? Don't bother if we've already found a // Background image? Don't bother if we've already found a
@ -1171,7 +1180,8 @@ nsContextMenu.prototype = {
// Helper function to wait for appropriate MIME-type headers and // Helper function to wait for appropriate MIME-type headers and
// then prompt the user with a file picker // then prompt the user with a file picker
saveHelper: function(linkURL, linkText, dialogTitle, bypassCache, doc) { saveHelper: function(linkURL, linkText, dialogTitle, bypassCache, doc,
linkDownload) {
// canonical def in nsURILoader.h // canonical def in nsURILoader.h
const NS_ERROR_SAVE_LINK_AS_TIMEOUT = 0x805d0020; const NS_ERROR_SAVE_LINK_AS_TIMEOUT = 0x805d0020;
@ -1277,6 +1287,8 @@ nsContextMenu.prototype = {
null, // aTriggeringPrincipal null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL, Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER); Ci.nsIContentPolicy.TYPE_OTHER);
if (linkDownload)
channel.contentDispositionFilename = linkDownload;
if (channel instanceof Ci.nsIPrivateBrowsingChannel) { if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
let docIsPrivate = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser); let docIsPrivate = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser);
channel.setPrivate(docIsPrivate); channel.setPrivate(docIsPrivate);
@ -1313,7 +1325,8 @@ nsContextMenu.prototype = {
// Save URL of clicked-on link. // Save URL of clicked-on link.
saveLink: function() { saveLink: function() {
urlSecurityCheck(this.linkURL, this.principal); urlSecurityCheck(this.linkURL, this.principal);
this.saveHelper(this.linkURL, this.linkText, null, true, this.ownerDoc); this.saveHelper(this.linkURL, this.linkText, null, true, this.ownerDoc,
this.linkDownload);
}, },
// Backwards-compatibility wrapper // Backwards-compatibility wrapper
@ -1341,7 +1354,7 @@ nsContextMenu.prototype = {
else if (this.onVideo || this.onAudio) { else if (this.onVideo || this.onAudio) {
urlSecurityCheck(this.mediaURL, this.principal); urlSecurityCheck(this.mediaURL, this.principal);
var dialogTitle = this.onVideo ? "SaveVideoTitle" : "SaveAudioTitle"; var dialogTitle = this.onVideo ? "SaveVideoTitle" : "SaveAudioTitle";
this.saveHelper(this.mediaURL, null, dialogTitle, false, doc); this.saveHelper(this.mediaURL, null, dialogTitle, false, doc, "");
} }
}, },

View File

@ -17,7 +17,7 @@ const TEST_PATH = "http://example.com/browser/browser/base/content/test/general/
let readerButton = document.getElementById("reader-mode-button"); let readerButton = document.getElementById("reader-mode-button");
add_task(function* () { add_task(function* test_reader_button() {
registerCleanupFunction(function() { registerCleanupFunction(function() {
// Reset test prefs. // Reset test prefs.
TEST_PREFS.forEach(([name, value]) => { TEST_PREFS.forEach(([name, value]) => {
@ -90,3 +90,16 @@ add_task(function* () {
yield promiseWaitForCondition(() => !readerButton.hidden); yield promiseWaitForCondition(() => !readerButton.hidden);
is_element_visible(readerButton, "Reader mode button is present on a reader-able page"); is_element_visible(readerButton, "Reader mode button is present on a reader-able page");
}); });
add_task(function* test_getOriginalUrl() {
let { ReaderMode } = Cu.import("resource://gre/modules/ReaderMode.jsm", {});
let url = "http://foo.com/article.html";
is(ReaderMode.getOriginalUrl("about:reader?url=" + encodeURIComponent(url)), url, "Found original URL from encoded URL");
is(ReaderMode.getOriginalUrl("about:reader?foobar"), null, "Did not find original URL from malformed reader URL");
is(ReaderMode.getOriginalUrl(url), null, "Did not find original URL from non-reader URL");
let badUrl = "http://foo.com/?;$%^^";
is(ReaderMode.getOriginalUrl("about:reader?url=" + encodeURIComponent(badUrl)), badUrl, "Found original URL from encoded malformed URL");
is(ReaderMode.getOriginalUrl("about:reader?url=" + badUrl), badUrl, "Found original URL from non-encoded malformed URL");
});

View File

@ -6,7 +6,21 @@
* as expected. Pinned tabs should not be moved. Gaps will be re-filled * as expected. Pinned tabs should not be moved. Gaps will be re-filled
* if more sites are available. * if more sites are available.
*/ */
gDirectorySource = "data:application/json," + JSON.stringify({
"suggested": [{
url: "http://suggested.com/",
imageURI: "data:image/png;base64,helloWORLD3",
title: "title",
type: "affiliate",
frecent_sites: ["example0.com"]
}]
});
function runTests() { function runTests() {
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = (site) => false;
// we remove sites and expect the gaps to be filled as long as there still // we remove sites and expect the gaps to be filled as long as there still
// are some sites available // are some sites available
yield setLinks("0,1,2,3,4,5,6,7,8,9"); yield setLinks("0,1,2,3,4,5,6,7,8,9");
@ -58,4 +72,16 @@ function runTests() {
yield blockCell(0); yield blockCell(0);
checkGrid("1,2,3,4,5,6,7,9,8p"); checkGrid("1,2,3,4,5,6,7,9,8p");
// Test that blocking the targeted site also removes its associated suggested tile
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
yield restore();
yield setLinks("0,1,2,3,4,5,6,7,8,9");
yield addNewTabPageTab();
yield customizeNewTabPage("enhanced");
checkGrid("http://suggested.com/,0,1,2,3,4,5,6,7,8,9");
yield blockCell(1);
yield addNewTabPageTab();
checkGrid("1,2,3,4,5,6,7,8,9");
} }

View File

@ -109,7 +109,7 @@ function runTests() {
// Test that a suggested tile is not enhanced by a directory tile // Test that a suggested tile is not enhanced by a directory tile
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite; let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = () => true; NewTabUtils.isTopPlacesSite = () => true;
yield setLinks("-1"); yield setLinks("-1,2,3,4,5,6,7,8");
// Test with enhanced = false // Test with enhanced = false
yield addNewTabPageTab(); yield addNewTabPageTab();
@ -119,7 +119,8 @@ function runTests() {
is(enhanced, "", "history link has no enhanced image"); is(enhanced, "", "history link has no enhanced image");
is(title, "site#-1"); is(title, "site#-1");
is(getData(1), null, "there is only one link and it's a history link"); isnot(getData(7), null, "there are 8 history links");
is(getData(8), null, "there are 8 history links");
// Test with enhanced = true // Test with enhanced = true
@ -138,5 +139,5 @@ function runTests() {
isnot(enhanced, "", "pinned history link has enhanced image"); isnot(enhanced, "", "pinned history link has enhanced image");
is(title, "title"); is(title, "title");
is(getData(2), null, "there is only a suggested link followed by an enhanced history link"); is(getData(9), null, "there is a suggested link followed by an enhanced history link and the remaining history links");
} }

View File

@ -168,7 +168,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
} }
} }
} else { } else {
let originalUrl = ReaderParent.parseReaderUrl(aValue); let originalUrl = ReaderMode.getOriginalUrl(aValue);
if (originalUrl) { if (originalUrl) {
returnValue = originalUrl; returnValue = originalUrl;
} }

View File

@ -185,7 +185,7 @@ var gContentPane = {
*/ */
configureFonts: function () configureFonts: function ()
{ {
gSubDialog.open("chrome://browser/content/preferences/fonts.xul"); gSubDialog.open("chrome://browser/content/preferences/fonts.xul", "resizable=no");
}, },
/** /**
@ -194,7 +194,7 @@ var gContentPane = {
*/ */
configureColors: function () configureColors: function ()
{ {
gSubDialog.open("chrome://browser/content/preferences/colors.xul"); gSubDialog.open("chrome://browser/content/preferences/colors.xul", "resizable=no");
}, },
// LANGUAGES // LANGUAGES

View File

@ -511,7 +511,7 @@ var gPrivacyPane = {
*/ */
showClearPrivateDataSettings: function () showClearPrivateDataSettings: function ()
{ {
gSubDialog.open("chrome://browser/content/preferences/sanitize.xul"); gSubDialog.open("chrome://browser/content/preferences/sanitize.xul", "resizable=no");
}, },

View File

@ -217,7 +217,7 @@ var gSecurityPane = {
changeMasterPassword: function () changeMasterPassword: function ()
{ {
gSubDialog.open("chrome://mozapps/content/preferences/changemp.xul", gSubDialog.open("chrome://mozapps/content/preferences/changemp.xul",
null, null, this._initMasterPasswordUI.bind(this)); "resizable=no", null, this._initMasterPasswordUI.bind(this));
}, },
/** /**

View File

@ -65,6 +65,9 @@ const SUGGESTED_FRECENCY = Infinity;
// Default number of times to show a link // Default number of times to show a link
const DEFAULT_FREQUENCY_CAP = 5; const DEFAULT_FREQUENCY_CAP = 5;
// The min number of visible (not blocked) history tiles to have before showing suggested tiles
const MIN_VISIBLE_HISTORY_TILES = 8;
// Divide frecency by this amount for pings // Divide frecency by this amount for pings
const PING_SCORE_DIVISOR = 10000; const PING_SCORE_DIVISOR = 10000;
@ -509,6 +512,7 @@ let DirectoryLinksProvider = {
this._lastDownloadMS = 0; this._lastDownloadMS = 0;
NewTabUtils.placesProvider.addObserver(this); NewTabUtils.placesProvider.addObserver(this);
NewTabUtils.links.addObserver(this);
return Task.spawn(function() { return Task.spawn(function() {
// get the last modified time of the links file if it exists // get the last modified time of the links file if it exists
@ -563,7 +567,7 @@ let DirectoryLinksProvider = {
onLinkChanged: function (aProvider, aLink) { onLinkChanged: function (aProvider, aLink) {
// Make sure NewTabUtils.links handles the notification first. // Make sure NewTabUtils.links handles the notification first.
setTimeout(() => { setTimeout(() => {
if (this._handleLinkChanged(aLink)) { if (this._handleLinkChanged(aLink) || this._shouldUpdateSuggestedTile()) {
this._updateSuggestedTile(); this._updateSuggestedTile();
} }
}, 0); }, 0);
@ -591,6 +595,38 @@ let DirectoryLinksProvider = {
} }
}, },
_getCurrentTopSiteCount: function() {
let visibleTopSiteCount = 0;
for (let link of NewTabUtils.links.getLinks().slice(0, MIN_VISIBLE_HISTORY_TILES)) {
if (link && (link.type == "history" || link.type == "enhanced")) {
visibleTopSiteCount++;
}
}
return visibleTopSiteCount;
},
_shouldUpdateSuggestedTile: function() {
let sortedLinks = NewTabUtils.getProviderLinks(this);
let mostFrecentLink = {};
if (sortedLinks && sortedLinks.length) {
mostFrecentLink = sortedLinks[0]
}
let currTopSiteCount = this._getCurrentTopSiteCount();
if ((!mostFrecentLink.targetedSite && currTopSiteCount >= MIN_VISIBLE_HISTORY_TILES) ||
(mostFrecentLink.targetedSite && currTopSiteCount < MIN_VISIBLE_HISTORY_TILES)) {
// If mostFrecentLink has a targetedSite then mostFrecentLink is a suggested link.
// If we have enough history links (8+) to show a suggested tile and we are not
// already showing one, then we should update (to *attempt* to add a suggested tile).
// OR if we don't have enough history to show a suggested tile (<8) and we are
// currently showing one, we should update (to remove it).
return true;
}
return false;
},
/** /**
* Chooses and returns a suggested tile based on a user's top sites * Chooses and returns a suggested tile based on a user's top sites
* that we have an available suggested tile for. * that we have an available suggested tile for.
@ -620,8 +656,9 @@ let DirectoryLinksProvider = {
} }
} }
if (this._topSitesWithSuggestedLinks.size == 0) { if (this._topSitesWithSuggestedLinks.size == 0 || !this._shouldUpdateSuggestedTile()) {
// There are no potential suggested links we can show. // There are no potential suggested links we can show or not
// enough history for a suggested tile.
return; return;
} }

View File

@ -172,7 +172,7 @@ let ReaderParent = {
let url = browser.currentURI.spec; let url = browser.currentURI.spec;
if (url.startsWith("about:reader")) { if (url.startsWith("about:reader")) {
let originalURL = this._getOriginalUrl(url); let originalURL = ReaderMode.getOriginalUrl(url);
if (!originalURL) { if (!originalURL) {
Cu.reportError("Error finding original URL for about:reader URL: " + url); Cu.reportError("Error finding original URL for about:reader URL: " + url);
} else { } else {
@ -183,28 +183,6 @@ let ReaderParent = {
} }
}, },
parseReaderUrl: function(url) {
if (!url.startsWith("about:reader?")) {
return null;
}
return this._getOriginalUrl(url);
},
/**
* Returns original URL from an about:reader URL.
*
* @param url An about:reader URL.
* @return The original URL for the article, or null if we did not find
* a properly formatted about:reader URL.
*/
_getOriginalUrl: function(url) {
let searchParams = new URLSearchParams(url.substring("about:reader?".length));
if (!searchParams.has("url")) {
return null;
}
return decodeURIComponent(searchParams.get("url"));
},
/** /**
* Gets an article for a given URL. This method will download and parse a document. * Gets an article for a given URL. This method will download and parse a document.
* *

View File

@ -265,18 +265,19 @@ function CreateSocialStatusWidget(aId, aProvider) {
CustomizableUI.createWidget({ CustomizableUI.createWidget({
id: aId, id: aId,
type: 'custom', type: "custom",
removable: true, removable: true,
defaultArea: CustomizableUI.AREA_NAVBAR, defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) { onBuild: function(aDocument) {
let node = aDocument.createElement('toolbarbutton'); let node = aDocument.createElement("toolbarbutton");
node.id = this.id; node.id = this.id;
node.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional social-status-button badged-button'); node.setAttribute("class", "toolbarbutton-1 chromeclass-toolbar-additional social-status-button badged-button");
node.style.listStyleImage = "url(" + (aProvider.icon32URL || aProvider.iconURL) + ")"; node.style.listStyleImage = "url(" + (aProvider.icon32URL || aProvider.iconURL) + ")";
node.setAttribute("origin", aProvider.origin); node.setAttribute("origin", aProvider.origin);
node.setAttribute("label", aProvider.name); node.setAttribute("label", aProvider.name);
node.setAttribute("tooltiptext", aProvider.name); node.setAttribute("tooltiptext", aProvider.name);
node.setAttribute("oncommand", "SocialStatus.showPopup(this);"); node.setAttribute("oncommand", "SocialStatus.showPopup(this);");
node.setAttribute("constrain-size", "true");
if (PrivateBrowsingUtils.isWindowPrivate(aDocument.defaultView)) if (PrivateBrowsingUtils.isWindowPrivate(aDocument.defaultView))
node.setAttribute("disabled", "true"); node.setAttribute("disabled", "true");
@ -298,14 +299,15 @@ function CreateSocialMarkWidget(aId, aProvider) {
CustomizableUI.createWidget({ CustomizableUI.createWidget({
id: aId, id: aId,
type: 'custom', type: "custom",
removable: true, removable: true,
defaultArea: CustomizableUI.AREA_NAVBAR, defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) { onBuild: function(aDocument) {
let node = aDocument.createElement('toolbarbutton'); let node = aDocument.createElement("toolbarbutton");
node.id = this.id; node.id = this.id;
node.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional social-mark-button'); node.setAttribute("class", "toolbarbutton-1 chromeclass-toolbar-additional social-mark-button");
node.setAttribute('type', "socialmark"); node.setAttribute("type", "socialmark");
node.setAttribute("constrain-size", "true");
node.style.listStyleImage = "url(" + (aProvider.unmarkedIcon || aProvider.icon32URL || aProvider.iconURL) + ")"; node.style.listStyleImage = "url(" + (aProvider.unmarkedIcon || aProvider.icon32URL || aProvider.iconURL) + ")";
node.setAttribute("origin", aProvider.origin); node.setAttribute("origin", aProvider.origin);

View File

@ -223,6 +223,42 @@ function run_test() {
}); });
} }
add_task(function test_shouldUpdateSuggestedTile() {
let suggestedLink = {
targetedSite: "somesite.com"
};
// DirectoryLinksProvider has no suggested tile and no top sites => no need to update
do_check_eq(DirectoryLinksProvider._getCurrentTopSiteCount(), 0);
isIdentical(NewTabUtils.getProviderLinks(), []);
do_check_eq(DirectoryLinksProvider._shouldUpdateSuggestedTile(), false);
// DirectoryLinksProvider has a suggested tile and no top sites => need to update
let origGetProviderLinks = NewTabUtils.getProviderLinks;
NewTabUtils.getProviderLinks = (provider) => [suggestedLink];
do_check_eq(DirectoryLinksProvider._getCurrentTopSiteCount(), 0);
isIdentical(NewTabUtils.getProviderLinks(), [suggestedLink]);
do_check_eq(DirectoryLinksProvider._shouldUpdateSuggestedTile(), true);
// DirectoryLinksProvider has a suggested tile and 8 top sites => no need to update
let origCurrentTopSiteCount = DirectoryLinksProvider._getCurrentTopSiteCount;
DirectoryLinksProvider._getCurrentTopSiteCount = () => 8;
do_check_eq(DirectoryLinksProvider._getCurrentTopSiteCount(), 8);
isIdentical(NewTabUtils.getProviderLinks(), [suggestedLink]);
do_check_eq(DirectoryLinksProvider._shouldUpdateSuggestedTile(), false);
// DirectoryLinksProvider has no suggested tile and 8 top sites => need to update
NewTabUtils.getProviderLinks = origGetProviderLinks;
do_check_eq(DirectoryLinksProvider._getCurrentTopSiteCount(), 8);
isIdentical(NewTabUtils.getProviderLinks(), []);
do_check_eq(DirectoryLinksProvider._shouldUpdateSuggestedTile(), true);
// Cleanup
DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
});
add_task(function test_updateSuggestedTile() { add_task(function test_updateSuggestedTile() {
let topSites = ["site0.com", "1040.com", "site2.com", "hrblock.com", "site4.com", "freetaxusa.com", "site6.com"]; let topSites = ["site0.com", "1040.com", "site2.com", "hrblock.com", "site4.com", "freetaxusa.com", "site6.com"];
@ -246,6 +282,9 @@ add_task(function test_updateSuggestedTile() {
return links; return links;
} }
let origCurrentTopSiteCount = DirectoryLinksProvider._getCurrentTopSiteCount;
DirectoryLinksProvider._getCurrentTopSiteCount = () => 8;
do_check_eq(DirectoryLinksProvider._updateSuggestedTile(), undefined); do_check_eq(DirectoryLinksProvider._updateSuggestedTile(), undefined);
function TestFirstRun() { function TestFirstRun() {
@ -346,6 +385,7 @@ add_task(function test_updateSuggestedTile() {
yield promiseCleanDirectoryLinksProvider(); yield promiseCleanDirectoryLinksProvider();
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite; NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
NewTabUtils.getProviderLinks = origGetProviderLinks; NewTabUtils.getProviderLinks = origGetProviderLinks;
DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
}); });
add_task(function test_suggestedLinksMap() { add_task(function test_suggestedLinksMap() {
@ -436,6 +476,9 @@ add_task(function test_suggestedAttributes() {
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite; let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = () => true; NewTabUtils.isTopPlacesSite = () => true;
let origCurrentTopSiteCount = DirectoryLinksProvider._getCurrentTopSiteCount;
DirectoryLinksProvider._getCurrentTopSiteCount = () => 8;
let frecent_sites = ["top.site.com"]; let frecent_sites = ["top.site.com"];
let imageURI = "https://image/"; let imageURI = "https://image/";
let title = "the title"; let title = "the title";
@ -478,6 +521,7 @@ add_task(function test_suggestedAttributes() {
// Cleanup. // Cleanup.
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite; NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
gLinks.removeProvider(DirectoryLinksProvider); gLinks.removeProvider(DirectoryLinksProvider);
DirectoryLinksProvider.removeObserver(gLinks); DirectoryLinksProvider.removeObserver(gLinks);
}); });
@ -487,6 +531,9 @@ add_task(function test_frequencyCappedSites_views() {
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite; let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = () => true; NewTabUtils.isTopPlacesSite = () => true;
let origCurrentTopSiteCount = DirectoryLinksProvider._getCurrentTopSiteCount;
DirectoryLinksProvider._getCurrentTopSiteCount = () => 8;
let testUrl = "http://frequency.capped/link"; let testUrl = "http://frequency.capped/link";
let targets = ["top.site.com"]; let targets = ["top.site.com"];
let data = { let data = {
@ -548,6 +595,7 @@ add_task(function test_frequencyCappedSites_views() {
// Cleanup. // Cleanup.
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite; NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
gLinks.removeProvider(DirectoryLinksProvider); gLinks.removeProvider(DirectoryLinksProvider);
DirectoryLinksProvider.removeObserver(gLinks); DirectoryLinksProvider.removeObserver(gLinks);
Services.prefs.setCharPref(kPingUrlPref, kPingUrl); Services.prefs.setCharPref(kPingUrlPref, kPingUrl);
@ -558,6 +606,9 @@ add_task(function test_frequencyCappedSites_click() {
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite; let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = () => true; NewTabUtils.isTopPlacesSite = () => true;
let origCurrentTopSiteCount = DirectoryLinksProvider._getCurrentTopSiteCount;
DirectoryLinksProvider._getCurrentTopSiteCount = () => 8;
let testUrl = "http://frequency.capped/link"; let testUrl = "http://frequency.capped/link";
let targets = ["top.site.com"]; let targets = ["top.site.com"];
let data = { let data = {
@ -613,6 +664,7 @@ add_task(function test_frequencyCappedSites_click() {
// Cleanup. // Cleanup.
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite; NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
gLinks.removeProvider(DirectoryLinksProvider); gLinks.removeProvider(DirectoryLinksProvider);
DirectoryLinksProvider.removeObserver(gLinks); DirectoryLinksProvider.removeObserver(gLinks);
Services.prefs.setCharPref(kPingUrlPref, kPingUrl); Services.prefs.setCharPref(kPingUrlPref, kPingUrl);
@ -1089,6 +1141,8 @@ add_task(function test_DirectoryLinksProvider_getEnhancedLink() {
add_task(function test_DirectoryLinksProvider_enhancedURIs() { add_task(function test_DirectoryLinksProvider_enhancedURIs() {
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite; let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = () => true; NewTabUtils.isTopPlacesSite = () => true;
let origCurrentTopSiteCount = DirectoryLinksProvider._getCurrentTopSiteCount;
DirectoryLinksProvider._getCurrentTopSiteCount = () => 8;
let data = { let data = {
"suggested": [ "suggested": [
@ -1129,6 +1183,7 @@ add_task(function test_DirectoryLinksProvider_enhancedURIs() {
// Cleanup. // Cleanup.
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite; NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
gLinks.removeProvider(DirectoryLinksProvider); gLinks.removeProvider(DirectoryLinksProvider);
}); });

View File

@ -595,12 +595,12 @@ menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip) {
} }
/* Help SDK icons fit: */ /* Help SDK icons fit: */
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon, toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-icon,
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-badge-container > .toolbarbutton-icon { toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-badge-container > .toolbarbutton-icon {
width: 16px; width: 16px;
} }
:-moz-any(#TabsToolbar, #nav-bar) toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon { :-moz-any(#TabsToolbar, #nav-bar) toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
/* XXXgijs box models strike again: this is 16px + 2 * 7px padding + 2 * 1px border (from the rules above) */ /* XXXgijs box models strike again: this is 16px + 2 * 7px padding + 2 * 1px border (from the rules above) */
width: 32px; width: 32px;
} }

View File

@ -1353,8 +1353,8 @@ toolbar .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutto
} }
/* Help SDK icons fit: */ /* Help SDK icons fit: */
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon, toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-icon,
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-badge-container > .toolbarbutton-icon { toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-badge-container > .toolbarbutton-icon {
width: 16px; width: 16px;
} }

View File

@ -300,10 +300,10 @@ toolbarpaletteitem[place="panel"]:not([haswideitem=true]) > .toolbarbutton-1 {
} }
/* Help SDK buttons fit in. */ /* Help SDK buttons fit in. */
toolbarpaletteitem[place="palette"] > toolbarbutton[sdk-button="true"] > .toolbarbutton-icon, toolbarpaletteitem[place="palette"] > toolbarbutton[constrain-size="true"] > .toolbarbutton-icon,
toolbarpaletteitem[place="palette"] > toolbarbutton[sdk-button="true"] > .toolbarbutton-badge-container > .toolbarbutton-icon, toolbarpaletteitem[place="palette"] > toolbarbutton[constrain-size="true"] > .toolbarbutton-badge-container > .toolbarbutton-icon,
toolbarbutton[sdk-button="true"][cui-areatype="menu-panel"] > .toolbarbutton-icon, toolbarbutton[constrain-size="true"][cui-areatype="menu-panel"] > .toolbarbutton-icon,
toolbarbutton[sdk-button="true"][cui-areatype="menu-panel"] > .toolbarbutton-badge-container > .toolbarbutton-icon { toolbarbutton[constrain-size="true"][cui-areatype="menu-panel"] > .toolbarbutton-badge-container > .toolbarbutton-icon {
height: 32px; height: 32px;
width: 32px; width: 32px;
} }

View File

@ -733,12 +733,12 @@ toolbarbutton[cui-areatype="toolbar"] > :-moz-any(@nestedButtons@) > .toolbarbut
} }
/* Help SDK icons fit: */ /* Help SDK icons fit: */
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon, toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-icon,
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-badge-container > .toolbarbutton-icon { toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-badge-container > .toolbarbutton-icon {
width: 16px; width: 16px;
} }
#nav-bar toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon { #nav-bar toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
/* XXXgijs box models strike again: this is 16px + 2 * 7px padding + 2 * 1px border (from the rules above) */ /* XXXgijs box models strike again: this is 16px + 2 * 7px padding + 2 * 1px border (from the rules above) */
width: 32px; width: 32px;
} }
@ -1630,13 +1630,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
} }
toolbarbutton[type="socialmark"] > .toolbarbutton-icon {
width: auto;
height: auto;
max-width: 32px;
max-height: 24px;
}
/* fixup corners for share panel */ /* fixup corners for share panel */
.social-panel > .social-panel-frame { .social-panel > .social-panel-frame {
border-radius: inherit; border-radius: inherit;

View File

@ -980,8 +980,21 @@ nsExpandedPrincipal::IsOnCSSUnprefixingWhitelist()
void void
nsExpandedPrincipal::GetScriptLocation(nsACString& aStr) nsExpandedPrincipal::GetScriptLocation(nsACString& aStr)
{ {
// Is that a good idea to list it's principals?
aStr.Assign(EXPANDED_PRINCIPAL_SPEC); aStr.Assign(EXPANDED_PRINCIPAL_SPEC);
aStr.AppendLiteral(" (");
for (size_t i = 0; i < mPrincipals.Length(); ++i) {
if (i != 0) {
aStr.AppendLiteral(", ");
}
nsAutoCString spec;
nsJSPrincipals::get(mPrincipals.ElementAt(i))->GetScriptLocation(spec);
aStr.Append(spec);
}
aStr.Append(")");
} }
#ifdef DEBUG #ifdef DEBUG

View File

@ -446,6 +446,9 @@ GLContextEGL::ReleaseSurface() {
if (mOwnsContext) { if (mOwnsContext) {
mozilla::gl::DestroySurface(mSurface); mozilla::gl::DestroySurface(mSurface);
} }
if (mSurface == mSurfaceOverride) {
mSurfaceOverride = EGL_NO_SURFACE;
}
mSurface = EGL_NO_SURFACE; mSurface = EGL_NO_SURFACE;
} }
@ -813,6 +816,41 @@ GLContextProviderEGL::CreateForWindow(nsIWidget *aWidget)
return glContext.forget(); return glContext.forget();
} }
#if defined(ANDROID)
EGLSurface
GLContextProviderEGL::CreateEGLSurface(void* aWindow)
{
if (!sEGLLibrary.EnsureInitialized()) {
MOZ_CRASH("Failed to load EGL library!\n");
}
EGLConfig config;
if (!CreateConfig(&config)) {
MOZ_CRASH("Failed to create EGLConfig!\n");
}
MOZ_ASSERT(aWindow);
EGLSurface surface = sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config, aWindow, 0);
if (surface == EGL_NO_SURFACE) {
MOZ_CRASH("Failed to create EGLSurface!\n");
}
return surface;
}
void
GLContextProviderEGL::DestroyEGLSurface(EGLSurface surface)
{
if (!sEGLLibrary.EnsureInitialized()) {
MOZ_CRASH("Failed to load EGL library!\n");
}
sEGLLibrary.fDestroySurface(EGL_DISPLAY(), surface);
}
#endif // defined(ANDROID)
already_AddRefed<GLContextEGL> already_AddRefed<GLContextEGL>
GLContextEGL::CreateEGLPBufferOffscreenContext(const gfxIntSize& size) GLContextEGL::CreateEGLPBufferOffscreenContext(const gfxIntSize& size)
{ {

View File

@ -10,6 +10,9 @@
#ifndef GL_CONTEXT_PROVIDER_NAME #ifndef GL_CONTEXT_PROVIDER_NAME
#error GL_CONTEXT_PROVIDER_NAME not defined #error GL_CONTEXT_PROVIDER_NAME not defined
#endif #endif
#if defined(ANDROID)
typedef void* EGLSurface;
#endif // defined(ANDROID)
class GL_CONTEXT_PROVIDER_NAME class GL_CONTEXT_PROVIDER_NAME
{ {
@ -76,6 +79,11 @@ public:
static already_AddRefed<GLContext> static already_AddRefed<GLContext>
CreateWrappingExisting(void* aContext, void* aSurface); CreateWrappingExisting(void* aContext, void* aSurface);
#if defined(ANDROID)
static EGLSurface CreateEGLSurface(void* aWindow);
static void DestroyEGLSurface(EGLSurface surface);
#endif // defined(ANDROID)
/** /**
* Get a pointer to the global context, creating it if it doesn't exist. * Get a pointer to the global context, creating it if it doesn't exist.
*/ */

View File

@ -55,6 +55,11 @@
#include "nsRegion.h" // for nsIntRegion, etc #include "nsRegion.h" // for nsIntRegion, etc
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
#include <android/log.h> #include <android/log.h>
#include "AndroidBridge.h"
#include "opengl/CompositorOGL.h"
#include "GLContextEGL.h"
#include "GLContextProvider.h"
#include "ScopedGLHelpers.h"
#endif #endif
#include "GeckoProfiler.h" #include "GeckoProfiler.h"
#include "TextRenderer.h" // for TextRenderer #include "TextRenderer.h" // for TextRenderer
@ -307,6 +312,9 @@ LayerManagerComposite::EndTransaction(DrawPaintedLayerCallback aCallback,
ApplyOcclusionCulling(mRoot, opaque); ApplyOcclusionCulling(mRoot, opaque);
Render(); Render();
#ifdef MOZ_WIDGET_ANDROID
RenderToPresentationSurface();
#endif
mGeometryChanged = false; mGeometryChanged = false;
} else { } else {
// Modified layer tree // Modified layer tree
@ -769,6 +777,175 @@ LayerManagerComposite::Render()
RecordFrame(); RecordFrame();
} }
#ifdef MOZ_WIDGET_ANDROID
class ScopedCompositorProjMatrix {
public:
ScopedCompositorProjMatrix(CompositorOGL* aCompositor, const Matrix4x4& aProjMatrix):
mCompositor(aCompositor),
mOriginalProjMatrix(mCompositor->GetProjMatrix())
{
mCompositor->SetProjMatrix(aProjMatrix);
}
~ScopedCompositorProjMatrix()
{
mCompositor->SetProjMatrix(mOriginalProjMatrix);
}
private:
CompositorOGL* const mCompositor;
const Matrix4x4 mOriginalProjMatrix;
};
class ScopedCompostitorSurfaceSize {
public:
ScopedCompostitorSurfaceSize(CompositorOGL* aCompositor, const gfx::IntSize& aSize) :
mCompositor(aCompositor),
mOriginalSize(mCompositor->GetDestinationSurfaceSize())
{
mCompositor->SetDestinationSurfaceSize(aSize);
}
~ScopedCompostitorSurfaceSize()
{
mCompositor->SetDestinationSurfaceSize(mOriginalSize);
}
private:
CompositorOGL* const mCompositor;
const gfx::IntSize mOriginalSize;
};
class ScopedCompositorRenderOffset {
public:
ScopedCompositorRenderOffset(CompositorOGL* aCompositor, const ScreenPoint& aOffset) :
mCompositor(aCompositor),
mOriginalOffset(mCompositor->GetScreenRenderOffset())
{
mCompositor->SetScreenRenderOffset(aOffset);
}
~ScopedCompositorRenderOffset()
{
mCompositor->SetScreenRenderOffset(mOriginalOffset);
}
private:
CompositorOGL* const mCompositor;
const ScreenPoint mOriginalOffset;
};
class ScopedContextSurfaceOverride {
public:
ScopedContextSurfaceOverride(GLContextEGL* aContext, void* aSurface) :
mContext(aContext)
{
MOZ_ASSERT(aSurface);
mContext->SetEGLSurfaceOverride(aSurface);
mContext->MakeCurrent(true);
}
~ScopedContextSurfaceOverride()
{
mContext->SetEGLSurfaceOverride(EGL_NO_SURFACE);
mContext->MakeCurrent(true);
}
private:
GLContextEGL* const mContext;
};
void
LayerManagerComposite::RenderToPresentationSurface()
{
if (!AndroidBridge::Bridge()) {
return;
}
void* window = AndroidBridge::Bridge()->GetPresentationWindow();
if (!window) {
return;
}
EGLSurface surface = AndroidBridge::Bridge()->GetPresentationSurface();
if (!surface) {
//create surface;
surface = GLContextProviderEGL::CreateEGLSurface(window);
if (!surface) {
return;
}
AndroidBridge::Bridge()->SetPresentationSurface(surface);
}
CompositorOGL* compositor = static_cast<CompositorOGL*>(mCompositor.get());
GLContext* gl = compositor->gl();
GLContextEGL* egl = GLContextEGL::Cast(gl);
if (!egl) {
return;
}
const IntSize windowSize = AndroidBridge::Bridge()->GetNativeWindowSize(window);
if ((windowSize.width <= 0) || (windowSize.height <= 0)) {
return;
}
const int actualWidth = windowSize.width;
const int actualHeight = windowSize.height;
const gfx::IntSize originalSize = compositor->GetDestinationSurfaceSize();
const int pageWidth = originalSize.width;
const int pageHeight = originalSize.height;
float scale = 1.0;
if ((pageWidth > actualWidth) || (pageHeight > actualHeight)) {
const float scaleWidth = (float)actualWidth / (float)pageWidth;
const float scaleHeight = (float)actualHeight / (float)pageHeight;
scale = scaleWidth <= scaleHeight ? scaleWidth : scaleHeight;
}
const gfx::IntSize actualSize(actualWidth, actualHeight);
ScopedCompostitorSurfaceSize overrideSurfaceSize(compositor, actualSize);
const ScreenPoint offset((actualWidth - (int)(scale * pageWidth)) / 2, 0);
ScopedCompositorRenderOffset overrideRenderOffset(compositor, offset);
ScopedContextSurfaceOverride overrideSurface(egl, surface);
nsIntRegion invalid;
Rect bounds(0.0f, 0.0f, scale * pageWidth, (float)actualHeight);
Rect rect, actualBounds;
mCompositor->BeginFrame(invalid, nullptr, bounds, &rect, &actualBounds);
// Override the projection matrix since the presentation frame buffer
// is probably not the same size as the device frame buffer. The override
// projection matrix also scales the content to fit into the presentation
// frame buffer.
Matrix viewMatrix;
viewMatrix.PreTranslate(-1.0, 1.0);
viewMatrix.PreScale((2.0f * scale) / (float)actualWidth, (2.0f * scale) / (float)actualHeight);
viewMatrix.PreScale(1.0f, -1.0f);
viewMatrix.PreTranslate((int)((float)offset.x / scale), offset.y);
Matrix4x4 projMatrix = Matrix4x4::From2D(viewMatrix);
ScopedCompositorProjMatrix overrideProjMatrix(compositor, projMatrix);
// The Java side of Fennec sets a scissor rect that accounts for
// chrome such as the URL bar. Override that so that the entire frame buffer
// is cleared.
ScopedScissorRect screen(egl, 0, 0, actualWidth, actualHeight);
egl->fClearColor(0.0, 0.0, 0.0, 0.0);
egl->fClear(LOCAL_GL_COLOR_BUFFER_BIT);
const nsIntRect clipRect = nsIntRect(0, 0, (int)(scale * pageWidth), actualHeight);
RootLayer()->Prepare(RenderTargetPixel::FromUntyped(clipRect));
RootLayer()->RenderLayer(clipRect);
mCompositor->EndFrame();
mCompositor->SetFBAcquireFence(mRoot);
}
#endif
static void static void
SubtractTransformedRegion(nsIntRegion& aRegion, SubtractTransformedRegion(nsIntRegion& aRegion,
const nsIntRegion& aRegionToSubtract, const nsIntRegion& aRegionToSubtract,

View File

@ -278,6 +278,9 @@ private:
* Render the current layer tree to the active target. * Render the current layer tree to the active target.
*/ */
void Render(); void Render();
#ifdef MOZ_WIDGET_ANDROID
void RenderToPresentationSurface();
#endif
/** /**
* Render debug overlays such as the FPS/FrameCounter above the frame. * Render debug overlays such as the FPS/FrameCounter above the frame.

View File

@ -800,6 +800,22 @@ CompositorParent::SchedulePauseOnCompositorThread()
lock.Wait(); lock.Wait();
} }
bool
CompositorParent::ScheduleResumeOnCompositorThread()
{
MonitorAutoLock lock(mResumeCompositionMonitor);
CancelableTask *resumeTask =
NewRunnableMethod(this, &CompositorParent::ResumeComposition);
MOZ_ASSERT(CompositorLoop());
CompositorLoop()->PostTask(FROM_HERE, resumeTask);
// Wait until the resume has actually been processed by the compositor thread
lock.Wait();
return !mPaused;
}
bool bool
CompositorParent::ScheduleResumeOnCompositorThread(int width, int height) CompositorParent::ScheduleResumeOnCompositorThread(int width, int height)
{ {

View File

@ -226,6 +226,7 @@ public:
* Returns true if a surface was obtained and the resume succeeded; false * Returns true if a surface was obtained and the resume succeeded; false
* otherwise. * otherwise.
*/ */
bool ScheduleResumeOnCompositorThread();
bool ScheduleResumeOnCompositorThread(int width, int height); bool ScheduleResumeOnCompositorThread(int width, int height);
virtual void ScheduleComposition(); virtual void ScheduleComposition();

View File

@ -304,6 +304,19 @@ public:
const gfx::Matrix4x4& GetProjMatrix() const { const gfx::Matrix4x4& GetProjMatrix() const {
return mProjMatrix; return mProjMatrix;
} }
void SetProjMatrix(const gfx::Matrix4x4& aProjMatrix) {
mProjMatrix = aProjMatrix;
}
const gfx::IntSize GetDestinationSurfaceSize() const {
return gfx::IntSize (mSurfaceSize.width, mSurfaceSize.height);
}
const ScreenPoint& GetScreenRenderOffset() const {
return mRenderOffset;
}
private: private:
virtual gfx::IntSize GetWidgetSize() const override virtual gfx::IntSize GetWidgetSize() const override
{ {

View File

@ -1507,7 +1507,7 @@ xpc::EvalInSandbox(JSContext* cx, HandleObject sandboxArg, const nsAString& sour
NS_ENSURE_TRUE(prin, NS_ERROR_FAILURE); NS_ENSURE_TRUE(prin, NS_ERROR_FAILURE);
nsAutoCString filenameBuf; nsAutoCString filenameBuf;
if (!filename.IsVoid()) { if (!filename.IsVoid() && filename.Length() != 0) {
filenameBuf.Assign(filename); filenameBuf.Assign(filename);
} else { } else {
// Default to the spec of the principal. // Default to the spec of the principal.

View File

@ -0,0 +1,28 @@
"use strict";
const { utils: Cu, interfaces: Ci, classes: Cc } = Components;
/**
* Test that the name of a sandbox contains the name of all principals.
*/
function test_sandbox_name() {
let names = [
"http://example.com/?" + Math.random(),
"http://example.org/?" + Math.random()
];
let sandbox = Cu.Sandbox(names);
let fileName = Cu.evalInSandbox(
"(new Error()).fileName",
sandbox,
"latest" /*js version*/,
""/*file name*/
);
for (let name of names) {
Assert.ok(fileName.indexOf(name) != -1, `Name ${name} appears in ${fileName}`);
}
};
function run_test() {
test_sandbox_name();
}

View File

@ -99,6 +99,7 @@ skip-if = os == "android" # native test components aren't available on Android
[test_sandbox_atob.js] [test_sandbox_atob.js]
[test_isProxy.js] [test_isProxy.js]
[test_getObjectPrincipal.js] [test_getObjectPrincipal.js]
[test_sandbox_name.js]
[test_watchdog_enable.js] [test_watchdog_enable.js]
head = head_watchdog.js head = head_watchdog.js
[test_watchdog_disable.js] [test_watchdog_disable.js]

View File

@ -779,6 +779,7 @@ public class BrowserApp extends GeckoApp
"Menu:Add", "Menu:Add",
"Menu:Remove", "Menu:Remove",
"Reader:Share", "Reader:Share",
"Sanitize:ClearHistory",
"Settings:Show", "Settings:Show",
"Telemetry:Gather", "Telemetry:Gather",
"Updater:Launch"); "Updater:Launch");
@ -1324,6 +1325,7 @@ public class BrowserApp extends GeckoApp
"Menu:Add", "Menu:Add",
"Menu:Remove", "Menu:Remove",
"Reader:Share", "Reader:Share",
"Sanitize:ClearHistory",
"Settings:Show", "Settings:Show",
"Telemetry:Gather", "Telemetry:Gather",
"Updater:Launch"); "Updater:Launch");
@ -1360,6 +1362,16 @@ public class BrowserApp extends GeckoApp
} }
} }
private void handleClearHistory(final boolean clearSearchHistory) {
final BrowserDB db = getProfile().getDB();
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
public void run() {
db.clearHistory(getContentResolver(), clearSearchHistory);
}
});
}
private void shareCurrentUrl() { private void shareCurrentUrl() {
Tab tab = Tabs.getInstance().getSelectedTab(); Tab tab = Tabs.getInstance().getSelectedTab();
if (tab == null) { if (tab == null) {
@ -1636,7 +1648,9 @@ public class BrowserApp extends GeckoApp
final String title = message.getString("title"); final String title = message.getString("title");
final String url = message.getString("url"); final String url = message.getString("url");
GeckoAppShell.openUriExternal(url, "text/plain", "", "", Intent.ACTION_SEND, title); GeckoAppShell.openUriExternal(url, "text/plain", "", "", Intent.ACTION_SEND, title);
} else if ("Sanitize:ClearHistory".equals(event)) {
handleClearHistory(message.optBoolean("clearSearchHistory", false));
callback.sendSuccess(true);
} else if ("Settings:Show".equals(event)) { } else if ("Settings:Show".equals(event)) {
final String resource = final String resource =
message.optString(GeckoPreferences.INTENT_EXTRA_RESOURCES, null); message.optString(GeckoPreferences.INTENT_EXTRA_RESOURCES, null);

View File

@ -523,16 +523,6 @@ public abstract class GeckoApp
outState.putString(SAVED_STATE_PRIVATE_SESSION, mPrivateBrowsingSession); outState.putString(SAVED_STATE_PRIVATE_SESSION, mPrivateBrowsingSession);
} }
void handleClearHistory(final boolean clearSearchHistory) {
final BrowserDB db = getProfile().getDB();
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
public void run() {
db.clearHistory(getContentResolver(), clearSearchHistory);
}
});
}
public void addTab() { } public void addTab() { }
public void addPrivateTab() { } public void addPrivateTab() { }
@ -625,10 +615,6 @@ public abstract class GeckoApp
} else if ("PrivateBrowsing:Data".equals(event)) { } else if ("PrivateBrowsing:Data".equals(event)) {
mPrivateBrowsingSession = message.optString("session", null); mPrivateBrowsingSession = message.optString("session", null);
} else if ("Sanitize:ClearHistory".equals(event)) {
handleClearHistory(message.optBoolean("clearSearchHistory", false));
callback.sendSuccess(true);
} else if ("Session:StatePurged".equals(event)) { } else if ("Session:StatePurged".equals(event)) {
onStatePurged(); onStatePurged();
@ -1547,7 +1533,6 @@ public abstract class GeckoApp
"Locale:Set", "Locale:Set",
"Permissions:Data", "Permissions:Data",
"PrivateBrowsing:Data", "PrivateBrowsing:Data",
"Sanitize:ClearHistory",
"Session:StatePurged", "Session:StatePurged",
"Share:Text", "Share:Text",
"SystemUI:Visibility", "SystemUI:Visibility",
@ -2039,7 +2024,6 @@ public abstract class GeckoApp
"Locale:Set", "Locale:Set",
"Permissions:Data", "Permissions:Data",
"PrivateBrowsing:Data", "PrivateBrowsing:Data",
"Sanitize:ClearHistory",
"Session:StatePurged", "Session:StatePurged",
"Share:Text", "Share:Text",
"SystemUI:Visibility", "SystemUI:Visibility",

View File

@ -294,6 +294,9 @@ public class GeckoAppShell
public static native SurfaceBits getSurfaceBits(Surface surface); public static native SurfaceBits getSurfaceBits(Surface surface);
public static native void addPresentationSurface(Surface surface);
public static native void removePresentationSurface(Surface surface);
public static native void onFullScreenPluginHidden(View view); public static native void onFullScreenPluginHidden(View view);
public static class CreateShortcutFaviconLoadedListener implements OnFaviconLoadedListener { public static class CreateShortcutFaviconLoadedListener implements OnFaviconLoadedListener {

View File

@ -5,6 +5,9 @@
package org.mozilla.gecko; package org.mozilla.gecko;
import android.app.Presentation;
import android.content.Context;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v7.media.MediaControlIntent; import android.support.v7.media.MediaControlIntent;
@ -12,6 +15,13 @@ import android.support.v7.media.MediaRouteSelector;
import android.support.v7.media.MediaRouter; import android.support.v7.media.MediaRouter;
import android.support.v7.media.MediaRouter.RouteInfo; import android.support.v7.media.MediaRouter.RouteInfo;
import android.util.Log; import android.util.Log;
import android.view.Display;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import com.google.android.gms.cast.CastMediaControlIntent; import com.google.android.gms.cast.CastMediaControlIntent;
@ -61,6 +71,7 @@ public class MediaPlayerManager extends Fragment implements NativeEventListener
private MediaRouter mediaRouter = null; private MediaRouter mediaRouter = null;
private final Map<String, GeckoMediaPlayer> displays = new HashMap<String, GeckoMediaPlayer>(); private final Map<String, GeckoMediaPlayer> displays = new HashMap<String, GeckoMediaPlayer>();
private GeckoPresentation presentation = null;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -135,19 +146,23 @@ public class MediaPlayerManager extends Fragment implements NativeEventListener
displays.remove(route.getId()); displays.remove(route.getId());
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent( GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent(
"MediaPlayer:Removed", route.getId())); "MediaPlayer:Removed", route.getId()));
updatePresentation();
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")
public void onRouteSelected(MediaRouter router, int type, MediaRouter.RouteInfo route) { public void onRouteSelected(MediaRouter router, int type, MediaRouter.RouteInfo route) {
updatePresentation();
} }
// These methods aren't used by the support version Media Router // These methods aren't used by the support version Media Router
@SuppressWarnings("unused") @SuppressWarnings("unused")
public void onRouteUnselected(MediaRouter router, int type, RouteInfo route) { public void onRouteUnselected(MediaRouter router, int type, RouteInfo route) {
updatePresentation();
} }
@Override @Override
public void onRoutePresentationDisplayChanged(MediaRouter router, RouteInfo route) { public void onRoutePresentationDisplayChanged(MediaRouter router, RouteInfo route) {
updatePresentation();
} }
@Override @Override
@ -159,6 +174,7 @@ public class MediaPlayerManager extends Fragment implements NativeEventListener
debug("onRouteAdded: route=" + route); debug("onRouteAdded: route=" + route);
final GeckoMediaPlayer display = getMediaPlayerForRoute(route); final GeckoMediaPlayer display = getMediaPlayerForRoute(route);
saveAndNotifyOfDisplay("MediaPlayer:Added", route, display); saveAndNotifyOfDisplay("MediaPlayer:Added", route, display);
updatePresentation();
} }
@Override @Override
@ -166,6 +182,7 @@ public class MediaPlayerManager extends Fragment implements NativeEventListener
debug("onRouteChanged: route=" + route); debug("onRouteChanged: route=" + route);
final GeckoMediaPlayer display = displays.get(route.getId()); final GeckoMediaPlayer display = displays.get(route.getId());
saveAndNotifyOfDisplay("MediaPlayer:Changed", route, display); saveAndNotifyOfDisplay("MediaPlayer:Changed", route, display);
updatePresentation();
} }
private void saveAndNotifyOfDisplay(final String eventName, private void saveAndNotifyOfDisplay(final String eventName,
@ -221,4 +238,86 @@ public class MediaPlayerManager extends Fragment implements NativeEventListener
.build(); .build();
mediaRouter.addCallback(selectorBuilder, callback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY); mediaRouter.addCallback(selectorBuilder, callback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
} }
@Override
public void onStop() {
super.onStop();
if (presentation != null) {
presentation.dismiss();
presentation = null;
}
}
private void updatePresentation() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
return;
}
if (mediaRouter == null) {
return;
}
MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute();
Display display = route != null ? route.getPresentationDisplay() : null;
if (display != null) {
if ((presentation != null) && (presentation.getDisplay() != display)) {
presentation.dismiss();
presentation = null;
}
if (presentation == null) {
presentation = new GeckoPresentation(getActivity(), display);
try {
presentation.show();
} catch (WindowManager.InvalidDisplayException ex) {
Log.w(LOGTAG, "Couldn't show presentation! Display was removed in "
+ "the meantime.", ex);
presentation = null;
}
}
} else if (presentation != null) {
presentation.dismiss();
presentation = null;
}
}
private static class SurfaceListener implements SurfaceHolder.Callback {
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
// Surface changed so force a composite
GeckoAppShell.scheduleComposite();
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
GeckoAppShell.addPresentationSurface(holder.getSurface());
GeckoAppShell.scheduleComposite();
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
GeckoAppShell.removePresentationSurface(holder.getSurface());
}
}
private final static class GeckoPresentation extends Presentation {
private SurfaceView mView;
public GeckoPresentation(Context context, Display display) {
super(context, display);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mView = new SurfaceView(getContext());
setContentView(mView, new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
mView.getHolder().addCallback(new SurfaceListener());
}
}
} }

View File

@ -4,6 +4,7 @@
package org.mozilla.gecko; package org.mozilla.gecko;
import android.content.res.Resources;
import org.mozilla.gecko.gfx.BitmapUtils; import org.mozilla.gecko.gfx.BitmapUtils;
import org.mozilla.gecko.gfx.BitmapUtils.BitmapLoader; import org.mozilla.gecko.gfx.BitmapUtils.BitmapLoader;
import org.mozilla.gecko.gfx.Layer; import org.mozilla.gecko.gfx.Layer;
@ -16,6 +17,7 @@ import org.mozilla.gecko.util.FloatUtils;
import org.mozilla.gecko.util.GeckoEventListener; import org.mozilla.gecko.util.GeckoEventListener;
import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.gecko.ActionModeCompat.Callback; import org.mozilla.gecko.ActionModeCompat.Callback;
import org.mozilla.gecko.AppConstants.Versions;
import android.content.Context; import android.content.Context;
import android.app.Activity; import android.app.Activity;
@ -279,11 +281,23 @@ class TextSelection extends Layer implements GeckoEventListener {
final int actionEnum = obj.optBoolean("showAsAction") ? GeckoMenuItem.SHOW_AS_ACTION_ALWAYS : GeckoMenuItem.SHOW_AS_ACTION_NEVER; final int actionEnum = obj.optBoolean("showAsAction") ? GeckoMenuItem.SHOW_AS_ACTION_ALWAYS : GeckoMenuItem.SHOW_AS_ACTION_NEVER;
menuitem.setShowAsAction(actionEnum, R.attr.menuItemActionModeStyle); menuitem.setShowAsAction(actionEnum, R.attr.menuItemActionModeStyle);
BitmapUtils.getDrawable(anchorHandle.getContext(), obj.optString("icon"), new BitmapLoader() { final String iconString = obj.optString("icon");
BitmapUtils.getDrawable(anchorHandle.getContext(), iconString, new BitmapLoader() {
@Override @Override
public void onBitmapFound(Drawable d) { public void onBitmapFound(Drawable d) {
if (d != null) { if (d != null) {
menuitem.setIcon(d); menuitem.setIcon(d);
// Dynamically add padding to align the share icon on GB devices.
// To be removed in bug 1122752.
if (Versions.preHC && "drawable://ic_menu_share".equals(iconString)) {
final View view = menuitem.getActionView();
final Resources res = view.getContext().getResources();
final int padding = res.getDimensionPixelSize(R.dimen.ab_share_padding);
view.setPadding(padding, padding, padding, padding);
}
} }
} }
}); });

View File

@ -213,6 +213,10 @@
<dimen name="find_in_page_matchcase_padding">10dip</dimen> <dimen name="find_in_page_matchcase_padding">10dip</dimen>
<dimen name="find_in_page_control_margin_top">2dip</dimen> <dimen name="find_in_page_control_margin_top">2dip</dimen>
<!-- The share icon asset has no padding while the other action bar items do
so we dynamically add padding to compensate. To be removed in bug 1122752. -->
<dimen name="ab_share_padding">12dp</dimen>
<!-- This is a 4:7 ratio (as per UX decision). --> <!-- This is a 4:7 ratio (as per UX decision). -->
<item name="thumbnail_aspect_ratio" format="float" type="dimen">0.571</item> <item name="thumbnail_aspect_ratio" format="float" type="dimen">0.571</item>

View File

@ -5,8 +5,6 @@
"use strict"; "use strict";
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
let Reader = { let Reader = {
// These values should match those defined in BrowserContract.java. // These values should match those defined in BrowserContract.java.
STATUS_UNFETCHED: 0, STATUS_UNFETCHED: 0,

View File

@ -113,6 +113,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "Notifications",
XPCOMUtils.defineLazyModuleGetter(this, "GMPInstallManager", XPCOMUtils.defineLazyModuleGetter(this, "GMPInstallManager",
"resource://gre/modules/GMPInstallManager.jsm"); "resource://gre/modules/GMPInstallManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
let lazilyLoadedBrowserScripts = [ let lazilyLoadedBrowserScripts = [
["SelectHelper", "chrome://browser/content/SelectHelper.js"], ["SelectHelper", "chrome://browser/content/SelectHelper.js"],
["InputWidgetHelper", "chrome://browser/content/InputWidgetHelper.js"], ["InputWidgetHelper", "chrome://browser/content/InputWidgetHelper.js"],
@ -4562,16 +4564,7 @@ Tab.prototype = {
}, },
_stripAboutReaderURL: function (url) { _stripAboutReaderURL: function (url) {
if (!url.startsWith("about:reader")) { return ReaderMode.getOriginalUrl(url) || url;
return url;
}
// From ReaderParent._getOriginalUrl (browser/modules/ReaderParent.jsm).
let searchParams = new URLSearchParams(url.substring("about:reader?".length));
if (!searchParams.has("url")) {
return url;
}
return decodeURIComponent(searchParams.get("url"));
}, },
// Properties used to cache security state used to update the UI // Properties used to cache security state used to update the UI

View File

@ -305,6 +305,44 @@ Java_org_mozilla_gecko_GeckoAppShell_getSurfaceBits(JNIEnv * arg0, jclass arg1,
#ifdef JNI_STUBS #ifdef JNI_STUBS
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface_t)(JNIEnv *, jclass, jobject);
static Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface_t f_Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface;
extern "C" NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface(JNIEnv * arg0, jclass arg1, jobject arg2) {
if (!f_Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface) {
arg0->ThrowNew(arg0->FindClass("java/lang/UnsupportedOperationException"),
"JNI Function called before it was loaded");
return ;
}
f_Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface(arg0, arg1, arg2);
}
#endif
#ifdef JNI_BINDINGS
xul_dlsym("Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface", &f_Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface);
#endif
#ifdef JNI_STUBS
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface_t)(JNIEnv *, jclass, jobject);
static Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface_t f_Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface;
extern "C" NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface(JNIEnv * arg0, jclass arg1, jobject arg2) {
if (!f_Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface) {
arg0->ThrowNew(arg0->FindClass("java/lang/UnsupportedOperationException"),
"JNI Function called before it was loaded");
return ;
}
f_Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface(arg0, arg1, arg2);
}
#endif
#ifdef JNI_BINDINGS
xul_dlsym("Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface", &f_Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface);
#endif
#ifdef JNI_STUBS
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden_t)(JNIEnv *, jclass, jobject); typedef void (*Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden_t)(JNIEnv *, jclass, jobject);
static Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden_t f_Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden; static Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden_t f_Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden;
extern "C" NS_EXPORT void JNICALL extern "C" NS_EXPORT void JNICALL

View File

@ -21,7 +21,7 @@ RUN git config --global user.email "mozilla@example.com" && \
git config --global user.name "mozilla" git config --global user.name "mozilla"
# VCS Tools # VCS Tools
RUN npm install -g taskcluster-vcs@2.3.4 RUN npm install -g taskcluster-vcs@2.3.5
# TODO enable worker # TODO enable worker
# TODO volume mount permissions will be an issue # TODO volume mount permissions will be an issue

View File

@ -4,9 +4,10 @@ MAINTAINER Wander Lairson Costa <wcosta@mozilla.com>
# Add utilities and configuration # Add utilities and configuration
ADD bin /home/worker/bin ADD bin /home/worker/bin
ADD config /home/worker/.aws/config ADD config /home/worker/.aws/config
ADD system-setup.sh /tmp/system-setup.sh
RUN /tmp/system-setup.sh RUN yum install -y bc lzop
RUN pip install awscli
RUN npm install -g bower gulp apm grunt-cli
# Set a default command useful for debugging # Set a default command useful for debugging
ENTRYPOINT ["validate_task.py"] ENTRYPOINT ["validate_task.py"]

View File

@ -1 +1 @@
0.0.12 0.0.13

View File

@ -1,9 +0,0 @@
#!/bin/sh
pip install awscli
# Necessary for dolhin kernel building
yum install -y bc
# Remove ourselves
rm -f $0

View File

@ -0,0 +1,49 @@
#! /bin/bash -vex
. pre-build.sh
if [ 0$B2G_DEBUG -ne 0 ]; then
DEBUG_SUFFIX=-debug
fi
if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
# caching objects might be dangerous for some devices (aka aries)
rm -rf $WORKSPACE/B2G/objdir*
rm -rf $WORKSPACE/B2G/out
fi
aws s3 cp s3://b2g-nightly-credentials/balrog_credentials .
mar_file=b2g-${TARGET%%-*}-gecko-update.mar
./mozharness/scripts/b2g_lightsaber.py \
--config b2g/taskcluster-lightsaber-nightly.py \
--config balrog/staging.py \
"$debug_flag" \
--disable-mock \
--variant=$VARIANT \
--work-dir=$WORKSPACE/B2G \
--gaia-languages-file locales/languages_all.json \
--log-level=debug \
--target=$TARGET \
--b2g-config-dir=$TARGET \
--checkout-revision=$GECKO_HEAD_REV \
--base-repo=$GECKO_BASE_REPOSITORY \
--repo=$GECKO_HEAD_REPOSITORY \
--platform $TARGET \
--complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/$RUN_ID/artifacts/public/build/$mar_file \
# Don't cache backups
rm -rf $WORKSPACE/B2G/backup-*
rm -f balrog_credentials
mkdir -p $HOME/artifacts
mkdir -p $HOME/artifacts-public
mv $WORKSPACE/B2G/upload-public/$mar_file $HOME/artifacts-public/
mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
#mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip
ccache -s

View File

@ -11,7 +11,6 @@ if [ ! -d $HOME/.ssh ]; then
fi fi
aws s3 cp s3://b2g-nightly-credentials/balrog_credentials . aws s3 cp s3://b2g-nightly-credentials/balrog_credentials .
aws s3 cp s3://b2g-nightly-credentials/b2g-rsa $HOME/.ssh/
./mozharness/scripts/b2g_build.py \ ./mozharness/scripts/b2g_build.py \
--config b2g/taskcluster-phone-nightly.py \ --config b2g/taskcluster-phone-nightly.py \
@ -28,12 +27,11 @@ aws s3 cp s3://b2g-nightly-credentials/b2g-rsa $HOME/.ssh/
--base-repo=$GECKO_BASE_REPOSITORY \ --base-repo=$GECKO_BASE_REPOSITORY \
--repo=$GECKO_HEAD_REPOSITORY \ --repo=$GECKO_HEAD_REPOSITORY \
--platform $TARGET \ --platform $TARGET \
--complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/0/artifacts/public/build/b2g-${TARGET%%-*}-gecko-update.mar \ --complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/$RUN_ID/artifacts/public/build/b2g-${TARGET%%-*}-gecko-update.mar \
# Don't cache backups # Don't cache backups
rm -rf $WORKSPACE/B2G/backup-* rm -rf $WORKSPACE/B2G/backup-*
rm -f balrog_credentials rm -f balrog_credentials
rm -f $HOME/.ssh/b2g-rsa
mkdir -p $HOME/artifacts mkdir -p $HOME/artifacts
mkdir -p $HOME/artifacts-public mkdir -p $HOME/artifacts-public

View File

@ -19,14 +19,7 @@ test $VARIANT
. ../builder/setup-ccache.sh . ../builder/setup-ccache.sh
# First check if the mozharness directory is available. This is intended to be tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV $MOZHARNESS_REF
# used locally in development to test mozharness changes:
#
# $ docker -v your_mozharness:/home/worker/mozharness ...
#
if [ ! -d mozharness ]; then
tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV $MOZHARNESS_REF
fi
# Figure out where the remote manifest is so we can use caches for it. # Figure out where the remote manifest is so we can use caches for it.
MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml) MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml)

View File

@ -22,6 +22,7 @@ flags:
- dolphin-eng - dolphin-eng
- dolphin-512 - dolphin-512
- dolphin-512-eng - dolphin-512-eng
- aries-nightly
tests: tests:
- cppunit - cppunit

View File

@ -18,6 +18,12 @@ builds:
types: types:
opt: opt:
task: tasks/builds/b2g_flame_kk_eng.yml task: tasks/builds/b2g_flame_kk_eng.yml
aries-nightly:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_aries_lightsaber_nightly.yml
tests: tests:
gaia-build: gaia-build:

View File

@ -0,0 +1,35 @@
$inherits:
from: 'tasks/builds/b2g_phone_base.yml'
variables:
build_name: 'aries'
build_type: 'nightly'
task:
workerType: flame-kk
scopes:
- 'docker-worker:cache:build-aries-lightsaber-nightly'
metadata:
name: '[TC] B2G Aries Nightly'
payload:
cache:
build-aries-lightsaber-nightly: /home/worker/workspace
env:
TARGET: 'aries'
DEBUG: 0
command:
- >
checkout-gecko workspace &&
cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
buildbot_step 'Build' ./build-lightsaber-nightly.sh $HOME/workspace
extra:
treeherder:
symbol: B
groupSymbol: Aries
groupName: Aries Device Image
machine:
platform: b2g-device-image
locations:
img: 'private/build/aries.zip'
mar: 'public/build/b2g-aries-gecko-update.mar'

View File

@ -2,12 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if defined(MOZ_UPDATER)
# if !defined(MOZ_WIDGET_ANDROID)
# define USE_MOZ_UPDATER
# endif
#endif
#define NS_ALERTSERVICE_CONTRACTID \ #define NS_ALERTSERVICE_CONTRACTID \
"@mozilla.org/alerts-service;1" "@mozilla.org/alerts-service;1"
@ -90,7 +84,7 @@
#define NS_APPSTARTUP_CONTRACTID \ #define NS_APPSTARTUP_CONTRACTID \
"@mozilla.org/toolkit/app-startup;1" "@mozilla.org/toolkit/app-startup;1"
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
#define NS_UPDATEPROCESSOR_CONTRACTID \ #define NS_UPDATEPROCESSOR_CONTRACTID \
"@mozilla.org/updates/update-processor;1" "@mozilla.org/updates/update-processor;1"
#endif #endif
@ -173,7 +167,7 @@
#define NS_FAVICONSERVICE_CID \ #define NS_FAVICONSERVICE_CID \
{ 0x984e3259, 0x9266, 0x49cf, { 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 } } { 0x984e3259, 0x9266, 0x49cf, { 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 } }
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
#define NS_UPDATEPROCESSOR_CID \ #define NS_UPDATEPROCESSOR_CID \
{ 0xf3dcf644, 0x79e8, 0x4f59, { 0xa1, 0xbb, 0x87, 0x84, 0x54, 0x48, 0x8e, 0xf9 } } { 0xf3dcf644, 0x79e8, 0x4f59, { 0xa1, 0xbb, 0x87, 0x84, 0x54, 0x48, 0x8e, 0xf9 } }
#endif #endif

View File

@ -7,7 +7,7 @@
#include "nsUserInfo.h" #include "nsUserInfo.h"
#include "nsToolkitCompsCID.h" #include "nsToolkitCompsCID.h"
#include "nsFindService.h" #include "nsFindService.h"
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
#include "nsUpdateDriver.h" #include "nsUpdateDriver.h"
#endif #endif
@ -109,7 +109,7 @@ nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, REFNSIID aIID,
#endif #endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUpdateProcessor) NS_GENERIC_FACTORY_CONSTRUCTOR(nsUpdateProcessor)
#endif #endif
NS_GENERIC_FACTORY_CONSTRUCTOR(FinalizationWitnessService) NS_GENERIC_FACTORY_CONSTRUCTOR(FinalizationWitnessService)
@ -141,7 +141,7 @@ NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERSTREAMUPDATER_CID);
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTILS_CID); NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTILS_CID);
#endif #endif
NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID); NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID);
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID); NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
#endif #endif
NS_DEFINE_NAMED_CID(FINALIZATIONWITNESSSERVICE_CID); NS_DEFINE_NAMED_CID(FINALIZATIONWITNESSSERVICE_CID);
@ -173,7 +173,7 @@ static const Module::CIDEntry kToolkitCIDs[] = {
{ &kNS_URLCLASSIFIERUTILS_CID, false, nullptr, nsUrlClassifierUtilsConstructor }, { &kNS_URLCLASSIFIERUTILS_CID, false, nullptr, nsUrlClassifierUtilsConstructor },
#endif #endif
{ &kNS_BROWSERSTATUSFILTER_CID, false, nullptr, nsBrowserStatusFilterConstructor }, { &kNS_BROWSERSTATUSFILTER_CID, false, nullptr, nsBrowserStatusFilterConstructor },
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
{ &kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor }, { &kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor },
#endif #endif
{ &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor }, { &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor },
@ -207,7 +207,7 @@ static const Module::ContractIDEntry kToolkitContracts[] = {
{ NS_URLCLASSIFIERUTILS_CONTRACTID, &kNS_URLCLASSIFIERUTILS_CID }, { NS_URLCLASSIFIERUTILS_CONTRACTID, &kNS_URLCLASSIFIERUTILS_CID },
#endif #endif
{ NS_BROWSERSTATUSFILTER_CONTRACTID, &kNS_BROWSERSTATUSFILTER_CID }, { NS_BROWSERSTATUSFILTER_CONTRACTID, &kNS_BROWSERSTATUSFILTER_CID },
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
{ NS_UPDATEPROCESSOR_CONTRACTID, &kNS_UPDATEPROCESSOR_CID }, { NS_UPDATEPROCESSOR_CONTRACTID, &kNS_UPDATEPROCESSOR_CID },
#endif #endif
{ FINALIZATIONWITNESSSERVICE_CONTRACTID, &kFINALIZATIONWITNESSSERVICE_CID }, { FINALIZATIONWITNESSSERVICE_CONTRACTID, &kFINALIZATIONWITNESSSERVICE_CID },

View File

@ -48,6 +48,7 @@ DIRS += [
'statusfilter', 'statusfilter',
'telemetry', 'telemetry',
'thumbnails', 'thumbnails',
'timermanager',
'typeaheadfind', 'typeaheadfind',
'urlformatter', 'urlformatter',
'viewconfig', 'viewconfig',

View File

@ -8,6 +8,7 @@ let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
this.EXPORTED_SYMBOLS = [ "AboutReader" ]; this.EXPORTED_SYMBOLS = [ "AboutReader" ];
Cu.import("resource://gre/modules/ReaderMode.jsm");
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -734,9 +735,8 @@ AboutReader.prototype = {
this._domainElement.href = article.url; this._domainElement.href = article.url;
let articleUri = Services.io.newURI(article.url, null, null); let articleUri = Services.io.newURI(article.url, null, null);
this._domainElement.innerHTML = this._stripHost(articleUri.host); this._domainElement.textContent = this._stripHost(articleUri.host);
this._creditsElement.textContent = article.byline;
this._creditsElement.innerHTML = article.byline;
this._titleElement.textContent = article.title; this._titleElement.textContent = article.title;
this._doc.title = article.title; this._doc.title = article.title;
@ -787,12 +787,7 @@ AboutReader.prototype = {
*/ */
_getOriginalUrl: function(win) { _getOriginalUrl: function(win) {
let url = win ? win.location.href : this._win.location.href; let url = win ? win.location.href : this._win.location.href;
let searchParams = new URLSearchParams(url.split("?")[1]); return ReaderMode.getOriginalUrl(url) || url;
if (!searchParams.has("url")) {
Cu.reportError("Error finding original URL for about:reader URL: " + url);
return url;
}
return decodeURIComponent(searchParams.get("url"));
}, },
_setupSegmentedButton: function Reader_setupSegmentedButton(id, options, initialValue, callback) { _setupSegmentedButton: function Reader_setupSegmentedButton(id, options, initialValue, callback) {

View File

@ -67,6 +67,31 @@ this.ReaderMode = {
} }
}, },
/**
* Returns original URL from an about:reader URL.
*
* @param url An about:reader URL.
* @return The original URL for the article, or null if we did not find
* a properly formatted about:reader URL.
*/
getOriginalUrl: function(url) {
if (!url.startsWith("about:reader?")) {
return null;
}
let searchParams = new URLSearchParams(url.substring("about:reader?".length));
if (!searchParams.has("url")) {
return null;
}
let encodedURL = searchParams.get("url");
try {
return decodeURIComponent(encodedURL);
} catch (e) {
Cu.reportError("Error decoding original URL: " + e);
return encodedURL;
}
},
/** /**
* Decides whether or not a document is reader-able without parsing the whole thing. * Decides whether or not a document is reader-able without parsing the whole thing.
* *

View File

@ -84,11 +84,12 @@ this.AutoCompleteE10S = {
messageManager.addMessageListener("FormAutoComplete:ClosePopup", this); messageManager.addMessageListener("FormAutoComplete:ClosePopup", this);
}, },
_initPopup: function(browserWindow, rect) { _initPopup: function(browserWindow, rect, direction) {
this.browser = browserWindow.gBrowser.selectedBrowser; this.browser = browserWindow.gBrowser.selectedBrowser;
this.popup = this.browser.autoCompletePopup; this.popup = this.browser.autoCompletePopup;
this.popup.hidden = false; this.popup.hidden = false;
this.popup.setAttribute("width", rect.width); this.popup.setAttribute("width", rect.width);
this.popup.style.direction = direction;
this.x = rect.left; this.x = rect.left;
this.y = rect.top + rect.height; this.y = rect.top + rect.height;
@ -137,8 +138,9 @@ this.AutoCompleteE10S = {
search: function(message) { search: function(message) {
let browserWindow = message.target.ownerDocument.defaultView; let browserWindow = message.target.ownerDocument.defaultView;
let rect = message.data; let rect = message.data;
let direction = message.data.direction;
this._initPopup(browserWindow, rect); this._initPopup(browserWindow, rect, direction);
let formAutoComplete = Cc["@mozilla.org/satchel/form-autocomplete;1"] let formAutoComplete = Cc["@mozilla.org/satchel/form-autocomplete;1"]
.getService(Ci.nsIFormAutoComplete); .getService(Ci.nsIFormAutoComplete);

View File

@ -372,9 +372,10 @@ FormAutoCompleteChild.prototype = {
this.stopAutoCompleteSearch(); this.stopAutoCompleteSearch();
} }
let rect = BrowserUtils.getElementBoundingScreenRect(aField);
let window = aField.ownerDocument.defaultView; let window = aField.ownerDocument.defaultView;
let rect = BrowserUtils.getElementBoundingScreenRect(aField);
let direction = window.getComputedStyle(aField).direction;
let topLevelDocshell = window.QueryInterface(Ci.nsIInterfaceRequestor) let topLevelDocshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell) .getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem .sameTypeRootTreeItem
@ -389,7 +390,8 @@ FormAutoCompleteChild.prototype = {
left: rect.left, left: rect.left,
top: rect.top, top: rect.top,
width: rect.width, width: rect.width,
height: rect.height height: rect.height,
direction: direction,
}); });
let search = this._pendingSearch = {}; let search = this._pendingSearch = {};

View File

@ -0,0 +1,21 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
XPIDL_MODULE = 'update'
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
XPIDL_SOURCES += [
'nsIUpdateTimerManager.idl',
]
EXTRA_COMPONENTS += [
'nsUpdateTimerManager.js',
'nsUpdateTimerManager.manifest',
]
with Files('**'):
BUG_COMPONENT = ('Toolkit', 'Application Update')

View File

@ -471,11 +471,23 @@ let PinnedLinks = {
* Singleton that keeps track of all blocked links in the grid. * Singleton that keeps track of all blocked links in the grid.
*/ */
let BlockedLinks = { let BlockedLinks = {
/**
* A list of objects that are observing blocked link changes.
*/
_observers: [],
/** /**
* The cached list of blocked links. * The cached list of blocked links.
*/ */
_links: null, _links: null,
/**
* Registers an object that will be notified when the blocked links change.
*/
addObserver: function (aObserver) {
this._observers.push(aObserver);
},
/** /**
* The list of blocked links. * The list of blocked links.
*/ */
@ -487,10 +499,11 @@ let BlockedLinks = {
}, },
/** /**
* Blocks a given link. * Blocks a given link. Adjusts siteMap accordingly, and notifies listeners.
* @param aLink The link to block. * @param aLink The link to block.
*/ */
block: function BlockedLinks_block(aLink) { block: function BlockedLinks_block(aLink) {
this._callObservers("onLinkBlocked", aLink);
this.links[toHash(aLink.url)] = 1; this.links[toHash(aLink.url)] = 1;
this.save(); this.save();
@ -499,13 +512,14 @@ let BlockedLinks = {
}, },
/** /**
* Unblocks a given link. * Unblocks a given link. Adjusts siteMap accordingly, and notifies listeners.
* @param aLink The link to unblock. * @param aLink The link to unblock.
*/ */
unblock: function BlockedLinks_unblock(aLink) { unblock: function BlockedLinks_unblock(aLink) {
if (this.isBlocked(aLink)) { if (this.isBlocked(aLink)) {
delete this.links[toHash(aLink.url)]; delete this.links[toHash(aLink.url)];
this.save(); this.save();
this._callObservers("onLinkUnblocked", aLink);
} }
}, },
@ -537,6 +551,18 @@ let BlockedLinks = {
*/ */
resetCache: function BlockedLinks_resetCache() { resetCache: function BlockedLinks_resetCache() {
this._links = null; this._links = null;
},
_callObservers(methodName, ...args) {
for (let obs of this._observers) {
if (typeof(obs[methodName]) == "function") {
try {
obs[methodName](...args);
} catch (err) {
Cu.reportError(err);
}
}
}
} }
}; };
@ -719,6 +745,8 @@ let Links = {
* A mapping from each provider to an object { sortedLinks, siteMap, linkMap }. * A mapping from each provider to an object { sortedLinks, siteMap, linkMap }.
* sortedLinks is the cached, sorted array of links for the provider. * sortedLinks is the cached, sorted array of links for the provider.
* siteMap is a mapping from base domains to URL count associated with the domain. * siteMap is a mapping from base domains to URL count associated with the domain.
* The count does not include blocked URLs. siteMap is used to look up a
* user's top sites that can be targeted with a suggested tile.
* linkMap is a Map from link URLs to link objects. * linkMap is a Map from link URLs to link objects.
*/ */
_providers: new Map(), _providers: new Map(),
@ -737,6 +765,18 @@ let Links = {
*/ */
_populateCallbacks: [], _populateCallbacks: [],
/**
* A list of objects that are observing links updates.
*/
_observers: [],
/**
* Registers an object that will be notified when links updates.
*/
addObserver: function (aObserver) {
this._observers.push(aObserver);
},
/** /**
* Adds a link provider. * Adds a link provider.
* @param aProvider The link provider. * @param aProvider The link provider.
@ -861,11 +901,19 @@ let Links = {
}, },
_incrementSiteMap: function(map, link) { _incrementSiteMap: function(map, link) {
if (NewTabUtils.blockedLinks.isBlocked(link)) {
// Don't count blocked URLs.
return;
}
let site = NewTabUtils.extractSite(link.url); let site = NewTabUtils.extractSite(link.url);
map.set(site, (map.get(site) || 0) + 1); map.set(site, (map.get(site) || 0) + 1);
}, },
_decrementSiteMap: function(map, link) { _decrementSiteMap: function(map, link) {
if (NewTabUtils.blockedLinks.isBlocked(link)) {
// Blocked URLs are not included in map.
return;
}
let site = NewTabUtils.extractSite(link.url); let site = NewTabUtils.extractSite(link.url);
let previousURLCount = map.get(site); let previousURLCount = map.get(site);
if (previousURLCount === 1) { if (previousURLCount === 1) {
@ -875,6 +923,37 @@ let Links = {
} }
}, },
/**
* Update the siteMap cache based on the link given and whether we need
* to increment or decrement it. We do this by iterating over all stored providers
* to find which provider this link already exists in. For providers that
* have this link, we will adjust siteMap for them accordingly.
*
* @param aLink The link that will affect siteMap
* @param increment A boolean for whether to increment or decrement siteMap
*/
_adjustSiteMapAndNotify: function(aLink, increment=true) {
for (let [provider, cache] of this._providers) {
// We only update siteMap if aLink is already stored in linkMap.
if (cache.linkMap.get(aLink.url)) {
if (increment) {
this._incrementSiteMap(cache.siteMap, aLink);
continue;
}
this._decrementSiteMap(cache.siteMap, aLink);
}
}
this._callObservers("onLinkChanged", aLink);
},
onLinkBlocked: function(aLink) {
this._adjustSiteMapAndNotify(aLink, false);
},
onLinkUnblocked: function(aLink) {
this._adjustSiteMapAndNotify(aLink);
},
populateProviderCache: function(provider, callback) { populateProviderCache: function(provider, callback) {
if (!this._providers.has(provider)) { if (!this._providers.has(provider)) {
throw new Error("Can only populate provider cache for existing provider."); throw new Error("Can only populate provider cache for existing provider.");
@ -1095,6 +1174,18 @@ let Links = {
this.resetCache(); this.resetCache();
}, },
_callObservers(methodName, ...args) {
for (let obs of this._observers) {
if (typeof(obs[methodName]) == "function") {
try {
obs[methodName](this, ...args);
} catch (err) {
Cu.reportError(err);
}
}
}
},
/** /**
* Adds a sanitization observer and turns itself into a no-op after the first * Adds a sanitization observer and turns itself into a no-op after the first
* invokation. * invokation.
@ -1235,6 +1326,7 @@ this.NewTabUtils = {
if (this.initWithoutProviders()) { if (this.initWithoutProviders()) {
PlacesProvider.init(); PlacesProvider.init();
Links.addProvider(PlacesProvider); Links.addProvider(PlacesProvider);
BlockedLinks.addObserver(Links);
} }
}, },

View File

@ -23,10 +23,17 @@ DIRS += [
'webapps', 'webapps',
] ]
DIRS += ['mozapps/update'] if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
DIRS += ['mozapps/update']
if CONFIG['MOZ_MAINTENANCE_SERVICE']: if CONFIG['MOZ_MAINTENANCE_SERVICE']:
DIRS += ['components/maintenanceservice'] # Including mozapps/update/common-standalone allows the maintenance service
# to be built so the maintenance service can be used for things other than
# updating applications.
DIRS += [
'mozapps/update/common-standalone',
'components/maintenanceservice'
]
DIRS += ['xre'] DIRS += ['xre']
@ -61,6 +68,3 @@ with Files('mozapps/plugins/*'):
with Files('mozapps/preferences/*'): with Files('mozapps/preferences/*'):
BUG_COMPONENT = ('Toolkit', 'Preferences') BUG_COMPONENT = ('Toolkit', 'Preferences')
with Files('mozapps/update/*'):
BUG_COMPONENT = ('Toolkit', 'Application Update')

View File

@ -10,3 +10,5 @@ include('../common/sources.mozbuild')
if CONFIG['OS_ARCH'] == 'WINNT': if CONFIG['OS_ARCH'] == 'WINNT':
USE_STATIC_LIBS = True USE_STATIC_LIBS = True
FAIL_ON_WARNINGS = True

View File

@ -25,3 +25,5 @@ srcdir = '.'
include('sources.mozbuild') include('sources.mozbuild')
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
FAIL_ON_WARNINGS = True

View File

@ -4,47 +4,32 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
if CONFIG['MOZ_UPDATER'] or CONFIG['MOZ_MAINTENANCE_SERVICE']:
# If only the maintenance service is installed and not
# the updater, then the maintenance service may still be
# used for other things. We need to build update/common
# which the maintenance service uses.
DIRS += ['common']
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['common-standalone']
if CONFIG['MOZ_UPDATER']:
DIRS += ['updater']
XPIDL_MODULE = 'update' XPIDL_MODULE = 'update'
XPCSHELL_TESTS_MANIFESTS += ['tests/unit_timermanager/xpcshell.ini'] DIRS += [
'common',
'updater',
]
XPIDL_SOURCES += [ XPIDL_SOURCES += [
'nsIUpdateTimerManager.idl', 'nsIUpdateService.idl',
] ]
TEST_DIRS += ['tests']
EXTRA_COMPONENTS += [ EXTRA_COMPONENTS += [
'nsUpdateTimerManager.js',
'nsUpdateTimerManager.manifest',
]
if CONFIG['MOZ_UPDATER']:
TEST_DIRS += ['tests']
XPIDL_SOURCES += [
'nsIUpdateService.idl',
]
EXTRA_COMPONENTS += [
'nsUpdateService.js', 'nsUpdateService.js',
'nsUpdateService.manifest', 'nsUpdateService.manifest',
'nsUpdateServiceStub.js', 'nsUpdateServiceStub.js',
] ]
EXTRA_JS_MODULES += [ EXTRA_JS_MODULES += [
'UpdateTelemetry.jsm', 'UpdateTelemetry.jsm',
] ]
JAR_MANIFESTS += ['jar.mn'] JAR_MANIFESTS += ['jar.mn']
FAIL_ON_WARNINGS = True
with Files('**'):
BUG_COMPONENT = ('Toolkit', 'Application Update')

View File

@ -18,8 +18,6 @@ xpcshell-data_FILES := $(filter-out $(pp_const_file),$(wildcard $(srcdir)/data/
xpcshell-data_DEST := $(XPCSHELLTESTROOT)/data xpcshell-data_DEST := $(XPCSHELLTESTROOT)/data
xpcshell-data_TARGET := misc xpcshell-data_TARGET := misc
# Android doesn't use the Mozilla updater or the toolkit update UI
ifneq (android,$(MOZ_WIDGET_TOOLKIT))
ifndef MOZ_PROFILE_GENERATE ifndef MOZ_PROFILE_GENERATE
ifdef COMPILE_ENVIRONMENT ifdef COMPILE_ENVIRONMENT
INSTALL_TARGETS += xpcshell-helper INSTALL_TARGETS += xpcshell-helper
@ -47,11 +45,8 @@ INI_TEST_FILES = \
MOZ_WINCONSOLE = 1 MOZ_WINCONSOLE = 1
endif # Not Android
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
ifneq (android,$(MOZ_WIDGET_TOOLKIT))
# TestAUSReadStrings runs during check in the following directory with a Unicode # TestAUSReadStrings runs during check in the following directory with a Unicode
# char in order to test bug 473417 on Windows. # char in order to test bug 473417 on Windows.
ifeq ($(OS_ARCH),WINNT) ifeq ($(OS_ARCH),WINNT)
@ -67,4 +62,3 @@ check::
done done
$(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/ $(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/
@$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX) @$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX)
endif # Not Android

View File

@ -8,37 +8,35 @@ HAS_MISC_RULE = True
XPCSHELL_TESTS_MANIFESTS += ['unit_aus_update/xpcshell.ini'] XPCSHELL_TESTS_MANIFESTS += ['unit_aus_update/xpcshell.ini']
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android': MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini'] XPCSHELL_TESTS_MANIFESTS += ['unit_base_updater/xpcshell.ini']
XPCSHELL_TESTS_MANIFESTS += ['unit_base_updater/xpcshell.ini']
if CONFIG['MOZ_MAINTENANCE_SERVICE']: if CONFIG['MOZ_MAINTENANCE_SERVICE']:
XPCSHELL_TESTS_MANIFESTS += ['unit_service_updater/xpcshell.ini'] XPCSHELL_TESTS_MANIFESTS += ['unit_service_updater/xpcshell.ini']
SimplePrograms([ SimplePrograms([
'TestAUSHelper', 'TestAUSHelper',
'TestAUSReadStrings', 'TestAUSReadStrings',
]) ])
LOCAL_INCLUDES += [ LOCAL_INCLUDES += [
'/toolkit/mozapps/update', '/toolkit/mozapps/update',
'/toolkit/mozapps/update/common', '/toolkit/mozapps/update/common',
] ]
if CONFIG['OS_ARCH'] == 'WINNT': if CONFIG['OS_ARCH'] == 'WINNT':
USE_LIBS += [ USE_LIBS += [
'updatecommon-standalone', 'updatecommon-standalone',
] ]
else:
USE_LIBS += [
'updatecommon',
]
if CONFIG['OS_ARCH'] == 'WINNT':
OS_LIBS += [ OS_LIBS += [
'wintrust', 'wintrust',
'shlwapi', 'shlwapi',
] ]
else:
USE_LIBS += [
'updatecommon',
]
for var in ('MOZ_APP_NAME', 'MOZ_APP_BASENAME', 'MOZ_APP_DISPLAYNAME', for var in ('MOZ_APP_NAME', 'MOZ_APP_BASENAME', 'MOZ_APP_DISPLAYNAME',
'MOZ_APP_VENDOR', 'BIN_SUFFIX', 'MOZ_DEBUG'): 'MOZ_APP_VENDOR', 'BIN_SUFFIX', 'MOZ_DEBUG'):

View File

@ -5,7 +5,6 @@
[DEFAULT] [DEFAULT]
head = head_update.js head = head_update.js
tail = tail =
skip-if = toolkit == 'android'
[canCheckForAndCanApplyUpdates.js] [canCheckForAndCanApplyUpdates.js]
[urlConstruction.js] [urlConstruction.js]

View File

@ -9,7 +9,6 @@
[DEFAULT] [DEFAULT]
head = head_update.js head = head_update.js
tail = tail =
skip-if = toolkit == 'android'
[marSuccessComplete.js] [marSuccessComplete.js]
[marSuccessPartial.js] [marSuccessPartial.js]

View File

@ -10,3 +10,4 @@ updater_rel_path = '../'
NO_DIST_INSTALL = True NO_DIST_INSTALL = True
DEFINES['UPDATER_XPCSHELL_CERT'] = True DEFINES['UPDATER_XPCSHELL_CERT'] = True
include('../updater-common.build') include('../updater-common.build')
FAIL_ON_WARNINGS = True

View File

@ -6,13 +6,13 @@ toolkit.jar:
% skin global classic/1.0 %skin/classic/global/ % skin global classic/1.0 %skin/classic/global/
skin/classic/global/10pct_transparent_grey.png skin/classic/global/10pct_transparent_grey.png
skin/classic/global/50pct_transparent_grey.png skin/classic/global/50pct_transparent_grey.png
skin/classic/global/about.css (../../windows/global/about.css) skin/classic/global/about.css (../../shared/about.css)
skin/classic/global/aboutCache.css (../../windows/global/aboutCache.css) skin/classic/global/aboutCache.css (../../shared/aboutCache.css)
skin/classic/global/aboutCacheEntry.css (../../windows/global/aboutCacheEntry.css) skin/classic/global/aboutCacheEntry.css (../../shared/aboutCacheEntry.css)
skin/classic/global/aboutMemory.css (../../windows/global/aboutMemory.css) skin/classic/global/aboutMemory.css (../../shared/aboutMemory.css)
skin/classic/global/aboutReader.css (../../windows/global/aboutReader.css) skin/classic/global/aboutReader.css (../../shared/aboutReader.css)
skin/classic/global/aboutSupport.css (../../windows/global/aboutSupport.css) skin/classic/global/aboutSupport.css (../../shared/aboutSupport.css)
skin/classic/global/appPicker.css (../../windows/global/appPicker.css) skin/classic/global/appPicker.css (../../shared/appPicker.css)
skin/classic/global/arrow.css skin/classic/global/arrow.css
skin/classic/global/autocomplete.css skin/classic/global/autocomplete.css
skin/classic/global/button.css skin/classic/global/button.css

View File

@ -4,13 +4,13 @@
toolkit.jar: toolkit.jar:
% skin global classic/1.0 %skin/classic/global/ % skin global classic/1.0 %skin/classic/global/
skin/classic/global/about.css skin/classic/global/about.css (../../shared/about.css)
skin/classic/global/aboutCache.css skin/classic/global/aboutCache.css (../../shared/aboutCache.css)
skin/classic/global/aboutCacheEntry.css skin/classic/global/aboutCacheEntry.css (../../shared/aboutCacheEntry.css)
skin/classic/global/aboutMemory.css skin/classic/global/aboutMemory.css (../../shared/aboutMemory.css)
skin/classic/global/aboutReader.css skin/classic/global/aboutReader.css (../../shared/aboutReader.css)
skin/classic/global/aboutSupport.css skin/classic/global/aboutSupport.css (../../shared/aboutSupport.css)
skin/classic/global/appPicker.css skin/classic/global/appPicker.css (../../shared/appPicker.css)
skin/classic/global/arrow.css skin/classic/global/arrow.css
* skin/classic/global/autocomplete.css * skin/classic/global/autocomplete.css
skin/classic/global/button.css skin/classic/global/button.css

View File

@ -23,7 +23,9 @@
#include "nsAppRunner.h" #include "nsAppRunner.h"
#include "mozilla/AppData.h" #include "mozilla/AppData.h"
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
#include "nsUpdateDriver.h" #include "nsUpdateDriver.h"
#endif
#include "ProfileReset.h" #include "ProfileReset.h"
#ifdef MOZ_INSTRUMENT_EVENT_LOOP #ifdef MOZ_INSTRUMENT_EVENT_LOOP
@ -3718,7 +3720,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
} }
#endif #endif
#if defined(USE_MOZ_UPDATER) #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
// Check for and process any available updates // Check for and process any available updates
nsCOMPtr<nsIFile> updRoot; nsCOMPtr<nsIFile> updRoot;
bool persistent; bool persistent;

View File

@ -8,13 +8,11 @@
#define nsUpdateDriver_h__ #define nsUpdateDriver_h__
#include "nscore.h" #include "nscore.h"
#ifdef MOZ_UPDATER
#include "nsIUpdateService.h" #include "nsIUpdateService.h"
#include "nsIThread.h" #include "nsIThread.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsString.h" #include "nsString.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#endif
class nsIFile; class nsIFile;
@ -57,7 +55,6 @@ nsresult ProcessUpdates(nsIFile *greDir, nsIFile *appDir,
nsIFile *osApplyToDir = nullptr, nsIFile *osApplyToDir = nullptr,
ProcessType *pid = nullptr); ProcessType *pid = nullptr);
#ifdef MOZ_UPDATER
// The implementation of the update processor handles the task of loading the // The implementation of the update processor handles the task of loading the
// updater application for staging an update. // updater application for staging an update.
// XXX ehsan this is living in this file in order to make use of the existing // XXX ehsan this is living in this file in order to make use of the existing
@ -107,6 +104,4 @@ private:
nsCOMPtr<nsIThread> mProcessWatcher; nsCOMPtr<nsIThread> mProcessWatcher;
StagedUpdateInfo mInfo; StagedUpdateInfo mInfo;
}; };
#endif
#endif // nsUpdateDriver_h__ #endif // nsUpdateDriver_h__

View File

@ -44,6 +44,7 @@
#include "MediaCodec.h" #include "MediaCodec.h"
#include "SurfaceTexture.h" #include "SurfaceTexture.h"
#include "GLContextProvider.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::gfx; using namespace mozilla::gfx;
@ -821,6 +822,8 @@ AndroidBridge::OpenGraphicsLibraries()
ANativeWindow_setBuffersGeometry = (int (*)(void*, int, int, int)) dlsym(handle, "ANativeWindow_setBuffersGeometry"); ANativeWindow_setBuffersGeometry = (int (*)(void*, int, int, int)) dlsym(handle, "ANativeWindow_setBuffersGeometry");
ANativeWindow_lock = (int (*)(void*, void*, void*)) dlsym(handle, "ANativeWindow_lock"); ANativeWindow_lock = (int (*)(void*, void*, void*)) dlsym(handle, "ANativeWindow_lock");
ANativeWindow_unlockAndPost = (int (*)(void*))dlsym(handle, "ANativeWindow_unlockAndPost"); ANativeWindow_unlockAndPost = (int (*)(void*))dlsym(handle, "ANativeWindow_unlockAndPost");
ANativeWindow_getWidth = (int (*)(void*))dlsym(handle, "ANativeWindow_getWidth");
ANativeWindow_getHeight = (int (*)(void*))dlsym(handle, "ANativeWindow_getHeight");
// This is only available in Honeycomb and ICS. It was removed in Jelly Bean // This is only available in Honeycomb and ICS. It was removed in Jelly Bean
ANativeWindow_fromSurfaceTexture = (void* (*)(JNIEnv*, jobject))dlsym(handle, "ANativeWindow_fromSurfaceTexture"); ANativeWindow_fromSurfaceTexture = (void* (*)(JNIEnv*, jobject))dlsym(handle, "ANativeWindow_fromSurfaceTexture");
@ -1275,6 +1278,16 @@ AndroidBridge::ReleaseNativeWindow(void *window)
// have nothing to do here. We should probably ref it. // have nothing to do here. We should probably ref it.
} }
IntSize
AndroidBridge::GetNativeWindowSize(void* window)
{
if (!window || !ANativeWindow_getWidth || !ANativeWindow_getHeight) {
return IntSize(0, 0);
}
return IntSize(ANativeWindow_getWidth(window), ANativeWindow_getHeight(window));
}
void* void*
AndroidBridge::AcquireNativeWindowFromSurfaceTexture(JNIEnv* aEnv, jobject aSurfaceTexture) AndroidBridge::AcquireNativeWindowFromSurfaceTexture(JNIEnv* aEnv, jobject aSurfaceTexture)
{ {
@ -1508,7 +1521,9 @@ void AndroidBridge::SyncFrameMetrics(const ParentLayerPoint& aScrollOffset, floa
} }
AndroidBridge::AndroidBridge() AndroidBridge::AndroidBridge()
: mLayerClient(nullptr) : mLayerClient(nullptr),
mPresentationWindow(nullptr),
mPresentationSurface(nullptr)
{ {
} }
@ -2036,6 +2051,51 @@ AndroidBridge::RunDelayedUiThreadTasks()
return -1; return -1;
} }
void*
AndroidBridge::GetPresentationWindow()
{
return mPresentationWindow;
}
void
AndroidBridge::SetPresentationWindow(void* aPresentationWindow)
{
if (mPresentationWindow) {
const bool wasAlreadyPaused = nsWindow::IsCompositionPaused();
if (!wasAlreadyPaused) {
nsWindow::SchedulePauseComposition();
}
mPresentationWindow = aPresentationWindow;
if (mPresentationSurface) {
// destroy the egl surface!
// The compositor is paused so it should be okay to destroy
// the surface here.
mozilla::gl::GLContextProvider::DestroyEGLSurface(mPresentationSurface);
mPresentationSurface = nullptr;
}
if (!wasAlreadyPaused) {
nsWindow::ScheduleResumeComposition();
}
}
else {
mPresentationWindow = aPresentationWindow;
}
}
EGLSurface
AndroidBridge::GetPresentationSurface()
{
return mPresentationSurface;
}
void
AndroidBridge::SetPresentationSurface(EGLSurface aPresentationSurface)
{
mPresentationSurface = aPresentationSurface;
}
Object::LocalRef AndroidBridge::ChannelCreate(Object::Param stream) { Object::LocalRef AndroidBridge::ChannelCreate(Object::Param stream) {
JNIEnv* const env = GetJNIForThread(); JNIEnv* const env = GetJNIForThread();
auto rv = Object::LocalRef::Adopt(env, env->CallStaticObjectMethod( auto rv = Object::LocalRef::Adopt(env, env->CallStaticObjectMethod(

View File

@ -21,6 +21,7 @@
#include "nsIMIMEInfo.h" #include "nsIMIMEInfo.h"
#include "nsColor.h" #include "nsColor.h"
#include "gfxRect.h" #include "gfxRect.h"
#include "mozilla/gfx/Point.h"
#include "nsIAndroidBridge.h" #include "nsIAndroidBridge.h"
#include "nsIMobileMessageCallback.h" #include "nsIMobileMessageCallback.h"
@ -264,6 +265,7 @@ public:
void *AcquireNativeWindow(JNIEnv* aEnv, jobject aSurface); void *AcquireNativeWindow(JNIEnv* aEnv, jobject aSurface);
void ReleaseNativeWindow(void *window); void ReleaseNativeWindow(void *window);
mozilla::gfx::IntSize GetNativeWindowSize(void* window);
void *AcquireNativeWindowFromSurfaceTexture(JNIEnv* aEnv, jobject aSurface); void *AcquireNativeWindowFromSurfaceTexture(JNIEnv* aEnv, jobject aSurface);
void ReleaseNativeWindowForSurfaceTexture(void *window); void ReleaseNativeWindowForSurfaceTexture(void *window);
@ -426,6 +428,8 @@ protected:
int (* ANativeWindow_lock)(void *window, void *outBuffer, void *inOutDirtyBounds); int (* ANativeWindow_lock)(void *window, void *outBuffer, void *inOutDirtyBounds);
int (* ANativeWindow_unlockAndPost)(void *window); int (* ANativeWindow_unlockAndPost)(void *window);
int (* ANativeWindow_getWidth)(void * window);
int (* ANativeWindow_getHeight)(void * window);
int (* Surface_lock)(void* surface, void* surfaceInfo, void* region, bool block); int (* Surface_lock)(void* surface, void* surfaceInfo, void* region, bool block);
int (* Surface_unlockAndPost)(void* surface); int (* Surface_unlockAndPost)(void* surface);
@ -439,6 +443,15 @@ private:
public: public:
void PostTaskToUiThread(Task* aTask, int aDelayMs); void PostTaskToUiThread(Task* aTask, int aDelayMs);
int64_t RunDelayedUiThreadTasks(); int64_t RunDelayedUiThreadTasks();
void* GetPresentationWindow();
void SetPresentationWindow(void* aPresentationWindow);
EGLSurface GetPresentationSurface();
void SetPresentationSurface(EGLSurface aPresentationSurface);
private:
void* mPresentationWindow;
EGLSurface mPresentationSurface;
}; };
class AutoJNIClass { class AutoJNIClass {

View File

@ -811,6 +811,27 @@ cleanup:
return surfaceBits; return surfaceBits;
} }
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface(JNIEnv* jenv, jclass, jobject surface)
{
if (surface != NULL) {
void* window = AndroidBridge::Bridge()->AcquireNativeWindow(jenv, surface);
if (window) {
AndroidBridge::Bridge()->SetPresentationWindow(window);
}
}
}
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_removePresentationSurface(JNIEnv* jenv, jclass, jobject surface)
{
void* window = AndroidBridge::Bridge()->GetPresentationWindow();
if (window) {
AndroidBridge::Bridge()->SetPresentationWindow(nullptr);
AndroidBridge::Bridge()->ReleaseNativeWindow(window);
}
}
NS_EXPORT void JNICALL NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden(JNIEnv* jenv, jclass, jobject view) Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden(JNIEnv* jenv, jclass, jobject view)
{ {

View File

@ -2454,6 +2454,29 @@ nsWindow::ScheduleComposite()
} }
} }
bool
nsWindow::IsCompositionPaused()
{
return sCompositorPaused;
}
void
nsWindow::SchedulePauseComposition()
{
if (sCompositorParent) {
sCompositorParent->SchedulePauseOnCompositorThread();
sCompositorPaused = true;
}
}
void
nsWindow::ScheduleResumeComposition()
{
if (sCompositorParent && sCompositorParent->ScheduleResumeOnCompositorThread()) {
sCompositorPaused = false;
}
}
void void
nsWindow::ScheduleResumeComposition(int width, int height) nsWindow::ScheduleResumeComposition(int width, int height)
{ {

View File

@ -156,7 +156,10 @@ public:
static void SetCompositor(mozilla::layers::LayerManager* aLayerManager, static void SetCompositor(mozilla::layers::LayerManager* aLayerManager,
mozilla::layers::CompositorParent* aCompositorParent, mozilla::layers::CompositorParent* aCompositorParent,
mozilla::layers::CompositorChild* aCompositorChild); mozilla::layers::CompositorChild* aCompositorChild);
static bool IsCompositionPaused();
static void ScheduleComposite(); static void ScheduleComposite();
static void SchedulePauseComposition();
static void ScheduleResumeComposition();
static void ScheduleResumeComposition(int width, int height); static void ScheduleResumeComposition(int width, int height);
static void ForceIsFirstPaint(); static void ForceIsFirstPaint();
static float ComputeRenderIntegrity(); static float ComputeRenderIntegrity();