Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2014-05-28 14:48:41 +02:00
commit 4719cf159c
164 changed files with 6097 additions and 5646 deletions

View File

@ -78,14 +78,12 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
Services.prefs.setCharPref('general.useragent.locale', value); Services.prefs.setCharPref('general.useragent.locale', value);
let prefName = 'intl.accept_languages'; let prefName = 'intl.accept_languages';
if (Services.prefs.prefHasUserValue(prefName)) { let defaultBranch = Services.prefs.getDefaultBranch(null);
Services.prefs.clearUserPref(prefName);
}
let intl = ''; let intl = '';
try { try {
intl = Services.prefs.getComplexValue(prefName, intl = defaultBranch.getComplexValue(prefName,
Ci.nsIPrefLocalizedString).data; Ci.nsIPrefLocalizedString).data;
} catch(e) {} } catch(e) {}
// Bug 830782 - Homescreen is in English instead of selected locale after // Bug 830782 - Homescreen is in English instead of selected locale after
@ -474,6 +472,13 @@ SettingsListener.observe('debugger.remote-mode', false, function(value) {
#endif #endif
}); });
// If debug access to certified apps is allowed, we need to preserve system
// sources so that they are visible in the debugger.
let forbidCertified =
Services.prefs.getBoolPref('devtools.debugger.forbid-certified-apps');
Services.prefs.setBoolPref('javascript.options.discardSystemSource',
forbidCertified);
// =================== Device Storage ==================== // =================== Device Storage ====================
SettingsListener.observe('device.storage.writable.name', 'sdcard', function(value) { SettingsListener.observe('device.storage.writable.name', 'sdcard', function(value) {
if (Services.prefs.getPrefType('device.storage.writable.name') != Ci.nsIPrefBranch.PREF_STRING) { if (Services.prefs.getPrefType('device.storage.writable.name') != Ci.nsIPrefBranch.PREF_STRING) {

View File

@ -19,13 +19,13 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5688c04e38ceacb9069b6157db69b37beafab331"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5688c04e38ceacb9069b6157db69b37beafab331"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/> <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/> <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -17,10 +17,10 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->
@ -128,9 +128,9 @@
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/> <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="c3ee0c875393607430086f942950d1b3f496ab0e"/> <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="c3ee0c875393607430086f942950d1b3f496ab0e"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/> <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="acbdbe5196f06589da05c3bd1f14b27a6cae69c2"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="02f0cc39345c36689ea4bca436b789b38f5751e0"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/> <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="dd94b2e17a146cb782d71933d25dcaa9c060e6ce"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="dd94b2e17a146cb782d71933d25dcaa9c060e6ce"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="56e7fe044cb6a0ad689b96ad7a3636d65e769b34"/> <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/> <project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
</manifest> </manifest>

View File

@ -15,14 +15,14 @@
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1"> <project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<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="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/> <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/> <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

View File

@ -19,13 +19,13 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5688c04e38ceacb9069b6157db69b37beafab331"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5688c04e38ceacb9069b6157db69b37beafab331"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/> <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/> <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -15,13 +15,12 @@
<project name="platform_build" path="build" remote="b2g" revision="42c224f4304c10166739fd9e25b2db1036410bd8"> <project name="platform_build" path="build" remote="b2g" revision="42c224f4304c10166739fd9e25b2db1036410bd8">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->
@ -119,7 +118,7 @@
<!-- Flame specific things --> <!-- Flame specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="e8a318f7690092e639ba88891606f4183e846d3f"/> <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="e8a318f7690092e639ba88891606f4183e846d3f"/>
<project name="device/qcom/common" path="device/qcom/common" revision="34ed8345250bb97262d70a052217a92e83444ede"/> <project name="device/qcom/common" path="device/qcom/common" revision="34ed8345250bb97262d70a052217a92e83444ede"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="b99bd353c9a1e292a21e686f2d6b35aafa1d06ca"/> <project name="device-flame" path="device/t2m/flame" remote="b2g" revision="81eab0894a773fc0274b64432f1f49da95d63b7d"/>
<project name="kernel/msm" path="kernel" revision="228d59147ff524e90774c566eef03260cc6857b8"/> <project name="kernel/msm" path="kernel" revision="228d59147ff524e90774c566eef03260cc6857b8"/>
<project name="platform/bootable/recovery" path="bootable/recovery" revision="f2914eacee9120680a41463708bb6ee8291749fc"/> <project name="platform/bootable/recovery" path="bootable/recovery" revision="f2914eacee9120680a41463708bb6ee8291749fc"/>
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="81c4a859d75d413ad688067829d21b7ba9205f81"/> <project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="81c4a859d75d413ad688067829d21b7ba9205f81"/>
@ -141,7 +140,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/> <project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/> <project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/> <project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="56e7fe044cb6a0ad689b96ad7a3636d65e769b34"/> <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/> <project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/> <project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
</manifest> </manifest>

View File

@ -4,6 +4,6 @@
"remote": "", "remote": "",
"branch": "" "branch": ""
}, },
"revision": "a9c51a635e985bfa1a1448101e9763dd35426dfa", "revision": "f2274c0c94a989a204b03b693c73ed1414b0f543",
"repo_path": "/integration/gaia-central" "repo_path": "/integration/gaia-central"
} }

View File

@ -17,12 +17,12 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/> <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/> <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>

View File

@ -15,7 +15,7 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,12 +19,12 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/> <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/> <project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>

View File

@ -17,12 +17,12 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/> <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/> <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

View File

@ -17,10 +17,10 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->
@ -127,7 +127,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/> <project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/> <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/> <project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="56e7fe044cb6a0ad689b96ad7a3636d65e769b34"/> <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/> <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/> <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/> <project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

View File

@ -17,10 +17,10 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->
@ -127,7 +127,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/> <project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/> <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/> <project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="56e7fe044cb6a0ad689b96ad7a3636d65e769b34"/> <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/> <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/> <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/> <project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

View File

@ -17,12 +17,12 @@
<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="bc6f07c149770c6e6dfbea941ac65138dc364a15"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="389dee3293891002f825ea1d5d92283094b7d931"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="87ee480405c4a109c01f68dd64de625f1ff819d9"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="df6b6315b7217522ae03151449a841f0c382c888"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="ef8e1c9128ee14189263382788a7b6b06353a6e8"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/> <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/> <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

View File

@ -19,6 +19,8 @@ if CONFIG['MOZ_WEBAPP_RUNTIME']:
add_tier_dir('app', 'b2g/chrome') add_tier_dir('app', 'b2g/chrome')
add_tier_dir('app', 'b2g/components') add_tier_dir('app', 'b2g/components')
add_tier_dir('app', 'b2g/dev/app')
# Never add tier dirs after browser because they apparently won't get # Never add tier dirs after browser because they apparently won't get
# packaged properly on Mac. # packaged properly on Mac.
add_tier_dir('app', 'browser') add_tier_dir('app', 'browser')

5
b2g/dev/app/Makefile.in Normal file
View File

@ -0,0 +1,5 @@
# 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/.
PREF_JS_EXPORTS += $(topsrcdir)/b2g/app/b2g.js

View File

@ -627,7 +627,11 @@
; [Default Preferences] ; [Default Preferences]
; All the pref files must be part of base to prevent migration bugs ; All the pref files must be part of base to prevent migration bugs
#ifdef MOZ_MULET
@BINPATH@/defaults/pref/b2g.js
#else
@BINPATH@/@PREF_DIR@/b2g.js @BINPATH@/@PREF_DIR@/b2g.js
#endif
@BINPATH@/@PREF_DIR@/channel-prefs.js @BINPATH@/@PREF_DIR@/channel-prefs.js
@BINPATH@/greprefs.js @BINPATH@/greprefs.js
@BINPATH@/defaults/autoconfig/platform.js @BINPATH@/defaults/autoconfig/platform.js

View File

@ -7,10 +7,6 @@ dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME)
PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \ PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \
$(NULL) $(NULL)
ifdef MOZ_MULET
PREF_JS_EXPORTS += $(topsrcdir)/b2g/app/b2g.js
endif
# hardcode en-US for the moment # hardcode en-US for the moment
AB_CD = en-US AB_CD = en-US

View File

@ -1464,7 +1464,7 @@ pref("browser.newtabpage.rows", 3);
// number of columns of newtab grid // number of columns of newtab grid
pref("browser.newtabpage.columns", 3); pref("browser.newtabpage.columns", 3);
pref("browser.newtabpage.directorySource", "chrome://global/content/directoryLinks.json"); pref("browser.newtabpage.directory.source", "chrome://global/content/directoryLinks.json");
// Enable the DOM fullscreen API. // Enable the DOM fullscreen API.
pref("full-screen-api.enabled", true); pref("full-screen-api.enabled", true);

View File

@ -217,6 +217,7 @@ let gPage = {
} }
} }
DirectoryLinksProvider.reportShownCount(directoryCount);
// Record how many directory sites were shown, but place counts over the // Record how many directory sites were shown, but place counts over the
// default 9 in the same bucket // default 9 in the same bucket
for (let type of Object.keys(directoryCount)) { for (let type of Object.keys(directoryCount)) {

View File

@ -3337,11 +3337,8 @@
<handler event="overflow"><![CDATA[ <handler event="overflow"><![CDATA[
if (event.detail == 0) if (event.detail == 0)
return; // Ignore vertical events return; // Ignore vertical events
var tabs = document.getBindingParent(this);
var numberOfTabs = tabs.tabbrowser.visibleTabs.length;
if (numberOfTabs == 1)
return;
var tabs = document.getBindingParent(this);
tabs.setAttribute("overflow", "true"); tabs.setAttribute("overflow", "true");
tabs._positionPinnedTabs(); tabs._positionPinnedTabs();
tabs._handleTabSelect(false); tabs._handleTabSelect(false);
@ -3861,14 +3858,12 @@
TabsInTitlebar.updateAppearance(); TabsInTitlebar.updateAppearance();
if (this.tabbrowser.visibleTabs.length > 1) { var width = this.mTabstrip.boxObject.width;
var width = this.mTabstrip.boxObject.width; if (width != this.mTabstripWidth) {
if (width != this.mTabstripWidth) { this.adjustTabstrip();
this.adjustTabstrip(); this._fillTrailingGap();
this._fillTrailingGap(); this._handleTabSelect();
this._handleTabSelect(); this.mTabstripWidth = width;
this.mTabstripWidth = width;
}
} }
this.tabbrowser.updateWindowResizers(); this.tabbrowser.updateWindowResizers();

View File

@ -589,8 +589,7 @@ let gTests = [
expectObserverCalled("recording-window-ended"); expectObserverCalled("recording-window-ended");
} }
else { else {
let allow = (aAllowVideo && aRequestVideo) || (aAllowAudio && aRequestAudio); let expectedMessage = aExpectStream ? "ok" : "error: PERMISSION_DENIED";
let expectedMessage = allow ? "ok" : "error: PERMISSION_DENIED";
yield promiseMessage(expectedMessage, gum); yield promiseMessage(expectedMessage, gum);
if (expectedMessage == "ok") { if (expectedMessage == "ok") {
@ -635,9 +634,9 @@ let gTests = [
info("deny audio, allow video, request audio+video, expect ok (video)"); info("deny audio, allow video, request audio+video, expect ok (video)");
yield usePerm(false, true, true, true, true); yield usePerm(false, true, true, true, true);
info("deny audio, allow video, request audio, expect denied"); info("deny audio, allow video, request audio, expect denied");
yield usePerm(false, true, true, false, true); yield usePerm(false, true, true, false, false);
info("deny audio, allow video, request video, expect ok (video)"); info("deny audio, allow video, request video, expect ok (video)");
yield usePerm(false, true, false, true, false); yield usePerm(false, true, false, true, true);
// Allow audio, video not set. // Allow audio, video not set.
info("allow audio, request audio+video, expect prompt"); info("allow audio, request audio+video, expect prompt");

View File

@ -56,7 +56,7 @@ const EXPECTED_REFLOWS = [
]; ];
const PREF_PRELOAD = "browser.newtab.preload"; const PREF_PRELOAD = "browser.newtab.preload";
const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directorySource"; const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directory.source";
/* /*
* This test ensures that there are no unexpected * This test ensures that there are no unexpected
@ -64,26 +64,47 @@ const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directorySource";
*/ */
function test() { function test() {
waitForExplicitFinish(); waitForExplicitFinish();
let DirectoryLinksProvider = Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm", {}).DirectoryLinksProvider;
let Promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
// resolves promise when directory links are downloaded and written to disk
function watchLinksChangeOnce() {
let deferred = Promise.defer();
let observer = {
onManyLinksChanged: () => {
DirectoryLinksProvider.removeObserver(observer);
deferred.resolve();
}
};
observer.onDownloadFail = observer.onManyLinksChanged;
DirectoryLinksProvider.addObserver(observer);
return deferred.promise;
};
Services.prefs.setBoolPref(PREF_PRELOAD, false);
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, "data:application/json,{}");
registerCleanupFunction(() => { registerCleanupFunction(() => {
Services.prefs.clearUserPref(PREF_PRELOAD); Services.prefs.clearUserPref(PREF_PRELOAD);
Services.prefs.clearUserPref(PREF_NEWTAB_DIRECTORYSOURCE); Services.prefs.clearUserPref(PREF_NEWTAB_DIRECTORYSOURCE);
return watchLinksChangeOnce();
}); });
// Add a reflow observer and open a new tab. // run tests when directory source change completes
docShell.addWeakReflowObserver(observer); watchLinksChangeOnce().then(() => {
BrowserOpenTab(); // Add a reflow observer and open a new tab.
docShell.addWeakReflowObserver(observer);
BrowserOpenTab();
// Wait until the tabopen animation has finished. // Wait until the tabopen animation has finished.
waitForTransitionEnd(function () { waitForTransitionEnd(function () {
// Remove reflow observer and clean up. // Remove reflow observer and clean up.
docShell.removeWeakReflowObserver(observer); docShell.removeWeakReflowObserver(observer);
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
finish();
finish(); });
}); });
Services.prefs.setBoolPref(PREF_PRELOAD, false);
// set directory source to empty links
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, "data:application/json,{}");
} }
let observer = { let observer = {

View File

@ -2,20 +2,19 @@
http://creativecommons.org/publicdomain/zero/1.0/ */ http://creativecommons.org/publicdomain/zero/1.0/ */
const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled"; const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled";
const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directorySource"; const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directory.source";
Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, true); Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, true);
// start with no directory links by default
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, "data:application/json,{}");
let tmp = {}; let tmp = {};
Cu.import("resource://gre/modules/Promise.jsm", tmp); Cu.import("resource://gre/modules/Promise.jsm", tmp);
Cu.import("resource://gre/modules/NewTabUtils.jsm", tmp); Cu.import("resource://gre/modules/NewTabUtils.jsm", tmp);
Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm", tmp);
Cc["@mozilla.org/moz/jssubscript-loader;1"] Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader) .getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://browser/content/sanitize.js", tmp); .loadSubScript("chrome://browser/content/sanitize.js", tmp);
Cu.import("resource://gre/modules/Timer.jsm", tmp); Cu.import("resource://gre/modules/Timer.jsm", tmp);
let {Promise, NewTabUtils, Sanitizer, clearTimeout} = tmp; let {Promise, NewTabUtils, Sanitizer, clearTimeout, DirectoryLinksProvider} = tmp;
let uri = Services.io.newURI("about:newtab", null, null); let uri = Services.io.newURI("about:newtab", null, null);
let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri); let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
@ -60,22 +59,45 @@ registerCleanupFunction(function () {
if (oldInnerHeight) if (oldInnerHeight)
gBrowser.contentWindow.innerHeight = oldInnerHeight; gBrowser.contentWindow.innerHeight = oldInnerHeight;
Services.prefs.clearUserPref(PREF_NEWTAB_ENABLED);
Services.prefs.clearUserPref(PREF_NEWTAB_DIRECTORYSOURCE);
// Stop any update timers to prevent unexpected updates in later tests // Stop any update timers to prevent unexpected updates in later tests
let timer = NewTabUtils.allPages._scheduleUpdateTimeout; let timer = NewTabUtils.allPages._scheduleUpdateTimeout;
if (timer) { if (timer) {
clearTimeout(timer); clearTimeout(timer);
delete NewTabUtils.allPages._scheduleUpdateTimeout; delete NewTabUtils.allPages._scheduleUpdateTimeout;
} }
Services.prefs.clearUserPref(PREF_NEWTAB_ENABLED);
Services.prefs.clearUserPref(PREF_NEWTAB_DIRECTORYSOURCE);
return watchLinksChangeOnce();
}); });
/**
* Resolves promise when directory links are downloaded and written to disk
*/
function watchLinksChangeOnce() {
let deferred = Promise.defer();
let observer = {
onManyLinksChanged: () => {
DirectoryLinksProvider.removeObserver(observer);
deferred.resolve();
}
};
observer.onDownloadFail = observer.onManyLinksChanged;
DirectoryLinksProvider.addObserver(observer);
return deferred.promise;
};
/** /**
* Provide the default test function to start our test runner. * Provide the default test function to start our test runner.
*/ */
function test() { function test() {
TestRunner.run(); waitForExplicitFinish();
// start TestRunner.run() after directory links is downloaded and written to disk
watchLinksChangeOnce().then(() => {
TestRunner.run();
});
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, "data:application/json,{}");
} }
/** /**
@ -86,8 +108,6 @@ let TestRunner = {
* Starts the test runner. * Starts the test runner.
*/ */
run: function () { run: function () {
waitForExplicitFinish();
this._iter = runTests(); this._iter = runTests();
this.next(); this.next();
}, },

View File

@ -18,6 +18,7 @@ PARALLEL_DIRS += [
'shell', 'shell',
'sidebar', 'sidebar',
'tabview', 'tabview',
'translation',
'migration', 'migration',
] ]

View File

@ -63,7 +63,7 @@ function test() {
is(gBrowser.tabs.length, preTabNo, "Return key did not open new tab"); is(gBrowser.tabs.length, preTabNo, "Return key did not open new tab");
is(event.originalTarget, preSelectedBrowser.contentDocument, is(event.originalTarget, preSelectedBrowser.contentDocument,
"Return key loaded results in current tab"); "Return key loaded results in current tab");
is(event.originalTarget.URL, expectedURL(searchBar.value), "Check URL of search page opened"); is(event.originalTarget.URL, expectedURL(searchBar.value), "testReturn opened correct search page");
testAltReturn(); testAltReturn();
}); });
@ -79,7 +79,7 @@ function test() {
"Alt+Return key loaded results in new tab"); "Alt+Return key loaded results in new tab");
is(event.originalTarget, gBrowser.contentDocument, is(event.originalTarget, gBrowser.contentDocument,
"Alt+Return key loaded results in foreground tab"); "Alt+Return key loaded results in foreground tab");
is(event.originalTarget.URL, expectedURL(searchBar.value), "Check URL of search page opened"); is(event.originalTarget.URL, expectedURL(searchBar.value), "testAltReturn opened correct search page");
//Shift key has no effect for now, so skip it //Shift key has no effect for now, so skip it
//testShiftAltReturn(); //testShiftAltReturn();
@ -97,7 +97,7 @@ function test() {
"Shift+Alt+Return key loaded results in new tab"); "Shift+Alt+Return key loaded results in new tab");
isnot(event.originalTarget, gBrowser.contentDocument, isnot(event.originalTarget, gBrowser.contentDocument,
"Shift+Alt+Return key loaded results in background tab"); "Shift+Alt+Return key loaded results in background tab");
is(event.originalTarget.URL, expectedURL(searchBar.value), "Check URL of search page opened"); is(event.originalTarget.URL, expectedURL(searchBar.value), "testShiftAltReturn opened correct search page");
testLeftClick(); testLeftClick();
}); });
@ -111,7 +111,7 @@ function test() {
is(gBrowser.tabs.length, preTabNo, "LeftClick did not open new tab"); is(gBrowser.tabs.length, preTabNo, "LeftClick did not open new tab");
is(event.originalTarget, preSelectedBrowser.contentDocument, is(event.originalTarget, preSelectedBrowser.contentDocument,
"LeftClick loaded results in current tab"); "LeftClick loaded results in current tab");
is(event.originalTarget.URL, expectedURL(searchBar.value), "Check URL of search page opened"); is(event.originalTarget.URL, expectedURL(searchBar.value), "testLeftClick opened correct search page");
testMiddleClick(); testMiddleClick();
}); });
@ -127,7 +127,7 @@ function test() {
"MiddleClick loaded results in new tab"); "MiddleClick loaded results in new tab");
is(event.originalTarget, gBrowser.contentDocument, is(event.originalTarget, gBrowser.contentDocument,
"MiddleClick loaded results in foreground tab"); "MiddleClick loaded results in foreground tab");
is(event.originalTarget.URL, expectedURL(searchBar.value), "Check URL of search page opened"); is(event.originalTarget.URL, expectedURL(searchBar.value), "testMiddleClick opened correct search page");
testShiftMiddleClick(); testShiftMiddleClick();
}); });
@ -143,7 +143,7 @@ function test() {
"Shift+MiddleClick loaded results in new tab"); "Shift+MiddleClick loaded results in new tab");
isnot(event.originalTarget, gBrowser.contentDocument, isnot(event.originalTarget, gBrowser.contentDocument,
"Shift+MiddleClick loaded results in background tab"); "Shift+MiddleClick loaded results in background tab");
is(event.originalTarget.URL, expectedURL(searchBar.value), "Check URL of search page opened"); is(event.originalTarget.URL, expectedURL(searchBar.value), "testShiftMiddleClick opened correct search page");
testDropText(); testDropText();
}); });

View File

@ -7,14 +7,17 @@
Components.utils.import("resource:///modules/translation/Translation.jsm"); Components.utils.import("resource:///modules/translation/Translation.jsm");
const kLanguagesPref = "browser.translation.neverForLanguages"; const kLanguagesPref = "browser.translation.neverForLanguages";
const kShowUIPref = "browser.translation.ui.show";
function test() { function test() {
waitForExplicitFinish(); waitForExplicitFinish();
Services.prefs.setBoolPref(kShowUIPref, true);
let tab = gBrowser.addTab(); let tab = gBrowser.addTab();
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
registerCleanupFunction(function () { registerCleanupFunction(function () {
gBrowser.removeTab(tab); gBrowser.removeTab(tab);
Services.prefs.clearUserPref(kShowUIPref);
}); });
tab.linkedBrowser.addEventListener("load", function onload() { tab.linkedBrowser.addEventListener("load", function onload() {
tab.linkedBrowser.removeEventListener("load", onload, true); tab.linkedBrowser.removeEventListener("load", onload, true);

View File

@ -6,6 +6,8 @@
Components.utils.import("resource:///modules/translation/Translation.jsm"); Components.utils.import("resource:///modules/translation/Translation.jsm");
const kShowUIPref = "browser.translation.ui.show";
function waitForCondition(condition, nextTest, errorMsg) { function waitForCondition(condition, nextTest, errorMsg) {
var tries = 0; var tries = 0;
var interval = setInterval(function() { var interval = setInterval(function() {
@ -68,6 +70,7 @@ function hasTranslationInfoBar() {
function test() { function test() {
waitForExplicitFinish(); waitForExplicitFinish();
Services.prefs.setBoolPref(kShowUIPref, true);
let tab = gBrowser.addTab(); let tab = gBrowser.addTab();
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
tab.linkedBrowser.addEventListener("load", function onload() { tab.linkedBrowser.addEventListener("load", function onload() {
@ -75,6 +78,7 @@ function test() {
TranslationStub.browser = gBrowser.selectedBrowser; TranslationStub.browser = gBrowser.selectedBrowser;
registerCleanupFunction(function () { registerCleanupFunction(function () {
gBrowser.removeTab(tab); gBrowser.removeTab(tab);
Services.prefs.clearUserPref(kShowUIPref);
}); });
run_tests(() => { run_tests(() => {
finish(); finish();

View File

@ -73,15 +73,17 @@ WebappsStore.prototype = {
_listTabs: function() { _listTabs: function() {
this._connection.client.listTabs((resp) => { this._connection.client.listTabs((resp) => {
this._webAppsActor = resp.webappsActor; this._webAppsActor = resp.webappsActor;
this._feedStore(); this._feedStore().then(() => {
this.emit("store-ready");
});
}); });
}, },
_feedStore: function(deviceFront, webAppsActor) { _feedStore: function() {
this._listenToApps(); this._listenToApps();
this._getAllApps() return this._getAllApps()
.then(this._getRunningApps.bind(this)) .then(this._getRunningApps.bind(this))
.then(this._getAppsIcons.bind(this)) .then(this._getAppsIcons.bind(this))
}, },
_listenToApps: function() { _listenToApps: function() {

View File

@ -37,7 +37,6 @@ const SPECTRUM_FRAME = "chrome://browser/content/devtools/spectrum-frame.xhtml";
const ESCAPE_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE; const ESCAPE_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE;
const RETURN_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_RETURN; const RETURN_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_RETURN;
const POPUP_EVENTS = ["shown", "hidden", "showing", "hiding"]; const POPUP_EVENTS = ["shown", "hidden", "showing", "hiding"];
const FONT_FAMILY_PREVIEW_TEXT = "(ABCabc123&@%)";
/** /**
* Tooltip widget. * Tooltip widget.
@ -636,7 +635,9 @@ Tooltip.prototype = {
* it was resized, if if was resized before this function was called. * it was resized, if if was resized before this function was called.
* If not provided, will be measured on the loaded image. * If not provided, will be measured on the loaded image.
* - maxDim : if the image should be resized before being shown, pass * - maxDim : if the image should be resized before being shown, pass
* a number here * a number here.
* - hideDimensionLabel : if the dimension label should be appended
* after the image.
*/ */
setImageContent: function(imageUrl, options={}) { setImageContent: function(imageUrl, options={}) {
if (!imageUrl) { if (!imageUrl) {
@ -656,25 +657,28 @@ Tooltip.prototype = {
} }
vbox.appendChild(image); vbox.appendChild(image);
// Dimension label if (!options.hideDimensionLabel) {
let label = this.doc.createElement("label"); let label = this.doc.createElement("label");
label.classList.add("devtools-tooltip-caption"); label.classList.add("devtools-tooltip-caption");
label.classList.add("theme-comment"); label.classList.add("theme-comment");
if (options.naturalWidth && options.naturalHeight) {
label.textContent = this._getImageDimensionLabel(options.naturalWidth, if (options.naturalWidth && options.naturalHeight) {
options.naturalHeight); label.textContent = this._getImageDimensionLabel(options.naturalWidth,
} else { options.naturalHeight);
// If no dimensions were provided, load the image to get them } else {
label.textContent = l10n.strings.GetStringFromName("previewTooltip.image.brokenImage"); // If no dimensions were provided, load the image to get them
let imgObj = new this.doc.defaultView.Image(); label.textContent = l10n.strings.GetStringFromName("previewTooltip.image.brokenImage");
imgObj.src = imageUrl; let imgObj = new this.doc.defaultView.Image();
imgObj.onload = () => { imgObj.src = imageUrl;
imgObj.onload = null; imgObj.onload = () => {
label.textContent = this._getImageDimensionLabel(imgObj.naturalWidth, imgObj.onload = null;
imgObj.naturalHeight); label.textContent = this._getImageDimensionLabel(imgObj.naturalWidth,
imgObj.naturalHeight);
}
} }
vbox.appendChild(label);
} }
vbox.appendChild(label);
this.content = vbox; this.content = vbox;
}, },
@ -777,26 +781,30 @@ Tooltip.prototype = {
* This is based on Lea Verou's Dablet. See https://github.com/LeaVerou/dabblet * This is based on Lea Verou's Dablet. See https://github.com/LeaVerou/dabblet
* for more info. * for more info.
* @param {String} font The font family value. * @param {String} font The font family value.
* @param {object} nodeFront
* The NodeActor that will used to retrieve the dataURL for the font
* family tooltip contents.
* @return A promise that resolves when the font tooltip content is ready, or
* rejects if no font is provided
*/ */
setFontFamilyContent: function(font) { setFontFamilyContent: Task.async(function*(font, nodeFront) {
if (!font) { if (!font || !nodeFront) {
return; throw "Missing font";
} }
// Main container if (typeof nodeFront.getFontFamilyDataURL === "function") {
let vbox = this.doc.createElement("vbox"); font = font.replace(/"/g, "'");
vbox.setAttribute("flex", "1"); font = font.replace("!important", "");
font = font.trim();
// Display the font family previewer let fillStyle = (Services.prefs.getCharPref("devtools.theme") === "light") ?
let previewer = this.doc.createElement("description"); "black" : "white";
previewer.setAttribute("flex", "1");
previewer.style.fontFamily = font;
previewer.classList.add("devtools-tooltip-font-previewer-text");
previewer.textContent = FONT_FAMILY_PREVIEW_TEXT;
vbox.appendChild(previewer);
this.content = vbox; let {data, size} = yield nodeFront.getFontFamilyDataURL(font, fillStyle);
} let str = yield data.string();
this.setImageContent(str, { hideDimensionLabel: true, maxDim: size });
}
})
}; };
/** /**

View File

@ -545,8 +545,12 @@ CssHtmlTree.prototype = {
// Test for font family // Test for font family
if (propName.textContent === "font-family") { if (propName.textContent === "font-family") {
this.tooltip.setFontFamilyContent(propValue.textContent); let prop = propValue.textContent.toLowerCase();
return true;
if (prop !== "inherit" && prop !== "unset" && prop !== "initial") {
return this.tooltip.setFontFamilyContent(propValue.textContent,
inspector.selection.nodeFront);
}
} }
} }

View File

@ -1212,8 +1212,12 @@ CssRuleView.prototype = {
return this.previewTooltip.setRelativeImageContent(uri, this.inspector.inspector, dim); return this.previewTooltip.setRelativeImageContent(uri, this.inspector.inspector, dim);
} }
if (tooltipType === "font") { if (tooltipType === "font") {
this.previewTooltip.setFontFamilyContent(target.textContent); let prop = target.textContent.toLowerCase();
return true;
if (prop !== "inherit" && prop !== "unset" && prop !== "initial") {
return this.previewTooltip.setFontFamilyContent(target.textContent,
this.inspector.selection.nodeFront);
}
} }
return false; return false;

View File

@ -29,15 +29,15 @@ let test = asyncTest(function*() {
info("Selecting the test node"); info("Selecting the test node");
yield selectNode("#testElement", inspector); yield selectNode("#testElement", inspector);
yield testRuleView(view); yield testRuleView(view, inspector.selection.nodeFront);
info("Opening the computed view"); info("Opening the computed view");
let {toolbox, inspector, view} = yield openComputedView(); let {toolbox, inspector, view} = yield openComputedView();
yield testComputedView(view); yield testComputedView(view, inspector.selection.nodeFront);
}); });
function* testRuleView(ruleView) { function* testRuleView(ruleView, nodeFront) {
info("Testing font-family tooltips in the rule view"); info("Testing font-family tooltips in the rule view");
let panel = ruleView.previewTooltip.panel; let panel = ruleView.previewTooltip.panel;
@ -52,11 +52,15 @@ function* testRuleView(ruleView) {
// And verify that the tooltip gets shown on this property // And verify that the tooltip gets shown on this property
yield assertHoverTooltipOn(ruleView.previewTooltip, valueSpan); yield assertHoverTooltipOn(ruleView.previewTooltip, valueSpan);
let description = panel.getElementsByTagName("description")[0]; let images = panel.getElementsByTagName("image");
is(description.style.fontFamily, "cursive", "Tooltips contains correct font-family style"); is(images.length, 1, "Tooltip contains an image");
ok(images[0].getAttribute("src").startsWith("data:"), "Tooltip contains a data-uri image as expected");
let dataURL = yield getFontFamilyDataURL(valueSpan.textContent, nodeFront);
is(images[0].getAttribute("src"), dataURL, "Tooltip contains the correct data-uri image");
} }
function* testComputedView(computedView) { function* testComputedView(computedView, nodeFront) {
info("Testing font-family tooltips in the computed view"); info("Testing font-family tooltips in the computed view");
let panel = computedView.tooltip.panel; let panel = computedView.tooltip.panel;
@ -64,6 +68,10 @@ function* testComputedView(computedView) {
yield assertHoverTooltipOn(computedView.tooltip, valueSpan); yield assertHoverTooltipOn(computedView.tooltip, valueSpan);
let description = panel.getElementsByTagName("description")[0]; let images = panel.getElementsByTagName("image");
is(description.style.fontFamily, "cursive", "Tooltips contains correct font-family style"); is(images.length, 1, "Tooltip contains an image");
ok(images[0].getAttribute("src").startsWith("data:"), "Tooltip contains a data-uri image as expected");
let dataURL = yield getFontFamilyDataURL(valueSpan.textContent, nodeFront);
is(images[0].getAttribute("src"), dataURL, "Tooltip contains the correct data-uri image");
} }

View File

@ -27,15 +27,15 @@ let test = asyncTest(function*() {
info("Selecting the test node"); info("Selecting the test node");
yield selectNode("#testElement", inspector); yield selectNode("#testElement", inspector);
yield testRuleView(view); yield testRuleView(view, inspector.selection.nodeFront);
info("Opening the computed view"); info("Opening the computed view");
let {toolbox, inspector, view} = yield openComputedView(); let {toolbox, inspector, view} = yield openComputedView();
yield testComputedView(view); yield testComputedView(view, inspector.selection.nodeFront);
}); });
function* testRuleView(ruleView) { function* testRuleView(ruleView, nodeFront) {
info("Testing font-family tooltips in the rule view"); info("Testing font-family tooltips in the rule view");
let panel = ruleView.previewTooltip.panel; let panel = ruleView.previewTooltip.panel;
@ -55,11 +55,15 @@ function* testRuleView(ruleView) {
// And verify that the tooltip gets shown on this property // And verify that the tooltip gets shown on this property
yield assertHoverTooltipOn(ruleView.previewTooltip, valueSpan); yield assertHoverTooltipOn(ruleView.previewTooltip, valueSpan);
let description = panel.getElementsByTagName("description")[0]; let images = panel.getElementsByTagName("image");
is(description.style.fontFamily, "Arial", "Tooltips contains correct font-family style"); is(images.length, 1, "Tooltip contains an image");
ok(images[0].getAttribute("src").startsWith("data:"), "Tooltip contains a data-uri image as expected");
let dataURL = yield getFontFamilyDataURL(valueSpan.textContent, nodeFront);
is(images[0].getAttribute("src"), dataURL, "Tooltip contains the correct data-uri image");
} }
function* testComputedView(computedView) { function* testComputedView(computedView, nodeFront) {
info("Testing font-family tooltips in the computed view"); info("Testing font-family tooltips in the computed view");
let panel = computedView.tooltip.panel; let panel = computedView.tooltip.panel;
@ -67,6 +71,10 @@ function* testComputedView(computedView) {
yield assertHoverTooltipOn(computedView.tooltip, valueSpan); yield assertHoverTooltipOn(computedView.tooltip, valueSpan);
let description = panel.getElementsByTagName("description")[0]; let images = panel.getElementsByTagName("image");
is(description.style.fontFamily, "Arial", "Tooltips contains correct font-family style"); is(images.length, 1, "Tooltip contains an image");
ok(images[0].getAttribute("src").startsWith("data:"), "Tooltip contains a data-uri image as expected");
let dataURL = yield getFontFamilyDataURL(valueSpan.textContent, nodeFront);
is(images[0].getAttribute("src"), dataURL, "Tooltip contains the correct data-uri image");
} }

View File

@ -468,6 +468,22 @@ function hasSideBarTab(inspector, id) {
return !!inspector.sidebar.getWindowForTab(id); return !!inspector.sidebar.getWindowForTab(id);
} }
/**
* Get the dataURL for the font family tooltip.
* @param {String} font The font family value.
* @param {object} nodeFront
* The NodeActor that will used to retrieve the dataURL for the
* font family tooltip contents.
*/
let getFontFamilyDataURL = Task.async(function*(font, nodeFront) {
let fillStyle = (Services.prefs.getCharPref("devtools.theme") === "light") ?
"black" : "white";
let {data} = yield nodeFront.getFontFamilyDataURL(font, fillStyle);
let dataURL = yield data.string();
return dataURL;
});
/* ********************************************* /* *********************************************
* RULE-VIEW * RULE-VIEW
* ********************************************* * *********************************************

Binary file not shown.

View File

@ -5,11 +5,14 @@ support-files =
doc_simple-context.html doc_simple-context.html
doc_complex-context.html doc_complex-context.html
doc_simple-node-creation.html doc_simple-node-creation.html
doc_buffer-and-array.html
440hz_sine.ogg
head.js head.js
[browser_audionode-actor-get-set-param.js] [browser_audionode-actor-get-set-param.js]
[browser_audionode-actor-get-type.js] [browser_audionode-actor-get-type.js]
[browser_audionode-actor-get-params.js] [browser_audionode-actor-get-params-01.js]
[browser_audionode-actor-get-params-02.js]
[browser_audionode-actor-get-param-flags.js] [browser_audionode-actor-get-param-flags.js]
[browser_audionode-actor-is-source.js] [browser_audionode-actor-is-source.js]
[browser_webaudio-actor-simple.js] [browser_webaudio-actor-simple.js]
@ -20,9 +23,13 @@ support-files =
[browser_wa_graph-render-01.js] [browser_wa_graph-render-01.js]
[browser_wa_graph-render-02.js] [browser_wa_graph-render-02.js]
[browser_wa_graph-markers.js] [browser_wa_graph-markers.js]
[browser_wa_graph-selected.js]
[browser_wa_properties-view.js]
[browser_wa_properties-view-edit.js]
[browser_wa_inspector.js] [browser_wa_inspector.js]
[browser_wa_inspector-toggle.js] [browser_wa_inspector-toggle.js]
[browser_wa_properties-view.js]
# [browser_wa_properties-view-edit.js]
# Disabled for too many intermittents bug 1010423
[browser_wa_properties-view-params.js]
[browser_wa_properties-view-params-objects.js]

View File

@ -23,12 +23,7 @@ function spawnTest () {
nodeTypes.forEach((type, i) => { nodeTypes.forEach((type, i) => {
let params = allNodeParams[i]; let params = allNodeParams[i];
params.forEach(({param, value, flags}) => { params.forEach(({param, value, flags}) => {
ok(~NODE_PROPERTIES[type].indexOf(param), "expected parameter for " + type); ok(param in NODE_DEFAULT_VALUES[type], "expected parameter for " + type);
// Skip over some properties that are undefined by default
if (!/buffer|loop|smoothing|curve|cone/.test(param)) {
ok(value != undefined, param + " is not undefined");
}
ok(typeof flags === "object", type + " has a flags object"); ok(typeof flags === "object", type + " has a flags object");

View File

@ -0,0 +1,45 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that default properties are returned with the correct type
* from the AudioNode actors.
*/
function spawnTest() {
let [target, debuggee, front] = yield initBackend(SIMPLE_NODES_URL);
let [_, nodes] = yield Promise.all([
front.setup({ reload: true }),
getN(front, "create-node", 14)
]);
let allParams = yield Promise.all(nodes.map(node => node.getParams()));
let types = [
"AudioDestinationNode", "AudioBufferSourceNode", "ScriptProcessorNode",
"AnalyserNode", "GainNode", "DelayNode", "BiquadFilterNode", "WaveShaperNode",
"PannerNode", "ConvolverNode", "ChannelSplitterNode", "ChannelMergerNode",
"DynamicsCompressorNode", "OscillatorNode"
];
allParams.forEach((params, i) => {
compare(params, NODE_DEFAULT_VALUES[types[i]], types[i]);
});
yield removeTab(target.tab);
finish();
}
function compare (actual, expected, type) {
actual.forEach(({ value, param }) => {
value = getGripValue(value);
if (typeof expected[param] === "function") {
ok(expected[param](value), type + " has a passing value for " + param);
}
else {
ise(value, expected[param], type + " has correct default value and type for " + param);
}
});
is(actual.length, Object.keys(expected).length,
type + " has correct amount of properties.");
}

View File

@ -20,7 +20,8 @@ function spawnTest () {
ise(type, "sine", "AudioNode:getParam correctly fetches non-AudioParam"); ise(type, "sine", "AudioNode:getParam correctly fetches non-AudioParam");
let type = yield oscNode.getParam("not-a-valid-param"); let type = yield oscNode.getParam("not-a-valid-param");
is(type, undefined, "AudioNode:getParam correctly returns false for invalid param"); ok(type.type === "undefined",
"AudioNode:getParam correctly returns a grip value for `undefined` for an invalid param.");
let resSuccess = yield oscNode.setParam("frequency", 220); let resSuccess = yield oscNode.setParam("frequency", 220);
let freq = yield oscNode.getParam("frequency"); let freq = yield oscNode.getParam("frequency");

View File

@ -52,21 +52,3 @@ function spawnTest() {
yield teardown(panel); yield teardown(panel);
finish(); finish();
} }
function clickGraphNode (panelWin, el, waitForToggle = false) {
let { promise, resolve } = Promise.defer();
let promises = [
once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET)
];
if (waitForToggle) {
promises.push(once(panelWin, EVENTS.UI_INSPECTOR_TOGGLED));
}
// Use `el` as the element if it is one, otherwise
// assume it's an ID and find the related graph node
let element = el.tagName ? el : findGraphNode(panelWin, el);
click(panelWin, element);
return Promise.all(promises);
}

View File

@ -0,0 +1,52 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that SVG nodes and edges were created for the Graph View.
*/
function spawnTest() {
let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
let started = once(gFront, "start-context");
reload(target);
let [actors] = yield Promise.all([
get3(gFront, "create-node"),
waitForGraphRendered(panelWin, 3, 2)
]);
let [destId, oscId, gainId] = actors.map(actor => actor.actorID);
ok(!findGraphNode(panelWin, destId).classList.contains("selected"),
"No nodes selected on start. (destination)");
ok(!findGraphNode(panelWin, oscId).classList.contains("selected"),
"No nodes selected on start. (oscillator)");
ok(!findGraphNode(panelWin, gainId).classList.contains("selected"),
"No nodes selected on start. (gain)");
yield clickGraphNode(panelWin, oscId);
ok(findGraphNode(panelWin, oscId).classList.contains("selected"),
"Selected node has class 'selected'.");
ok(!findGraphNode(panelWin, destId).classList.contains("selected"),
"Non-selected nodes do not have class 'selected'.");
ok(!findGraphNode(panelWin, gainId).classList.contains("selected"),
"Non-selected nodes do not have class 'selected'.");
yield clickGraphNode(panelWin, gainId);
ok(!findGraphNode(panelWin, oscId).classList.contains("selected"),
"Previously selected node no longer has class 'selected'.");
ok(!findGraphNode(panelWin, destId).classList.contains("selected"),
"Non-selected nodes do not have class 'selected'.");
ok(findGraphNode(panelWin, gainId).classList.contains("selected"),
"Newly selected node now has class 'selected'.");
yield teardown(panel);
finish();
}

View File

@ -31,7 +31,7 @@ function spawnTest() {
let setAndCheck = setAndCheckVariable(panelWin, gVars); let setAndCheck = setAndCheckVariable(panelWin, gVars);
checkVariableView(gVars, 0, { checkVariableView(gVars, 0, {
"type": "\"sine\"", "type": "sine",
"frequency": 440, "frequency": 440,
"detune": 0 "detune": 0
}, "default loaded string"); }, "default loaded string");
@ -44,7 +44,7 @@ function spawnTest() {
click(panelWin, findGraphNode(panelWin, nodeIds[1])); click(panelWin, findGraphNode(panelWin, nodeIds[1]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET); yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);
yield setAndCheck(0, "type", "square", "\"square\"", "sets string as string"); yield setAndCheck(0, "type", "square", "square", "sets string as string");
click(panelWin, findGraphNode(panelWin, nodeIds[2])); click(panelWin, findGraphNode(panelWin, nodeIds[2]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET); yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);

View File

@ -0,0 +1,39 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that params view correctly displays non-primitive properties
* like AudioBuffer and Float32Array in properties of AudioNodes.
*/
function spawnTest() {
let [target, debuggee, panel] = yield initWebAudioEditor(BUFFER_AND_ARRAY_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, WebAudioInspectorView } = panelWin;
let gVars = WebAudioInspectorView._propsView;
let started = once(gFront, "start-context");
reload(target);
let [actors] = yield Promise.all([
getN(gFront, "create-node", 3),
waitForGraphRendered(panelWin, 3, 2)
]);
let nodeIds = actors.map(actor => actor.actorID);
click(panelWin, findGraphNode(panelWin, nodeIds[2]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);
checkVariableView(gVars, 0, {
"curve": "Float32Array"
}, "WaveShaper's `curve` is listed as an `Float32Array`.");
click(panelWin, findGraphNode(panelWin, nodeIds[1]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);
checkVariableView(gVars, 0, {
"buffer": "AudioBuffer"
}, "AudioBufferSourceNode's `buffer` is listed as an `AudioBuffer`.");
yield teardown(panel);
finish();
}

View File

@ -0,0 +1,39 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that params view correctly displays all properties for nodes
* correctly, with default values and correct types.
*/
function spawnTest() {
let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_NODES_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, WebAudioInspectorView } = panelWin;
let gVars = WebAudioInspectorView._propsView;
let started = once(gFront, "start-context");
reload(target);
let [actors] = yield Promise.all([
getN(gFront, "create-node", 14),
waitForGraphRendered(panelWin, 14, 0)
]);
let nodeIds = actors.map(actor => actor.actorID);
let types = [
"AudioDestinationNode", "AudioBufferSourceNode", "ScriptProcessorNode",
"AnalyserNode", "GainNode", "DelayNode", "BiquadFilterNode", "WaveShaperNode",
"PannerNode", "ConvolverNode", "ChannelSplitterNode", "ChannelMergerNode",
"DynamicsCompressorNode", "OscillatorNode"
];
for (let i = 0; i < types.length; i++) {
click(panelWin, findGraphNode(panelWin, nodeIds[i]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);
checkVariableView(gVars, 0, NODE_DEFAULT_VALUES[types[i]], types[i]);
}
yield teardown(panel);
finish();
}

View File

@ -0,0 +1,56 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Web Audio Editor test page</title>
</head>
<body>
<script type="text/javascript;version=1.8">
"use strict";
let audioURL = "http://example.com/browser/browser/devtools/webaudioeditor/test/440hz_sine.ogg";
let ctx = new AudioContext();
let bufferNode = ctx.createBufferSource();
let shaperNode = ctx.createWaveShaper();
shaperNode.curve = generateWaveShapingCurve();
let xhr = getBuffer(audioURL, () => {
ctx.decodeAudioData(xhr.response, (buffer) => {
bufferNode.buffer = buffer;
bufferNode.connect(shaperNode);
shaperNode.connect(ctx.destination);
});
});
function generateWaveShapingCurve() {
let frames = 65536;
let curve = new Float32Array(frames);
let n = frames;
let n2 = n / 2;
for (let i = 0; i < n; ++i) {
let x = (i - n2) / n2;
let y = Math.atan(5 * x) / (0.5 * Math.PI);
}
return curve;
}
function getBuffer (url, callback) {
let xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "arraybuffer";
xhr.onload = callback;
xhr.send();
return xhr;
}
</script>
</body>
</html>

View File

@ -24,6 +24,7 @@ const EXAMPLE_URL = "http://example.com/browser/browser/devtools/webaudioeditor/
const SIMPLE_CONTEXT_URL = EXAMPLE_URL + "doc_simple-context.html"; const SIMPLE_CONTEXT_URL = EXAMPLE_URL + "doc_simple-context.html";
const COMPLEX_CONTEXT_URL = EXAMPLE_URL + "doc_complex-context.html"; const COMPLEX_CONTEXT_URL = EXAMPLE_URL + "doc_complex-context.html";
const SIMPLE_NODES_URL = EXAMPLE_URL + "doc_simple-node-creation.html"; const SIMPLE_NODES_URL = EXAMPLE_URL + "doc_simple-node-creation.html";
const BUFFER_AND_ARRAY_URL = EXAMPLE_URL + "doc_buffer-and-array.html";
// All tests are asynchronous. // All tests are asynchronous.
waitForExplicitFinish(); waitForExplicitFinish();
@ -219,8 +220,23 @@ function checkVariableView (view, index, hash, description = "") {
let aVar = scope.get(variable); let aVar = scope.get(variable);
is(aVar.target.querySelector(".name").getAttribute("value"), variable, is(aVar.target.querySelector(".name").getAttribute("value"), variable,
"Correct property name for " + variable); "Correct property name for " + variable);
is(aVar.target.querySelector(".value").getAttribute("value"), hash[variable], let value = aVar.target.querySelector(".value").getAttribute("value");
"Correct property value of " + hash[variable] + " for " + variable + " " + description);
// Cast value with JSON.parse if possible;
// will fail when displaying Object types like "ArrayBuffer"
// and "Float32Array", but will match the original value.
try {
value = JSON.parse(value);
}
catch (e) {}
if (typeof hash[variable] === "function") {
ok(hash[variable](value),
"Passing property value of " + value + " for " + variable + " " + description);
}
else {
ise(value, hash[variable],
"Correct property value of " + hash[variable] + " for " + variable + " " + description);
}
}); });
} }
@ -292,23 +308,116 @@ function wait (n) {
return promise; return promise;
} }
/**
* Clicks a graph node based on actorID or passing in an element.
* Returns a promise that resolves once
* UI_INSPECTOR_NODE_SET is fired.
*/
function clickGraphNode (panelWin, el, waitForToggle = false) {
let { promise, resolve } = Promise.defer();
let promises = [
once(panelWin, panelWin.EVENTS.UI_INSPECTOR_NODE_SET)
];
if (waitForToggle) {
promises.push(once(panelWin, panelWin.EVENTS.UI_INSPECTOR_TOGGLED));
}
// Use `el` as the element if it is one, otherwise
// assume it's an ID and find the related graph node
let element = el.tagName ? el : findGraphNode(panelWin, el);
click(panelWin, element);
return Promise.all(promises);
}
/**
* Returns the primitive value of a grip's value, or the
* original form that the string grip.type comes from.
*/
function getGripValue (value) {
if (~["boolean", "string", "number"].indexOf(typeof value)) {
return value;
}
switch (value.type) {
case "undefined": return undefined;
case "Infinity": return Infinity;
case "-Infinity": return -Infinity;
case "NaN": return NaN;
case "-0": return -0;
case "null": return null;
default: return value;
}
}
/** /**
* List of audio node properties to test against expectations of the AudioNode actor * List of audio node properties to test against expectations of the AudioNode actor
*/ */
const NODE_PROPERTIES = { const NODE_DEFAULT_VALUES = {
"OscillatorNode": ["type", "frequency", "detune"], "AudioDestinationNode": {},
"GainNode": ["gain"], "AudioBufferSourceNode": {
"DelayNode": ["delayTime"], "playbackRate": 1,
"AudioBufferSourceNode": ["buffer", "playbackRate", "loop", "loopStart", "loopEnd"], "loop": false,
"ScriptProcessorNode": ["bufferSize"], "loopStart": 0,
"PannerNode": ["panningModel", "distanceModel", "refDistance", "maxDistance", "rolloffFactor", "coneInnerAngle", "coneOuterAngle", "coneOuterGain"], "loopEnd": 0,
"ConvolverNode": ["buffer", "normalize"], "buffer": null
"DynamicsCompressorNode": ["threshold", "knee", "ratio", "reduction", "attack", "release"], },
"BiquadFilterNode": ["type", "frequency", "Q", "detune", "gain"], "ScriptProcessorNode": {
"WaveShaperNode": ["curve", "oversample"], "bufferSize": 4096
"AnalyserNode": ["fftSize", "minDecibels", "maxDecibels", "smoothingTimeConstraint", "frequencyBinCount"], },
"AudioDestinationNode": [], "AnalyserNode": {
"ChannelSplitterNode": [], "fftSize": 2048,
"ChannelMergerNode": [] "minDecibels": -100,
"maxDecibels": -30,
"smoothingTimeConstant": 0.8,
"frequencyBinCount": 1024
},
"GainNode": {
"gain": 1
},
"DelayNode": {
"delayTime": 0
},
"BiquadFilterNode": {
"type": "lowpass",
"frequency": 350,
"Q": 1,
"detune": 0,
"gain": 0
},
"WaveShaperNode": {
"curve": null,
"oversample": "none"
},
"PannerNode": {
"panningModel": "HRTF",
"distanceModel": "inverse",
"refDistance": 1,
"maxDistance": 10000,
"rolloffFactor": 1,
"coneInnerAngle": 360,
"coneOuterAngle": 360,
"coneOuterGain": 0
},
"ConvolverNode": {
"buffer": null,
"normalize": true
},
"ChannelSplitterNode": {},
"ChannelMergerNode": {},
"DynamicsCompressorNode": {
"threshold": -24,
"knee": 30,
"ratio": 12,
"reduction": 0,
"attack": 0.003000000026077032,
"release": 0.25
},
"OscillatorNode": {
"type": "sine",
"frequency": 440,
"detune": 0
}
}; };

View File

@ -52,11 +52,13 @@ let WebAudioGraphView = {
initialize: function() { initialize: function() {
this._onGraphNodeClick = this._onGraphNodeClick.bind(this); this._onGraphNodeClick = this._onGraphNodeClick.bind(this);
this._onThemeChange = this._onThemeChange.bind(this); this._onThemeChange = this._onThemeChange.bind(this);
this._onNodeSelect = this._onNodeSelect.bind(this);
this.draw = debounce(this.draw.bind(this), GRAPH_DEBOUNCE_TIMER); this.draw = debounce(this.draw.bind(this), GRAPH_DEBOUNCE_TIMER);
$('#graph-target').addEventListener('click', this._onGraphNodeClick, false); $('#graph-target').addEventListener('click', this._onGraphNodeClick, false);
window.on(EVENTS.THEME_CHANGE, this._onThemeChange); window.on(EVENTS.THEME_CHANGE, this._onThemeChange);
window.on(EVENTS.UI_INSPECTOR_NODE_SET, this._onNodeSelect);
}, },
/** /**
@ -68,6 +70,7 @@ let WebAudioGraphView = {
} }
$('#graph-target').removeEventListener('click', this._onGraphNodeClick, false); $('#graph-target').removeEventListener('click', this._onGraphNodeClick, false);
window.off(EVENTS.THEME_CHANGE, this._onThemeChange); window.off(EVENTS.THEME_CHANGE, this._onThemeChange);
window.off(EVENTS.UI_INSPECTOR_NODE_SET, this._onNodeSelect);
}, },
/** /**
@ -101,20 +104,18 @@ let WebAudioGraphView = {
}, },
/** /**
* Makes the corresponding graph node appear "focused", called from WebAudioParamView * Makes the corresponding graph node appear "focused", removing
* focused styles from all other nodes. If no `actorID` specified,
* make all nodes appear unselected.
* Called from UI_INSPECTOR_NODE_SELECT.
*/ */
focusNode: function (actorID) { focusNode: function (actorID) {
// Remove class "selected" from all nodes // Remove class "selected" from all nodes
Array.prototype.forEach.call($$(".nodes > g"), $node => $node.classList.remove("selected")); Array.forEach($$(".nodes > g"), $node => $node.classList.remove("selected"));
// Add to "selected" // Add to "selected"
this._getNodeByID(actorID).classList.add("selected"); if (actorID) {
}, this._getNodeByID(actorID).classList.add("selected");
}
/**
* Unfocuses the corresponding graph node, called from WebAudioParamView
*/
blurNode: function (actorID) {
this._getNodeByID(actorID).classList.remove("selected");
}, },
/** /**
@ -234,6 +235,10 @@ let WebAudioGraphView = {
* Event handlers * Event handlers
*/ */
_onNodeSelect: function (eventName, id) {
this.focusNode(id);
},
/** /**
* Fired when the devtools theme changes. * Fired when the devtools theme changes.
*/ */

View File

@ -0,0 +1,10 @@
# -*- 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/.
EXTRA_COMPONENTS += [
'webideCli.js',
'webideComponents.manifest',
]

View File

@ -0,0 +1,81 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
/**
* Handles -webide command line option.
*
* See webide/content/cli.js for a complete description of the command line.
*/
function webideCli() { }
webideCli.prototype = {
handle: function(cmdLine) {
let param;
try {
// Returns null if -webide is not present
// Throws if -webide is present with no params
param = cmdLine.handleFlagWithParam("webide", false);
if (!param) {
return;
}
} catch(e) {
// -webide is present with no params
cmdLine.handleFlag("webide", false);
}
// If -webide is used remotely, we don't want to open
// a new tab.
//
// If -webide is used for a new Firefox instance, we
// want to open webide only.
cmdLine.preventDefault = true;
let win = Services.wm.getMostRecentWindow("devtools:webide");
if (win) {
win.focus();
if (param) {
win.handleCommandline(param);
}
return;
}
win = Services.ww.openWindow(null,
"chrome://webide/content/",
"webide",
"chrome,centerscreen,resizable,dialog=no",
null);
if (param) {
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, true);
// next tick
win.setTimeout(() => win.handleCommandline(param), 0);
}, true);
}
if (cmdLine.state == Ci.nsICommandLine.STATE_INITIAL_LAUNCH) {
// If this is a new Firefox instance, and because we will only start
// webide, we need to notify "sessionstore-windows-restored" to trigger
// addons registration (for simulators and adb helper).
Services.obs.notifyObservers(null, "sessionstore-windows-restored", "");
}
},
helpInfo : "",
classID: Components.ID("{79b7b44e-de5e-4e4c-b7a2-044003c615d9}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([webideCli]);

View File

@ -0,0 +1,4 @@
# webide components
component {79b7b44e-de5e-4e4c-b7a2-044003c615d9} webideCli.js
contract @mozilla.org/browser/webide-clh;1 {79b7b44e-de5e-4e4c-b7a2-044003c615d9}
category command-line-handler a-webide @mozilla.org/browser/webide-clh;1

View File

@ -0,0 +1,198 @@
/* 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/. */
/**
*
* SYNOPSIS
* firefox --webide [OPTIONS]
*
* DESCRIPTION
* Starts WebIDE (aka App Manager). If Firefox has already started, opens
* the WebIDE window. If Firefox is not running, no browser window will
* be open.
*
* It's recommended to add the option `-jsconsole` to see potential errors
* occurring while processing the parameters.
*
* OPTIONS
* A set of "key=value" pairs, separated by '&'.
*
* actions=action1,action2,...,actionN
* Executed in order. actionN will be executed only if actionN-1 doesn't fail.
* Available actions:
* addPackagedApp: Import and select app ('location' parameter must be a directory)
* addHostedApp: Import and select app ('location' parameter must be a URL)
* connectToRuntime: Connect to runtime (require 'runtimeType')
* play: Start or reload selected app on connected runtime
* debug: Debug selected app or debug 'appID'
*
* location
* packaged app directory or hosted app manifest URL
*
* runtimeType
* Type of runtime to connect to. "usb" or "simulator"
*
* runtimeID
* Which runtime to use. By default, the most recent USB device or most recent simulator
*
* appID
* App on runtime
*
* EXAMPLES
*
* $ firefox --webide "actions=addPackagedApp,connectToRuntime,play,debug&location=/home/bob/Downloads/foobar/&runtimeType=usb"
* Select app located in /home/bob/Downloads/foobar, then
* Connect to USB device, then
* Install app, then
* Start developer tools connected to the running app
*
*/
window.handleCommandline = function(cmdline) {
console.log("External query", cmdline);
let params = new Map();
for (let token of cmdline.split("&")) {
token = token.split("=");
params.set(token[0], token[1]);
}
if (params.has("actions")) {
return UI.busyUntil(Task.spawn(function* () {
let actions = params.get("actions").split(",");
for (let action of actions) {
if (action in CliActions) {
console.log("External query - running action", action);
yield CliActions[action].call(window, params);
} else {
console.log("External query - unknown action", action);
}
}
}), "Computing command line");
} else {
return promise.reject("No actions provided");
}
}
let CliActions = {
addPackagedApp: function(params) {
return Task.spawn(function* () {
let location = params.get("location");
if (!location) {
throw new Error("No location parameter");
}
yield AppProjects.load();
// Normalize location
let directory = new FileUtils.File(location);
if (AppProjects.get(directory.path)) {
// Already imported
return;
}
yield Cmds.importPackagedApp(location);
})
},
addHostedApp: function(params) {
return Task.spawn(function* () {
let location = params.get("location");
if (!location) {
throw new Error("No location parameter");
}
yield AppProjects.load();
if (AppProjects.get(location)) {
// Already imported
return;
}
yield Cmds.importHostedApp(location);
})
},
debug: function(params) {
return Task.spawn(function* () {
let appID = params.get("appID");
if (appID) {
let appToSelect;
for (let i = 0; i < AppManager.webAppsStore.object.all.length; i++) {
let app = AppManager.webAppsStore.object.all[i];
if (app.manifestURL == appID) {
appToSelect = app;
break;
}
}
if (!appToSelect) {
throw new Error("App not found on device");
}
AppManager.selectedProject = {
type: "runtimeApp",
app: appToSelect,
icon: appToSelect.iconURL,
name: appToSelect.name
};
}
UI.closeToolbox();
yield Cmds.toggleToolbox();
});
},
connectToRuntime: function(params) {
return Task.spawn(function* () {
let type = params.get("runtimeType");
if (type != "usb" && type != "simulator") {
return promise.reject("Unkown runtime type");
}
yield Cmds.disconnectRuntime();
if (AppManager.runtimeList[type].length == 0) {
let deferred = promise.defer();
function onRuntimeListUpdate(event, what) {
if (AppManager.runtimeList[type].length > 0) {
deferred.resolve();
}
}
let timeout = setTimeout(deferred.resolve, 3000);
AppManager.on("app-manager-update", onRuntimeListUpdate);
yield deferred.promise;
AppManager.off("app-manager-update", onRuntimeListUpdate);
clearTimeout(timeout);
}
let runtime;
let runtimeID = params.get("runtimeID");
if (runtimeID) {
for (let r of AppManager.runtimeList[type]) {
if (r.getID() == runtimeID) {
runtime = r;
break;
}
}
} else {
let list = AppManager.runtimeList[type];
runtime = list[list.length - 1];
}
if (!runtime) {
return promise.reject("Can't find any runtime to connect to");
}
let deferred = promise.defer();
// store-ready is fired when the list of installed apps has been
// received by the webAppsStore.
AppManager.webAppsStore.once("store-ready", deferred.resolve);
UI.connectToRuntime(runtime).then(null, deferred.reject);
return deferred.promise;
})
},
play: function(params) {
return Task.spawn(function* () {
yield Cmds.play();
})
},
}

View File

@ -83,7 +83,10 @@ function updateUI() {
document.querySelector("#type").classList.remove("hidden"); document.querySelector("#type").classList.remove("hidden");
if (project.type == "runtimeApp") { if (project.type == "runtimeApp") {
let manifest = AppManager.getProjectManifestURL(project);
document.querySelector("#type").textContent = manifest.type || "web"; document.querySelector("#type").textContent = manifest.type || "web";
document.querySelector("#manifestURLHeader").classList.remove("hidden");
document.querySelector("#manifestURL").textContent = manifest;
} else { } else {
document.querySelector("#type").textContent = project.type + " " + (manifest.type || "web"); document.querySelector("#type").textContent = project.type + " " + (manifest.type || "web");
} }

View File

@ -3,13 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
webide.jar: webide.jar:
% content webide %content/ % content webide %content/
content/webide.xul (webide.xul) content/webide.xul (webide.xul)
content/webide.js (webide.js) content/webide.js (webide.js)
content/newapp.xul (newapp.xul) content/newapp.xul (newapp.xul)
content/newapp.js (newapp.js) content/newapp.js (newapp.js)
content/details.xhtml (details.xhtml) content/details.xhtml (details.xhtml)
content/details.js (details.js) content/details.js (details.js)
content/cli.js (cli.js)
# Temporarily include locales in content, until we're ready # Temporarily include locales in content, until we're ready
# to localize webide # to localize webide

View File

@ -20,6 +20,11 @@ const {AppManager} = require("devtools/app-manager");
let gTemplateList = null; let gTemplateList = null;
// See bug 989619
console.log = console.log.bind(console);
console.warn = console.warn.bind(console);
console.error = console.error.bind(console);
window.addEventListener("load", function onLoad() { window.addEventListener("load", function onLoad() {
window.removeEventListener("load", onLoad); window.removeEventListener("load", onLoad);
let projectNameNode = document.querySelector("#project-name"); let projectNameNode = document.querySelector("#project-name");

View File

@ -24,6 +24,11 @@ const Strings = Services.strings.createBundle("chrome://webide/content/webide.pr
const HTML = "http://www.w3.org/1999/xhtml"; const HTML = "http://www.w3.org/1999/xhtml";
const HELP_URL = "https://developer.mozilla.org/Firefox_OS/Using_the_App_Manager#Troubleshooting"; const HELP_URL = "https://developer.mozilla.org/Firefox_OS/Using_the_App_Manager#Troubleshooting";
// See bug 989619
console.log = console.log.bind(console);
console.warn = console.warn.bind(console);
console.error = console.error.bind(console);
window.addEventListener("load", function onLoad() { window.addEventListener("load", function onLoad() {
window.removeEventListener("load", onLoad); window.removeEventListener("load", onLoad);
UI.init(); UI.init();
@ -50,19 +55,19 @@ let UI = {
this.onfocus = this.onfocus.bind(this); this.onfocus = this.onfocus.bind(this);
window.addEventListener("focus", this.onfocus, true); window.addEventListener("focus", this.onfocus, true);
try { AppProjects.load().then(() => {
let lastProjectLocation = Services.prefs.getCharPref("devtools.webide.lastprojectlocation"); let lastProjectLocation = Services.prefs.getCharPref("devtools.webide.lastprojectlocation");
AppProjects.load().then(() => { if (lastProjectLocation) {
let lastProject = AppProjects.get(lastProjectLocation); let lastProject = AppProjects.get(lastProjectLocation);
if (lastProject) { if (lastProject) {
AppManager.selectedProject = lastProject; AppManager.selectedProject = lastProject;
} else { } else {
AppManager.selectedProject = null; AppManager.selectedProject = null;
} }
}); } else {
} catch(e) { AppManager.selectedProject = null;
AppManager.selectedProject = null; }
} });
}, },
uninit: function() { uninit: function() {
@ -144,6 +149,7 @@ let UI = {
}, },
busy: function() { busy: function() {
this.hidePanels();
document.querySelector("window").classList.add("busy") document.querySelector("window").classList.add("busy")
this.updateCommands(); this.updateCommands();
}, },
@ -157,7 +163,6 @@ let UI = {
// Freeze the UI until the promise is resolved. A 30s timeout // Freeze the UI until the promise is resolved. A 30s timeout
// will unfreeze the UI, just in case the promise never gets // will unfreeze the UI, just in case the promise never gets
// resolved. // resolved.
this.hidePanels();
let timeout = setTimeout(() => { let timeout = setTimeout(() => {
this.unbusy(); this.unbusy();
UI.reportError("error_operationTimeout", operationDescription); UI.reportError("error_operationTimeout", operationDescription);

View File

@ -24,6 +24,7 @@
persist="screenX screenY width height"> persist="screenX screenY width height">
<script type="application/javascript" src="webide.js"></script> <script type="application/javascript" src="webide.js"></script>
<script type="application/javascript" src="cli.js"></script>
<commandset id="mainCommandSet"> <commandset id="mainCommandSet">
<commandset id="editMenuCommands"/> <commandset id="editMenuCommands"/>

View File

@ -18,6 +18,8 @@ const {AppValidator} = require("devtools/app-manager/app-validator");
const {ConnectionManager, Connection} = require("devtools/client/connection-manager"); const {ConnectionManager, Connection} = require("devtools/client/connection-manager");
const AppActorFront = require("devtools/app-actor-front"); const AppActorFront = require("devtools/app-actor-front");
const {getDeviceFront} = require("devtools/server/actors/device"); const {getDeviceFront} = require("devtools/server/actors/device");
const {setTimeout} = require("sdk/timers");
const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
const Strings = Services.strings.createBundle("chrome://webide/content/webide.properties"); const Strings = Services.strings.createBundle("chrome://webide/content/webide.properties");
@ -34,7 +36,10 @@ exports.AppManager = AppManager = {
this.connection = ConnectionManager.createConnection("localhost", port); this.connection = ConnectionManager.createConnection("localhost", port);
this.onConnectionChanged = this.onConnectionChanged.bind(this); this.onConnectionChanged = this.onConnectionChanged.bind(this);
this.connection.on(Connection.Events.STATUS_CHANGED, this.onConnectionChanged); this.connection.on(Connection.Events.STATUS_CHANGED, this.onConnectionChanged);
this.onWebAppsStoreready = this.onWebAppsStoreready.bind(this);
this.webAppsStore = new WebappsStore(this.connection); this.webAppsStore = new WebappsStore(this.connection);
this.webAppsStore.on("store-ready", this.onWebAppsStoreready);
this.runtimeList = {usb: [], simulator: []}; this.runtimeList = {usb: [], simulator: []};
this.trackUSBRuntimes(); this.trackUSBRuntimes();
@ -49,9 +54,10 @@ exports.AppManager = AppManager = {
this.untrackSimulatorRuntimes(); this.untrackSimulatorRuntimes();
this._runningApps.clear(); this._runningApps.clear();
this.runtimeList = null; this.runtimeList = null;
this.connection.off(Connection.Events.STATUS_CHANGED, this.onConnectionChanged); this.webAppsStore.off("store-ready", this.onWebAppsStoreready);
this.webAppsStore.destroy(); this.webAppsStore.destroy();
this.webAppsStore = null; this.webAppsStore = null;
this.connection.off(Connection.Events.STATUS_CHANGED, this.onConnectionChanged);
this._listTabsResponse = null; this._listTabsResponse = null;
this.connection.disconnect(); this.connection.disconnect();
this.connection = null; this.connection = null;
@ -92,12 +98,17 @@ exports.AppManager = AppManager = {
this._listenToApps(); this._listenToApps();
this._listTabsResponse = response; this._listTabsResponse = response;
this._getRunningApps(); this._getRunningApps();
this.update("list-tabs-response");
}); });
} }
this.update("connection"); this.update("connection");
}, },
onWebAppsStoreready: function() {
this.update("runtime-apps-found");
},
_runningApps: new Set(), _runningApps: new Set(),
_getRunningApps: function() { _getRunningApps: function() {
let client = this.connection.client; let client = this.connection.client;
@ -158,22 +169,32 @@ exports.AppManager = AppManager = {
getTarget: function() { getTarget: function() {
let manifest = this.getProjectManifestURL(this.selectedProject); let manifest = this.getProjectManifestURL(this.selectedProject);
let name = this.selectedProject.name; if (!manifest) {
if (manifest) { console.error("Can't find manifestURL for selected project");
let client = this.connection.client; return promise.reject();
let actor = this._listTabsResponse.webappsActor;
let promise = AppActorFront.getTargetForApp(client, actor, manifest);
promise.then(( ) => { },
(e) => {
this.reportError("error_cantConnectToApp", manifestURL);
console.error("Can't connect to app: " + e)
});
return promise;
} }
console.error("Can't find manifestURL for selected project");
return promise.reject(); let client = this.connection.client;
let actor = this._listTabsResponse.webappsActor;
return Task.spawn(function* () {
// Once we asked the app to launch, the app isn't necessary completely loaded.
// launch request only ask the app to launch and immediatly returns.
// We have to keep trying to get app tab actors required to create its target.
for (let i = 0; i < 10; i++) {
try {
let target = yield AppActorFront.getTargetForApp(client, actor, manifest);
// Success
return target;
} catch(e) {}
let deferred = promise.defer();
setTimeout(deferred.resolve, 500);
yield deferred.promise;
}
AppManager.reportError("error_cantConnectToApp", manifest);
throw new Error("can't connect to app");
});
}, },
@ -271,7 +292,7 @@ exports.AppManager = AppManager = {
disconnectRuntime: function() { disconnectRuntime: function() {
if (this.connection.status != Connection.Status.CONNECTED) { if (this.connection.status != Connection.Status.CONNECTED) {
return promise.reject("Already disconnected"); return promise.resolve();
} }
let deferred = promise.defer(); let deferred = promise.defer();
this.connection.once(Connection.Events.DISCONNECTED, () => deferred.resolve()); this.connection.once(Connection.Events.DISCONNECTED, () => deferred.resolve());
@ -302,26 +323,34 @@ exports.AppManager = AppManager = {
return promise.reject("Can't install"); return promise.reject("Can't install");
} }
return this.validateProject(project).then(() => { return Task.spawn(function* () {
let self = AppManager;
yield self.validateProject(project);
if (project.errorsCount > 0) { if (project.errorsCount > 0) {
this.reportError("error_cantInstallValidationErrors"); self.reportError("error_cantInstallValidationErrors");
return; return;
} }
let client = this.connection.client; let client = self.connection.client;
let actor = this._listTabsResponse.webappsActor; let actor = self._listTabsResponse.webappsActor;
let installPromise; let installPromise;
if (project.type != "packaged" && project.type != "hosted") {
return promise.reject("Don't know how to install project");
}
if (project.type == "packaged") { if (project.type == "packaged") {
installPromise = AppActorFront.installPackaged(client, actor, project.location, project.packagedAppOrigin) let {appId} = yield AppActorFront.installPackaged(client,
.then(({ appId }) => { actor,
// If the packaged app specified a custom origin override, project.location,
// we need to update the local project origin project.packagedAppOrigin);
project.packagedAppOrigin = appId; // If the packaged app specified a custom origin override,
// And ensure the indexed db on disk is also updated // we need to update the local project origin
AppProjects.update(project); project.packagedAppOrigin = appId;
}); // And ensure the indexed db on disk is also updated
AppProjects.update(project);
} }
if (project.type == "hosted") { if (project.type == "hosted") {
@ -332,25 +361,33 @@ exports.AppManager = AppManager = {
origin: origin.spec, origin: origin.spec,
manifestURL: project.location manifestURL: project.location
}; };
installPromise = AppActorFront.installHosted(client, actor, appId, metadata, project.manifest); yield AppActorFront.installHosted(client,
actor,
appId,
metadata,
project.manifest);
} }
if (!installPromise) { function waitUntilProjectRuns() {
return promise.reject("Can't install"); let deferred = promise.defer();
self.on("app-manager-update", function onUpdate(event, what) {
if (what == "project-is-running") {
self.off("app-manager-update", onUpdate);
deferred.resolve();
}
});
return deferred.promise;
} }
return installPromise.then(() => { let manifest = self.getProjectManifestURL(project);
let manifest = this.getProjectManifestURL(project); if (!self._runningApps.has(manifest)) {
if (!this._runningApps.has(manifest)) { yield AppActorFront.launchApp(client, actor, manifest);
console.log("Launching app: " + project.name); yield waitUntilProjectRuns();
AppActorFront.launchApp(client, actor, manifest);
} else {
console.log("Reloading app: " + project.name);
AppActorFront.reloadApp(client, actor, manifest);
}
});
}, console.error); } else {
yield AppActorFront.reloadApp(client, actor, manifest);
}
});
}, },
stopRunningApp: function() { stopRunningApp: function() {
@ -367,78 +404,78 @@ exports.AppManager = AppManager = {
return promise.reject(); return promise.reject();
} }
let validation = new AppValidator(project); return Task.spawn(function* () {
return validation.validate()
.then(() => {
if (validation.manifest) {
let manifest = validation.manifest;
let iconPath;
if (manifest.icons) {
let size = Object.keys(manifest.icons).sort(function(a, b) b - a)[0];
if (size) {
iconPath = manifest.icons[size];
}
}
if (!iconPath) {
project.icon = AppManager.DEFAULT_PROJECT_ICON;
} else {
if (project.type == "hosted") {
let manifestURL = Services.io.newURI(project.location, null, null);
let origin = Services.io.newURI(manifestURL.prePath, null, null);
project.icon = Services.io.newURI(iconPath, null, origin).spec;
} else if (project.type == "packaged") {
let projectFolder = FileUtils.File(project.location);
let folderURI = Services.io.newFileURI(projectFolder).spec;
project.icon = folderURI + iconPath.replace(/^\/|\\/, "");
}
}
project.manifest = validation.manifest;
if ("name" in project.manifest) { let validation = new AppValidator(project);
project.name = project.manifest.name; yield validation.validate();
} else {
project.name = AppManager.DEFAULT_PROJECT_NAME; if (validation.manifest) {
let manifest = validation.manifest;
let iconPath;
if (manifest.icons) {
let size = Object.keys(manifest.icons).sort(function(a, b) b - a)[0];
if (size) {
iconPath = manifest.icons[size];
} }
} else { }
project.manifest = null; if (!iconPath) {
project.icon = AppManager.DEFAULT_PROJECT_ICON; project.icon = AppManager.DEFAULT_PROJECT_ICON;
} else {
if (project.type == "hosted") {
let manifestURL = Services.io.newURI(project.location, null, null);
let origin = Services.io.newURI(manifestURL.prePath, null, null);
project.icon = Services.io.newURI(iconPath, null, origin).spec;
} else if (project.type == "packaged") {
let projectFolder = FileUtils.File(project.location);
let folderURI = Services.io.newFileURI(projectFolder).spec;
project.icon = folderURI + iconPath.replace(/^\/|\\/, "");
}
}
project.manifest = validation.manifest;
if ("name" in project.manifest) {
project.name = project.manifest.name;
} else {
project.name = AppManager.DEFAULT_PROJECT_NAME; project.name = AppManager.DEFAULT_PROJECT_NAME;
} }
} else {
project.manifest = null;
project.icon = AppManager.DEFAULT_PROJECT_ICON;
project.name = AppManager.DEFAULT_PROJECT_NAME;
}
project.validationStatus = "valid"; project.validationStatus = "valid";
if (validation.warnings.length > 0) { if (validation.warnings.length > 0) {
project.warningsCount = validation.warnings.length; project.warningsCount = validation.warnings.length;
project.warnings = validation.warnings; project.warnings = validation.warnings;
project.validationStatus = "warning"; project.validationStatus = "warning";
} else { } else {
project.warnings = ""; project.warnings = "";
project.warningsCount = 0; project.warningsCount = 0;
} }
if (validation.errors.length > 0) { if (validation.errors.length > 0) {
project.errorsCount = validation.errors.length; project.errorsCount = validation.errors.length;
project.errors = validation.errors; project.errors = validation.errors;
project.validationStatus = "error"; project.validationStatus = "error";
} else { } else {
project.errors = ""; project.errors = "";
project.errorsCount = 0; project.errorsCount = 0;
} }
if (project.warningsCount && project.errorsCount) { if (project.warningsCount && project.errorsCount) {
project.validationStatus = "error warning"; project.validationStatus = "error warning";
} }
if (this.selectedProject === project) { if (AppProjects.get(project.location)) {
this.update("project-validated"); yield AppProjects.update(project);
} }
if (AppProjects.get(project.location)) { if (this.selectedProject === project) {
AppProjects.update(project); this.update("project-validated");
} }
});
return project;
}, console.error);
}, },
/* RUNTIME LIST */ /* RUNTIME LIST */

View File

@ -6,6 +6,7 @@
PARALLEL_DIRS += [ PARALLEL_DIRS += [
'content', 'content',
'components',
'themes', 'themes',
] ]

View File

@ -11,3 +11,4 @@ support-files =
[test_newapp.html] [test_newapp.html]
[test_import.html] [test_import.html]
[test_runtime.html] [test_runtime.html]
[test_cli.html]

View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title></title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
<script type="application/javascript;version=1.8" src="head.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<script type="application/javascript;version=1.8">
window.onload = function() {
SimpleTest.waitForExplicitFinish();
Task.spawn(function* () {
let clClass = Components.classes["@mozilla.org/toolkit/command-line;1"].createInstance();
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
DebuggerServer.init(function () { return true; });
DebuggerServer.addBrowserActors();
let win = yield openWebIDE();
let packagedAppLocation = getTestFilePath("app");
let cli = "actions=addPackagedApp&location=" + packagedAppLocation;
yield win.handleCommandline(cli);
let project = win.AppManager.selectedProject;
is(project.location, packagedAppLocation, "Project imported");
win.AppManager.runtimeList.usb.push({
connect: function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
connection.host = null; // force connectPipe
connection.connect();
return promise.resolve();
},
getName: function() {
return "fakeRuntime";
}
});
yield win.handleCommandline("actions=connectToRuntime&runtimeType=usb");
is(win.AppManager.connection.status, "connected", "connected");
is(win.AppManager.selectedProject.name, "A name (in app directory)", "project imported");
yield removeAllProjects();
yield closeWebIDE(win);
DebuggerServer.destroy();
SimpleTest.finish();
});
}
</script>
</body>
</html>

View File

@ -5,3 +5,4 @@
pref("devtools.webide.showProjectEditor", true); pref("devtools.webide.showProjectEditor", true);
pref("devtools.webide.templatesURL", "http://fixme/"); pref("devtools.webide.templatesURL", "http://fixme/");
pref("devtools.webide.lastprojectlocation", "");

View File

@ -1,4 +1,4 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.0.162 Current extension version is: 1.0.248

View File

@ -131,3 +131,4 @@ PdfRedirector.prototype = {
// Do nothing // Do nothing
} }
}; };

View File

@ -977,3 +977,4 @@ PdfStreamConverter.prototype = {
delete this.binaryStream; delete this.binaryStream;
} }
}; };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -477,9 +477,10 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton {
} }
.toolbarButton, .toolbarButton,
.secondaryToolbarButton { .secondaryToolbarButton,
.overlayButton {
border: 0 none; border: 0 none;
background-color: rgba(0, 0, 0, 0); background: none;
width: 32px; width: 32px;
height: 25px; height: 25px;
} }
@ -492,7 +493,8 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton {
} }
.toolbarButton[disabled], .toolbarButton[disabled],
.secondaryToolbarButton[disabled] { .secondaryToolbarButton[disabled],
.overlayButton[disabled] {
opacity: .5; opacity: .5;
} }
@ -581,8 +583,8 @@ html[dir='rtl'] .splitToolbarButtonSeparator {
.toolbarButton, .toolbarButton,
.dropdownToolbarButton, .dropdownToolbarButton,
.overlayButton, .secondaryToolbarButton,
.secondaryToolbarButton { .overlayButton {
min-width: 16px; min-width: 16px;
padding: 2px 6px 0; padding: 2px 6px 0;
border: 1px solid transparent; border: 1px solid transparent;
@ -693,12 +695,6 @@ html[dir='rtl'] .dropdownToolbarButton {
background: hsl(0,0%,24%); background: hsl(0,0%,24%);
} }
.overlayButton {
margin: 3px 2px 4px 5px !important;
line-height: 16px;
padding: 2px 6px 3px 6px;
}
#customScaleOption { #customScaleOption {
display: none; display: none;
} }
@ -1329,80 +1325,37 @@ canvas {
width: 98%; width: 98%;
} }
.overlayButton {
width: auto;
margin: 3px 4px 2px 4px !important;
padding: 2px 6px 3px 6px;
}
#overlayContainer { #overlayContainer {
display: table; display: table;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: hsla(0,0%,0%,.2); background-color: hsla(0,0%,0%,.2);
z-index: 10000; z-index: 40000;
} }
#overlayContainer > * { #overlayContainer > * {
overflow: auto; overflow: auto;
} }
#promptContainer { #overlayContainer > .container {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
} }
#promptContainer > * { #overlayContainer > .container > .dialog {
display: inline-block;
}
.prompt {
display: table;
padding: 15px;
border-spacing: 4px;
color: hsl(0,0%,85%);
line-height: 14px;
text-align: center;
background-color: #474747; /* fallback */
background-image: url(images/texture.png),
linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08),
inset 0 1px 1px hsla(0,0%,0%,.15),
inset 0 -1px 0 hsla(0,0%,100%,.05),
0 1px 0 hsla(0,0%,0%,.15),
0 1px 1px hsla(0,0%,0%,.1);
}
.prompt > .row {
display: table-row;
}
.prompt > .row > * {
display: table-cell;
}
.prompt .toolbarField {
margin: 5px 0;
width: 200px;
}
.prompt .toolbarField:hover,
.prompt .toolbarField:focus {
border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
}
#documentPropertiesContainer {
display: table-cell;
vertical-align: middle;
text-align: center;
}
#documentPropertiesContainer > * {
display: inline-block; display: inline-block;
padding: 15px; padding: 15px;
border-spacing: 4px; border-spacing: 4px;
max-width: 350px;
max-height: 350px;
color: hsl(0,0%,85%); color: hsl(0,0%,85%);
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
text-align: left;
cursor: default;
background-color: #474747; /* fallback */ background-color: #474747; /* fallback */
background-image: url(images/texture.png), background-image: url(images/texture.png),
linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
@ -1411,9 +1364,28 @@ canvas {
inset 0 -1px 0 hsla(0,0%,100%,.05), inset 0 -1px 0 hsla(0,0%,100%,.05),
0 1px 0 hsla(0,0%,0%,.15), 0 1px 0 hsla(0,0%,0%,.15),
0 1px 1px hsla(0,0%,0%,.1); 0 1px 1px hsla(0,0%,0%,.1);
border: 1px solid hsla(0,0%,0%,.5);
border-radius: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
} }
#documentPropertiesContainer .separator { .dialog > .row {
display: table-row;
}
.dialog > .row > * {
display: table-cell;
}
.dialog .toolbarField {
margin: 5px 0;
}
.dialog .toolbarField:hover,
.dialog .toolbarField:focus {
border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
}
.dialog .separator {
display: block; display: block;
margin: 4px 0 4px 0; margin: 4px 0 4px 0;
height: 1px; height: 1px;
@ -1422,35 +1394,40 @@ canvas {
box-shadow: 0 0 0 1px hsla(0,0%,100%,.08); box-shadow: 0 0 0 1px hsla(0,0%,100%,.08);
} }
#documentPropertiesContainer .row { .dialog .buttonRow {
display: table-row; text-align: center;
vertical-align: middle;
} }
html[dir='ltr'] #documentPropertiesContainer .row > * { #passwordOverlay > .dialog {
display: table-cell; text-align: center;
min-width: 100px; }
#passwordOverlay .toolbarField {
width: 200px;
} }
html[dir='rtl'] #documentPropertiesContainer .row > * { #documentPropertiesOverlay > .dialog {
display: table-cell; text-align: left;
}
#documentPropertiesOverlay .row > * {
min-width: 100px; min-width: 100px;
}
html[dir='ltr'] #documentPropertiesOverlay .row > * {
text-align: left;
}
html[dir='rtl'] #documentPropertiesOverlay .row > * {
text-align: right; text-align: right;
} }
#documentPropertiesOverlay .row > span {
#documentPropertiesContainer .row span {
width: 125px; width: 125px;
word-wrap: break-word; word-wrap: break-word;
} }
#documentPropertiesOverlay .row > p {
#documentPropertiesContainer .row p {
max-width: 225px; max-width: 225px;
word-wrap: break-word; word-wrap: break-word;
} }
#documentPropertiesOverlay .buttonRow {
#documentPropertiesContainer .buttonRow {
margin-top: 10px; margin-top: 10px;
text-align: center;
vertical-align: middle;
} }
.clearBoth { .clearBoth {

View File

@ -25,8 +25,8 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<!-- This snippet is used in the Firefox extension (included from viewer.html) --> <!-- This snippet is used in the Firefox extension (included from viewer.html) -->
<base href="resource://pdf.js/web/" /> <base href="resource://pdf.js/web/" />
<script type="text/javascript" src="l10n.js"></script> <script src="l10n.js"></script>
<script type="text/javascript" src="../build/pdf.js"></script> <script src="../build/pdf.js"></script>
<link rel="stylesheet" href="viewer.css"/> <link rel="stylesheet" href="viewer.css"/>
@ -36,8 +36,8 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<script type="text/javascript" src="debugger.js"></script> <script src="debugger.js"></script>
<script type="text/javascript" src="viewer.js"></script> <script src="viewer.js"></script>
</head> </head>
@ -267,8 +267,8 @@ http://sourceforge.net/adobe/cmap/wiki/License/
</div> <!-- mainContainer --> </div> <!-- mainContainer -->
<div id="overlayContainer" class="hidden"> <div id="overlayContainer" class="hidden">
<div id="promptContainer" class="hidden"> <div id="passwordOverlay" class="container hidden">
<div id="passwordContainer" class="prompt doorHanger"> <div class="dialog">
<div class="row"> <div class="row">
<p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p> <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
</div> </div>
@ -281,8 +281,8 @@ http://sourceforge.net/adobe/cmap/wiki/License/
</div> </div>
</div> </div>
</div> </div>
<div id="documentPropertiesContainer" class="hidden"> <div id="documentPropertiesOverlay" class="container hidden">
<div class="doorHanger"> <div class="dialog">
<div class="row"> <div class="row">
<span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p> <span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p>
</div> </div>
@ -322,7 +322,7 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p> <span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p>
</div> </div>
<div class="buttonRow"> <div class="buttonRow">
<button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button> <button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -648,7 +648,7 @@ var ViewHistory = (function ViewHistoryClosure() {
return; return;
} }
this.file[name] = val; this.file[name] = val;
this._writeToStorage(); return this._writeToStorage();
}, },
setMultiple: function ViewHistory_setMultiple(properties) { setMultiple: function ViewHistory_setMultiple(properties) {
@ -658,7 +658,7 @@ var ViewHistory = (function ViewHistoryClosure() {
for (var name in properties) { for (var name in properties) {
this.file[name] = properties[name]; this.file[name] = properties[name];
} }
this._writeToStorage(); return this._writeToStorage();
}, },
get: function ViewHistory_get(name, defaultValue) { get: function ViewHistory_get(name, defaultValue) {
@ -3446,14 +3446,15 @@ var PDFView = {
} }
}, },
renderHighestPriority: function pdfViewRenderHighestPriority() { renderHighestPriority:
function pdfViewRenderHighestPriority(currentlyVisiblePages) {
if (PDFView.idleTimeout) { if (PDFView.idleTimeout) {
clearTimeout(PDFView.idleTimeout); clearTimeout(PDFView.idleTimeout);
PDFView.idleTimeout = null; PDFView.idleTimeout = null;
} }
// Pages have a higher priority than thumbnails, so check them first. // Pages have a higher priority than thumbnails, so check them first.
var visiblePages = this.getVisiblePages(); var visiblePages = currentlyVisiblePages || this.getVisiblePages();
var pageView = this.getHighestPriority(visiblePages, this.pages, var pageView = this.getHighestPriority(visiblePages, this.pages,
this.pageViewScroll.down); this.pageViewScroll.down);
if (pageView) { if (pageView) {
@ -4018,12 +4019,13 @@ var PageView = function pageView(container, id, scale,
// the text layer are rotated. // the text layer are rotated.
// TODO: This could probably be simplified by drawing the text layer in // TODO: This could probably be simplified by drawing the text layer in
// one orientation then rotating overall. // one orientation then rotating overall.
var textLayerViewport = this.textLayer.viewport;
var textRelativeRotation = this.viewport.rotation - var textRelativeRotation = this.viewport.rotation -
this.textLayer.viewport.rotation; textLayerViewport.rotation;
var textAbsRotation = Math.abs(textRelativeRotation); var textAbsRotation = Math.abs(textRelativeRotation);
var scale = (width / canvas.width); var scale = width / textLayerViewport.width;
if (textAbsRotation === 90 || textAbsRotation === 270) { if (textAbsRotation === 90 || textAbsRotation === 270) {
scale = width / canvas.height; scale = width / textLayerViewport.height;
} }
var textLayerDiv = this.textLayer.textLayerDiv; var textLayerDiv = this.textLayer.textLayerDiv;
var transX, transY; var transX, transY;
@ -5373,7 +5375,7 @@ function updateViewarea() {
return; return;
} }
PDFView.renderHighestPriority(); PDFView.renderHighestPriority(visible);
var currentId = PDFView.page; var currentId = PDFView.page;
var firstPage = visible.first; var firstPage = visible.first;
@ -5430,6 +5432,8 @@ function updateViewarea() {
'zoom': normalizedScaleValue, 'zoom': normalizedScaleValue,
'scrollLeft': intLeft, 'scrollLeft': intLeft,
'scrollTop': intTop 'scrollTop': intTop
}).catch(function() {
// unable to write to storage
}); });
}); });
var href = PDFView.getAnchorUrl(pdfOpenParams); var href = PDFView.getAnchorUrl(pdfOpenParams);
@ -5809,16 +5813,8 @@ window.addEventListener('afterprint', function afterPrint(evt) {
(function animationStartedClosure() { (function animationStartedClosure() {
// The offsetParent is not set until the pdf.js iframe or object is visible. // The offsetParent is not set until the pdf.js iframe or object is visible.
// Waiting for first animation. // Waiting for first animation.
var requestAnimationFrame = window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function startAtOnce(callback) { callback(); };
PDFView.animationStartedPromise = new Promise(function (resolve) { PDFView.animationStartedPromise = new Promise(function (resolve) {
requestAnimationFrame(function onAnimationFrame() { window.requestAnimationFrame(resolve);
resolve();
});
}); });
})(); })();

View File

@ -376,7 +376,7 @@ BookmarksObserver.prototype = {
this._rootEvents.removeListener(aEvent, aListener); this._rootEvents.removeListener(aEvent, aListener);
}, },
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarksObserver, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver,
Ci.nsISupportsWeakReference]) Ci.nsISupportsWeakReference])
}; };
@ -495,7 +495,7 @@ Bookmark.prototype = {
}, },
QueryInterface: XPCOMUtils.generateQI([Ci.fuelIBookmark, QueryInterface: XPCOMUtils.generateQI([Ci.fuelIBookmark,
Ci.nsINavBookmarksObserver, Ci.nsINavBookmarkObserver,
Ci.nsISupportsWeakReference]) Ci.nsISupportsWeakReference])
}; };
@ -667,7 +667,7 @@ BookmarkFolder.prototype = {
}, },
QueryInterface: XPCOMUtils.generateQI([Ci.fuelIBookmarkFolder, QueryInterface: XPCOMUtils.generateQI([Ci.fuelIBookmarkFolder,
Ci.nsINavBookmarksObserver, Ci.nsINavBookmarkObserver,
Ci.nsISupportsWeakReference]) Ci.nsISupportsWeakReference])
}; };

View File

@ -10,10 +10,17 @@ include $(topsrcdir)/config/rules.mk
MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
ifdef MOZ_MULET
MOZ_PKG_MANIFEST_P += $(topsrcdir)/b2g/installer/package-manifest.in
endif
# Some files have been already bundled with xulrunner # Some files have been already bundled with xulrunner
ifndef SYSTEM_LIBXUL ifndef SYSTEM_LIBXUL
ifndef MOZ_MULET
MOZ_PKG_FATAL_WARNINGS = 1 MOZ_PKG_FATAL_WARNINGS = 1
endif endif
endif
DEFINES += -DAB_CD=$(AB_CD) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR) DEFINES += -DAB_CD=$(AB_CD) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
@ -88,7 +95,7 @@ ifdef MOZ_PKG_MANIFEST_P
MOZ_PKG_MANIFEST = package-manifest MOZ_PKG_MANIFEST = package-manifest
$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS) $(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@) $(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(MOZ_PKG_MANIFEST_P) -o $@)
GARBAGE += $(MOZ_PKG_MANIFEST) GARBAGE += $(MOZ_PKG_MANIFEST)
endif endif

View File

@ -1,26 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
#inspector-searchbox {
transition-property: max-width, -moz-padding-end, -moz-padding-start;
transition-duration: 250ms;
transition-timing-function: ease;
}
#inspector-searchbox:not([focused]):not([filled]) > .textbox-input-box {
overflow: hidden;
}
#inspector-searchbox:not([focused]):not([filled]) {
max-width: 20px !important;
-moz-padding-end: 5px;
-moz-padding-start: 22px;
background-position: 8px center, top left, top left;
}
#inspector-searchbox[focused],
#inspector-searchbox[filled] {
max-width: 200px !important;
}

View File

@ -182,7 +182,9 @@ browser.jar:
skin/classic/browser/tabview/tabview.png (tabview/tabview.png) skin/classic/browser/tabview/tabview.png (tabview/tabview.png)
skin/classic/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/browser/tabview/tabview.css (tabview/tabview.css)
skin/classic/browser/translating-16.png (../shared/translation/translating-16.png) skin/classic/browser/translating-16.png (../shared/translation/translating-16.png)
skin/classic/browser/translating-16@2x.png (../shared/translation/translating-16@2x.png)
skin/classic/browser/translation-16.png (../shared/translation/translation-16.png) skin/classic/browser/translation-16.png (../shared/translation/translation-16.png)
skin/classic/browser/translation-16@2x.png (../shared/translation/translation-16@2x.png)
* skin/classic/browser/devtools/common.css (../shared/devtools/common.css) * skin/classic/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css) * skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css) * skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
@ -277,7 +279,7 @@ browser.jar:
skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png) skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css) skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css)
skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css) skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css)
skin/classic/browser/devtools/inspector.css (devtools/inspector.css) * skin/classic/browser/devtools/inspector.css (../shared/devtools/inspector.css)
skin/classic/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg) skin/classic/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg)
skin/classic/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg) skin/classic/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg)
skin/classic/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg) skin/classic/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg)

View File

@ -397,7 +397,7 @@ browser.jar:
skin/classic/browser/devtools/toggle-tools.png (../shared/devtools/images/toggle-tools.png) skin/classic/browser/devtools/toggle-tools.png (../shared/devtools/images/toggle-tools.png)
skin/classic/browser/devtools/dock-bottom@2x.png (../shared/devtools/images/dock-bottom@2x.png) skin/classic/browser/devtools/dock-bottom@2x.png (../shared/devtools/images/dock-bottom@2x.png)
skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png) skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
* skin/classic/browser/devtools/inspector.css (devtools/inspector.css) * skin/classic/browser/devtools/inspector.css (../shared/devtools/inspector.css)
skin/classic/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg) skin/classic/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg)
skin/classic/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg) skin/classic/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg)
skin/classic/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg) skin/classic/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg)

View File

@ -184,14 +184,6 @@
margin-bottom: -4px; margin-bottom: -4px;
} }
/* Tooltip: Font Family Previewer Text */
.devtools-tooltip-font-previewer-text {
max-width: 400px;
line-height: 1.5;
font-size: 150%;
text-align: center;
}
/* Tooltip: Alert Icon */ /* Tooltip: Alert Icon */
.devtools-tooltip-alert-icon { .devtools-tooltip-alert-icon {

View File

@ -349,10 +349,6 @@ div.CodeMirror span.eval-text {
border-bottom: 1px solid #434850; border-bottom: 1px solid #434850;
} }
.theme-tooltip-panel .devtools-tooltip-font-previewer-text {
color: white;
}
.theme-tooltip-panel .devtools-tooltip-simple-text:last-child { .theme-tooltip-panel .devtools-tooltip-simple-text:last-child {
border-bottom: 0; border-bottom: 0;
} }

View File

@ -3,8 +3,7 @@
* 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/. */
%include ../shared.inc %ifdef XP_MACOSX
%filter substitution
#inspector-toolbar { #inspector-toolbar {
padding-top: 4px; padding-top: 4px;
@ -21,6 +20,8 @@
padding-right: 18px; /* use -moz-padding-end when/if bug 631729 gets fixed */ padding-right: 18px; /* use -moz-padding-end when/if bug 631729 gets fixed */
} }
%endif
#inspector-searchbox { #inspector-searchbox {
transition-property: max-width, -moz-padding-end, -moz-padding-start; transition-property: max-width, -moz-padding-end, -moz-padding-start;
transition-duration: 250ms; transition-duration: 250ms;

View File

@ -358,10 +358,6 @@ div.CodeMirror span.eval-text {
border-bottom: 1px solid #d9e1e8; border-bottom: 1px solid #d9e1e8;
} }
.theme-tooltip-panel .devtools-tooltip-font-previewer-text {
color: black;
}
.theme-tooltip-panel .devtools-tooltip-simple-text:last-child { .theme-tooltip-panel .devtools-tooltip-simple-text:last-child {
border-bottom: 0; border-bottom: 0;
} }

View File

@ -1,26 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
#inspector-searchbox {
transition-property: max-width, -moz-padding-end, -moz-padding-start;
transition-duration: 250ms;
transition-timing-function: ease;
}
#inspector-searchbox:not([focused]):not([filled]) > .textbox-input-box {
overflow: hidden;
}
#inspector-searchbox:not([focused]):not([filled]) {
max-width: 20px !important;
-moz-padding-end: 6px;
-moz-padding-start: 22px;
background-position: 8px center, top left, top left;
}
#inspector-searchbox[focused],
#inspector-searchbox[filled] {
max-width: 200px !important;
}

View File

@ -219,7 +219,9 @@ browser.jar:
skin/classic/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png) skin/classic/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png)
skin/classic/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/browser/tabview/tabview.css (tabview/tabview.css)
skin/classic/browser/translating-16.png (../shared/translation/translating-16.png) skin/classic/browser/translating-16.png (../shared/translation/translating-16.png)
skin/classic/browser/translating-16@2x.png (../shared/translation/translating-16@2x.png)
skin/classic/browser/translation-16.png (../shared/translation/translation-16.png) skin/classic/browser/translation-16.png (../shared/translation/translation-16.png)
skin/classic/browser/translation-16@2x.png (../shared/translation/translation-16@2x.png)
* skin/classic/browser/devtools/common.css (../shared/devtools/common.css) * skin/classic/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css) * skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css) * skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
@ -315,7 +317,7 @@ browser.jar:
skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png) skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css) skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css)
skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css) skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css)
skin/classic/browser/devtools/inspector.css (devtools/inspector.css) * skin/classic/browser/devtools/inspector.css (../shared/devtools/inspector.css)
skin/classic/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg) skin/classic/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg)
skin/classic/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg) skin/classic/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg)
skin/classic/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg) skin/classic/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg)
@ -610,7 +612,9 @@ browser.jar:
skin/classic/aero/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png) skin/classic/aero/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png)
skin/classic/aero/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/aero/browser/tabview/tabview.css (tabview/tabview.css)
skin/classic/aero/browser/translating-16.png (../shared/translation/translating-16.png) skin/classic/aero/browser/translating-16.png (../shared/translation/translating-16.png)
skin/classic/aero/browser/translating-16@2x.png (../shared/translation/translating-16@2x.png)
skin/classic/aero/browser/translation-16.png (../shared/translation/translation-16.png) skin/classic/aero/browser/translation-16.png (../shared/translation/translation-16.png)
skin/classic/aero/browser/translation-16@2x.png (../shared/translation/translation-16@2x.png)
* skin/classic/aero/browser/devtools/common.css (../shared/devtools/common.css) * skin/classic/aero/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/aero/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css) * skin/classic/aero/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/aero/browser/devtools/light-theme.css (../shared/devtools/light-theme.css) * skin/classic/aero/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
@ -706,7 +710,7 @@ browser.jar:
skin/classic/aero/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png) skin/classic/aero/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
skin/classic/aero/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css) skin/classic/aero/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css)
skin/classic/aero/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css) skin/classic/aero/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css)
skin/classic/aero/browser/devtools/inspector.css (devtools/inspector.css) * skin/classic/aero/browser/devtools/inspector.css (../shared/devtools/inspector.css)
skin/classic/aero/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg) skin/classic/aero/browser/devtools/profiler-stopwatch.svg (../shared/devtools/images/profiler-stopwatch.svg)
skin/classic/aero/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg) skin/classic/aero/browser/devtools/profiler-stopwatch-checked.svg (../shared/devtools/images/profiler-stopwatch-checked.svg)
skin/classic/aero/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg) skin/classic/aero/browser/devtools/tool-options.svg (../shared/devtools/images/tool-options.svg)

View File

@ -109,7 +109,7 @@ MediaEngineTabVideoSource::InitRunnable::Run()
void void
MediaEngineTabVideoSource::GetName(nsAString_internal& aName) MediaEngineTabVideoSource::GetName(nsAString_internal& aName)
{ {
aName.AssignLiteral(MOZ_UTF16("&getUserMedia.videoDevice.tabShare;")); aName.AssignLiteral(MOZ_UTF16("&getUserMedia.videoSource.tabShare;"));
} }
void void

View File

@ -233,12 +233,6 @@ RemoveObserversExceptBluetoothManager
return PL_DHASH_NEXT; return PL_DHASH_NEXT;
} }
void
BluetoothService::RemoveObserverFromTable(const nsAString& key)
{
mBluetoothSignalObserverTable.Remove(key);
}
// static // static
BluetoothService* BluetoothService*
BluetoothService::Create() BluetoothService::Create()

View File

@ -308,9 +308,6 @@ public:
bool bool
IsToggling() const; IsToggling() const;
void
RemoveObserverFromTable(const nsAString& key);
/** /**
* Below 2 function/variable are used for ensuring event 'AdapterAdded' will * Below 2 function/variable are used for ensuring event 'AdapterAdded' will
* be fired after event 'Enabled'. * be fired after event 'Enabled'.

View File

@ -233,12 +233,6 @@ RemoveObserversExceptBluetoothManager
return PL_DHASH_NEXT; return PL_DHASH_NEXT;
} }
void
BluetoothService::RemoveObserverFromTable(const nsAString& key)
{
mBluetoothSignalObserverTable.Remove(key);
}
// static // static
BluetoothService* BluetoothService*
BluetoothService::Create() BluetoothService::Create()

View File

@ -308,9 +308,6 @@ public:
bool bool
IsToggling() const; IsToggling() const;
void
RemoveObserverFromTable(const nsAString& key);
/** /**
* Below 2 function/variable are used for ensuring event 'AdapterAdded' will * Below 2 function/variable are used for ensuring event 'AdapterAdded' will
* be fired after event 'Enabled'. * be fired after event 'Enabled'.

View File

@ -558,6 +558,17 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
break; break;
} }
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT:
// If this is a remote frame, we receive NS_MOUSE_EXIT from the parent
// the mouse exits our content. Since the parent may update the cursor
// while the mouse is outside our frame, and since PuppetWidget caches the
// current cursor internally, re-entering our content (say from over a
// window edge) wont update the cursor if the cached value and the current
// cursor match. So when the mouse exits a remote frame, clear the cached
// widget cursor so a proper update will occur when the mouse re-enters.
if (XRE_GetProcessType() == GeckoProcessType_Content) {
ClearCachedWidgetCursor(mCurrentTarget);
}
// If the event is not a top-level window exit, then it's not // If the event is not a top-level window exit, then it's not
// really an exit --- we may have traversed widget boundaries but // really an exit --- we may have traversed widget boundaries but
// we're still in our toplevel window. // we're still in our toplevel window.
@ -1144,6 +1155,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
case NS_MOUSE_BUTTON_UP: case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
case NS_CONTEXTMENU: case NS_CONTEXTMENU:
case NS_MOUSE_EXIT:
return true; return true;
default: default:
return false; return false;
@ -1165,7 +1177,6 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
bool bool
EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent, EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus *aStatus) { nsEventStatus *aStatus) {
if (*aStatus == nsEventStatus_eConsumeNoDefault || if (*aStatus == nsEventStatus_eConsumeNoDefault ||
aEvent->mFlags.mNoCrossProcessBoundaryForwarding || aEvent->mFlags.mNoCrossProcessBoundaryForwarding ||
@ -2655,7 +2666,6 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
NS_ENSURE_ARG_POINTER(aStatus); NS_ENSURE_ARG_POINTER(aStatus);
bool dispatchedToContentProcess = HandleCrossProcessEvent(aEvent, bool dispatchedToContentProcess = HandleCrossProcessEvent(aEvent,
aTargetFrame,
aStatus); aStatus);
mCurrentTarget = aTargetFrame; mCurrentTarget = aTargetFrame;
@ -3330,6 +3340,19 @@ EventStateManager::UpdateCursor(nsPresContext* aPresContext,
} }
} }
void
EventStateManager::ClearCachedWidgetCursor(nsIFrame* aTargetFrame)
{
if (!aTargetFrame) {
return;
}
nsIWidget* aWidget = aTargetFrame->GetNearestWidget();
if (!aWidget) {
return;
}
aWidget->ClearCachedCursor();
}
nsresult nsresult
EventStateManager::SetCursor(int32_t aCursor, imgIContainer* aContainer, EventStateManager::SetCursor(int32_t aCursor, imgIContainer* aContainer,
bool aHaveHotspot, bool aHaveHotspot,
@ -3542,6 +3565,44 @@ EventStateManager::IsHandlingUserInput()
(TimeStamp::Now() - sHandlingInputStart) <= timeout; (TimeStamp::Now() - sHandlingInputStart) <= timeout;
} }
static void
CreateMouseOrPointerWidgetEvent(WidgetMouseEvent* aMouseEvent,
uint32_t aMessage,
nsIContent* aRelatedContent,
nsAutoPtr<WidgetMouseEvent>& aNewEvent)
{
WidgetPointerEvent* sourcePointer = aMouseEvent->AsPointerEvent();
if (sourcePointer) {
PROFILER_LABEL("Input", "DispatchPointerEvent");
nsAutoPtr<WidgetPointerEvent> newPointerEvent;
newPointerEvent =
new WidgetPointerEvent(aMouseEvent->mFlags.mIsTrusted, aMessage,
aMouseEvent->widget);
newPointerEvent->isPrimary = sourcePointer->isPrimary;
newPointerEvent->pointerId = sourcePointer->pointerId;
newPointerEvent->width = sourcePointer->width;
newPointerEvent->height = sourcePointer->height;
newPointerEvent->inputSource = sourcePointer->inputSource;
newPointerEvent->relatedTarget =
nsIPresShell::GetPointerCapturingContent(sourcePointer->pointerId)
? nullptr
: aRelatedContent;
aNewEvent = newPointerEvent.forget();
} else {
aNewEvent =
new WidgetMouseEvent(aMouseEvent->mFlags.mIsTrusted, aMessage,
aMouseEvent->widget, WidgetMouseEvent::eReal);
aNewEvent->relatedTarget = aRelatedContent;
}
aNewEvent->refPoint = aMouseEvent->refPoint;
aNewEvent->modifiers = aMouseEvent->modifiers;
aNewEvent->button = aMouseEvent->button;
aNewEvent->buttons = aMouseEvent->buttons;
aNewEvent->pressure = aMouseEvent->pressure;
aNewEvent->pluginEvent = aMouseEvent->pluginEvent;
aNewEvent->inputSource = aMouseEvent->inputSource;
}
nsIFrame* nsIFrame*
EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent, EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
uint32_t aMessage, uint32_t aMessage,
@ -3567,54 +3628,49 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
return mPresContext->GetPrimaryFrameFor(content); return mPresContext->GetPrimaryFrameFor(content);
} }
nsEventStatus status = nsEventStatus_eIgnore; mCurrentTargetContent = nullptr;
nsAutoPtr<WidgetMouseEvent> event;
WidgetPointerEvent* sourcePointer = aMouseEvent->AsPointerEvent(); if (!aTargetContent) {
if (sourcePointer) { return nullptr;
PROFILER_LABEL("Input", "DispatchPointerEvent");
nsAutoPtr<WidgetPointerEvent> newPointerEvent;
newPointerEvent =
new WidgetPointerEvent(aMouseEvent->mFlags.mIsTrusted, aMessage,
aMouseEvent->widget);
newPointerEvent->isPrimary = sourcePointer->isPrimary;
newPointerEvent->pointerId = sourcePointer->pointerId;
newPointerEvent->width = sourcePointer->width;
newPointerEvent->height = sourcePointer->height;
newPointerEvent->inputSource = sourcePointer->inputSource;
newPointerEvent->relatedTarget = nsIPresShell::GetPointerCapturingContent(sourcePointer->pointerId)
? nullptr
: aRelatedContent;
event = newPointerEvent.forget();
} else {
PROFILER_LABEL("Input", "DispatchMouseEvent");
event =
new WidgetMouseEvent(aMouseEvent->mFlags.mIsTrusted, aMessage,
aMouseEvent->widget, WidgetMouseEvent::eReal);
event->relatedTarget = aRelatedContent;
} }
event->refPoint = aMouseEvent->refPoint;
event->modifiers = aMouseEvent->modifiers; nsAutoPtr<WidgetMouseEvent> dispatchEvent;
event->button = aMouseEvent->button; CreateMouseOrPointerWidgetEvent(aMouseEvent, aMessage,
event->buttons = aMouseEvent->buttons; aRelatedContent, dispatchEvent);
event->pressure = aMouseEvent->pressure;
event->pluginEvent = aMouseEvent->pluginEvent;
event->inputSource = aMouseEvent->inputSource;
nsWeakFrame previousTarget = mCurrentTarget; nsWeakFrame previousTarget = mCurrentTarget;
mCurrentTargetContent = aTargetContent; mCurrentTargetContent = aTargetContent;
nsIFrame* targetFrame = nullptr; nsIFrame* targetFrame = nullptr;
if (aTargetContent) {
ESMEventCB callback(aTargetContent);
EventDispatcher::Dispatch(aTargetContent, mPresContext, event, nullptr,
&status, &callback);
// Although the primary frame was checked in event callback, if (aMouseEvent->AsMouseEvent()) {
// it may not be the same object after event dispatching and handling. PROFILER_LABEL("Input", "DispatchMouseEvent");
// So we need to refetch it. }
if (mPresContext) {
targetFrame = mPresContext->GetPrimaryFrameFor(aTargetContent); nsEventStatus status = nsEventStatus_eIgnore;
ESMEventCB callback(aTargetContent);
EventDispatcher::Dispatch(aTargetContent, mPresContext, dispatchEvent, nullptr,
&status, &callback);
if (mPresContext) {
// Although the primary frame was checked in event callback, it may not be
// the same object after event dispatch and handling, so refetch it.
targetFrame = mPresContext->GetPrimaryFrameFor(aTargetContent);
// If we are leaving remote content, dispatch a mouse exit event to the
// remote frame.
if (aMessage == NS_MOUSE_EXIT_SYNTH && IsRemoteTarget(aTargetContent)) {
// For remote content, send a normal widget mouse exit event.
nsAutoPtr<WidgetMouseEvent> remoteEvent;
CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_EXIT,
aRelatedContent, remoteEvent);
// mCurrentTarget is set to the new target, so we must reset it to the
// old target and then dispatch a cross-process event. (mCurrentTarget
// will be set back below.) HandleCrossProcessEvent will query for the
// proper target via GetEventTarget which will return mCurrentTarget.
mCurrentTarget = targetFrame;
HandleCrossProcessEvent(remoteEvent, &status);
} }
} }

View File

@ -271,6 +271,15 @@ protected:
*/ */
static int32_t GetAccessModifierMaskFor(nsISupports* aDocShell); static int32_t GetAccessModifierMaskFor(nsISupports* aDocShell);
/*
* If aTargetFrame's widget has a cached cursor value, resets the cursor
* such that the next call to SetCursor on the widget will force an update
* of the native cursor. For use in getting puppet widget to update its
* cursor between mouse exit / enter transitions. This call basically wraps
* nsIWidget ClearCachedCursor.
*/
void ClearCachedWidgetCursor(nsIFrame* aTargetFrame);
void UpdateCursor(nsPresContext* aPresContext, void UpdateCursor(nsPresContext* aPresContext,
WidgetEvent* aEvent, WidgetEvent* aEvent,
nsIFrame* aTargetFrame, nsIFrame* aTargetFrame,
@ -783,7 +792,6 @@ protected:
nsFrameLoader* aRemote, nsFrameLoader* aRemote,
nsEventStatus *aStatus); nsEventStatus *aStatus);
bool HandleCrossProcessEvent(WidgetEvent* aEvent, bool HandleCrossProcessEvent(WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus); nsEventStatus* aStatus);
void ReleaseCurrentIMEContentObserver(); void ReleaseCurrentIMEContentObserver();

View File

@ -226,7 +226,16 @@ parent:
*/ */
sync GetWidgetNativeData() returns (WindowsHandle value); sync GetWidgetNativeData() returns (WindowsHandle value);
SetCursor(uint32_t value); /**
* Set the native cursor.
* @param value
* The widget cursor to set.
* @param force
* Invalidate any locally cached cursor settings and force an
* update.
*/
SetCursor(uint32_t value, bool force);
SetBackgroundColor(nscolor color); SetBackgroundColor(nscolor color);
/** /**

View File

@ -1017,10 +1017,13 @@ TabParent::RecvAsyncMessage(const nsString& aMessage,
} }
bool bool
TabParent::RecvSetCursor(const uint32_t& aCursor) TabParent::RecvSetCursor(const uint32_t& aCursor, const bool& aForce)
{ {
nsCOMPtr<nsIWidget> widget = GetWidget(); nsCOMPtr<nsIWidget> widget = GetWidget();
if (widget) { if (widget) {
if (aForce) {
widget->ClearCachedCursor();
}
widget->SetCursor((nsCursor) aCursor); widget->SetCursor((nsCursor) aCursor);
} }
return true; return true;

View File

@ -168,7 +168,7 @@ public:
const int32_t& aCause, const int32_t& aCause,
const int32_t& aFocusChange) MOZ_OVERRIDE; const int32_t& aFocusChange) MOZ_OVERRIDE;
virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE; virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE;
virtual bool RecvSetCursor(const uint32_t& aValue) MOZ_OVERRIDE; virtual bool RecvSetCursor(const uint32_t& aValue, const bool& aForce) MOZ_OVERRIDE;
virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE; virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE;
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE; virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE;
virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible); virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible);

View File

@ -5,7 +5,7 @@
#include "nsISupports.idl" #include "nsISupports.idl"
#include "nsIDOMSmsSegmentInfo.idl" #include "nsIDOMSmsSegmentInfo.idl"
[scriptable, uuid(41db87b0-b0a1-11e3-a04f-cf487d837ee3)] [scriptable, uuid(0e6f8ace-cc59-11e3-aad5-e32847abfda1)]
interface nsIMobileMessageCallback : nsISupports interface nsIMobileMessageCallback : nsISupports
{ {
/** /**
@ -30,7 +30,7 @@ interface nsIMobileMessageCallback : nsISupports
* |message| can be nsIDOMMoz{Mms,Sms}Message. * |message| can be nsIDOMMoz{Mms,Sms}Message.
*/ */
void notifyMessageSent(in nsISupports message); void notifyMessageSent(in nsISupports message);
void notifySendMessageFailed(in long error); void notifySendMessageFailed(in long error, in nsISupports message);
/** /**
* |message| can be nsIDOMMoz{Mms,Sms}Message. * |message| can be nsIDOMMoz{Mms,Sms}Message.

View File

@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#include "DOMMobileMessageError.h"
#include "mozilla/dom/DOMMobileMessageErrorBinding.h"
#include "mozilla/dom/UnionTypes.h"
#include "nsIDOMMozMmsMessage.h"
#include "nsIDOMMozSmsMessage.h"
using namespace mozilla::dom;
NS_IMPL_CYCLE_COLLECTION_CLASS(DOMMobileMessageError)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DOMMobileMessageError, DOMError)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSms)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMms)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DOMMobileMessageError, DOMError)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSms)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMms)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMMobileMessageError)
NS_INTERFACE_MAP_END_INHERITING(DOMError)
NS_IMPL_ADDREF_INHERITED(DOMMobileMessageError, DOMError)
NS_IMPL_RELEASE_INHERITED(DOMMobileMessageError, DOMError)
DOMMobileMessageError::DOMMobileMessageError(nsPIDOMWindow* aWindow,
const nsAString& aName,
nsIDOMMozSmsMessage* aSms)
: DOMError(aWindow, aName)
, mSms(aSms)
, mMms(nullptr)
{
}
DOMMobileMessageError::DOMMobileMessageError(nsPIDOMWindow* aWindow,
const nsAString& aName,
nsIDOMMozMmsMessage* aMms)
: DOMError(aWindow, aName)
, mSms(nullptr)
, mMms(aMms)
{
}
void
DOMMobileMessageError::GetData(OwningMozSmsMessageOrMozMmsMessage& aRetVal) const
{
if (mSms) {
aRetVal.SetAsMozSmsMessage() = mSms;
return;
}
if (mMms) {
aRetVal.SetAsMozMmsMessage() = mMms;
return;
}
MOZ_ASSUME_UNREACHABLE("Bad object with invalid mSms and mMms.");
}
JSObject*
DOMMobileMessageError::WrapObject(JSContext* aCx)
{
return DOMMobileMessageErrorBinding::Wrap(aCx, this);
}

View File

@ -0,0 +1,45 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_dom_MobileMessageError_h
#define mozilla_dom_MobileMessageError_h
#include "mozilla/dom/DOMError.h"
class nsIDOMMozMmsMessage;
class nsIDOMMozSmsMessage;
namespace mozilla {
namespace dom {
class OwningMozSmsMessageOrMozMmsMessage;
class DOMMobileMessageError MOZ_FINAL : public DOMError
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMMobileMessageError, DOMError)
DOMMobileMessageError(nsPIDOMWindow* aWindow, const nsAString& aName,
nsIDOMMozSmsMessage* aSms);
DOMMobileMessageError(nsPIDOMWindow* aWindow, const nsAString& aName,
nsIDOMMozMmsMessage* aMms);
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
void GetData(OwningMozSmsMessageOrMozMmsMessage& aRetVal) const;
private:
nsCOMPtr<nsIDOMMozSmsMessage> mSms;
nsCOMPtr<nsIDOMMozMmsMessage> mMms;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_MobileMessageError_h

View File

@ -16,11 +16,57 @@
#include "xpcpublic.h" #include "xpcpublic.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsTArrayHelpers.h" #include "nsTArrayHelpers.h"
#include "DOMMobileMessageError.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
namespace mobilemessage { namespace mobilemessage {
static nsAutoString
ConvertErrorCodeToErrorString(int32_t aError)
{
nsAutoString errorStr;
switch (aError) {
case nsIMobileMessageCallback::NO_SIGNAL_ERROR:
errorStr = NS_LITERAL_STRING("NoSignalError");
break;
case nsIMobileMessageCallback::NOT_FOUND_ERROR:
errorStr = NS_LITERAL_STRING("NotFoundError");
break;
case nsIMobileMessageCallback::UNKNOWN_ERROR:
errorStr = NS_LITERAL_STRING("UnknownError");
break;
case nsIMobileMessageCallback::INTERNAL_ERROR:
errorStr = NS_LITERAL_STRING("InternalError");
break;
case nsIMobileMessageCallback::NO_SIM_CARD_ERROR:
errorStr = NS_LITERAL_STRING("NoSimCardError");
break;
case nsIMobileMessageCallback::RADIO_DISABLED_ERROR:
errorStr = NS_LITERAL_STRING("RadioDisabledError");
break;
case nsIMobileMessageCallback::INVALID_ADDRESS_ERROR:
errorStr = NS_LITERAL_STRING("InvalidAddressError");
break;
case nsIMobileMessageCallback::FDN_CHECK_ERROR:
errorStr = NS_LITERAL_STRING("FdnCheckError");
break;
case nsIMobileMessageCallback::NON_ACTIVE_SIM_CARD_ERROR:
errorStr = NS_LITERAL_STRING("NonActiveSimCardError");
break;
case nsIMobileMessageCallback::STORAGE_FULL_ERROR:
errorStr = NS_LITERAL_STRING("StorageFullError");
break;
case nsIMobileMessageCallback::SIM_NOT_MATCHED_ERROR:
errorStr = NS_LITERAL_STRING("SimNotMatchedError");
break;
default: // SUCCESS_NO_ERROR is handled above.
MOZ_CRASH("Should never get here!");
}
return errorStr;
}
NS_IMPL_ADDREF(MobileMessageCallback) NS_IMPL_ADDREF(MobileMessageCallback)
NS_IMPL_RELEASE(MobileMessageCallback) NS_IMPL_RELEASE(MobileMessageCallback)
@ -78,56 +124,26 @@ MobileMessageCallback::NotifySuccess(nsISupports *aMessage, bool aAsync)
} }
nsresult nsresult
MobileMessageCallback::NotifyError(int32_t aError, bool aAsync) MobileMessageCallback::NotifyError(int32_t aError, DOMError *aDetailedError, bool aAsync)
{ {
nsAutoString errorStr;
switch (aError) {
case nsIMobileMessageCallback::NO_SIGNAL_ERROR:
errorStr = NS_LITERAL_STRING("NoSignalError");
break;
case nsIMobileMessageCallback::NOT_FOUND_ERROR:
errorStr = NS_LITERAL_STRING("NotFoundError");
break;
case nsIMobileMessageCallback::UNKNOWN_ERROR:
errorStr = NS_LITERAL_STRING("UnknownError");
break;
case nsIMobileMessageCallback::INTERNAL_ERROR:
errorStr = NS_LITERAL_STRING("InternalError");
break;
case nsIMobileMessageCallback::NO_SIM_CARD_ERROR:
errorStr = NS_LITERAL_STRING("NoSimCardError");
break;
case nsIMobileMessageCallback::RADIO_DISABLED_ERROR:
errorStr = NS_LITERAL_STRING("RadioDisabledError");
break;
case nsIMobileMessageCallback::INVALID_ADDRESS_ERROR:
errorStr = NS_LITERAL_STRING("InvalidAddressError");
break;
case nsIMobileMessageCallback::FDN_CHECK_ERROR:
errorStr = NS_LITERAL_STRING("FdnCheckError");
break;
case nsIMobileMessageCallback::NON_ACTIVE_SIM_CARD_ERROR:
errorStr = NS_LITERAL_STRING("NonActiveSimCardError");
break;
case nsIMobileMessageCallback::STORAGE_FULL_ERROR:
errorStr = NS_LITERAL_STRING("StorageFullError");
break;
case nsIMobileMessageCallback::SIM_NOT_MATCHED_ERROR:
errorStr = NS_LITERAL_STRING("SimNotMatchedError");
break;
default: // SUCCESS_NO_ERROR is handled above.
MOZ_CRASH("Should never get here!");
}
if (aAsync) { if (aAsync) {
NS_ASSERTION(!aDetailedError,
"No Support to FireDetailedErrorAsync() in nsIDOMRequestService!");
nsCOMPtr<nsIDOMRequestService> rs = nsCOMPtr<nsIDOMRequestService> rs =
do_GetService(DOMREQUEST_SERVICE_CONTRACTID); do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
return rs->FireErrorAsync(mDOMRequest, errorStr); return rs->FireErrorAsync(mDOMRequest,
ConvertErrorCodeToErrorString(aError));
}
if (aDetailedError) {
mDOMRequest->FireDetailedError(aDetailedError);
} else {
mDOMRequest->FireError(ConvertErrorCodeToErrorString(aError));
} }
mDOMRequest->FireError(errorStr);
return NS_OK; return NS_OK;
} }
@ -138,9 +154,25 @@ MobileMessageCallback::NotifyMessageSent(nsISupports *aMessage)
} }
NS_IMETHODIMP NS_IMETHODIMP
MobileMessageCallback::NotifySendMessageFailed(int32_t aError) MobileMessageCallback::NotifySendMessageFailed(int32_t aError, nsISupports *aMessage)
{ {
return NotifyError(aError); nsRefPtr<DOMMobileMessageError> domMobileMessageError;
if (aMessage) {
nsAutoString errorStr = ConvertErrorCodeToErrorString(aError);
nsCOMPtr<nsIDOMMozSmsMessage> smsMsg = do_QueryInterface(aMessage);
if (smsMsg) {
domMobileMessageError =
new DOMMobileMessageError(mDOMRequest->GetOwner(), errorStr, smsMsg);
}
else {
nsCOMPtr<nsIDOMMozMmsMessage> mmsMsg = do_QueryInterface(aMessage);
domMobileMessageError =
new DOMMobileMessageError(mDOMRequest->GetOwner(), errorStr, mmsMsg);
}
NS_ASSERTION(domMobileMessageError, "Invalid DOMMobileMessageError!");
}
return NotifyError(aError, domMobileMessageError);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -211,7 +243,7 @@ MobileMessageCallback::NotifySegmentInfoForTextGot(nsIDOMMozSmsSegmentInfo *aInf
NS_IMETHODIMP NS_IMETHODIMP
MobileMessageCallback::NotifyGetSegmentInfoForTextFailed(int32_t aError) MobileMessageCallback::NotifyGetSegmentInfoForTextFailed(int32_t aError)
{ {
return NotifyError(aError, true); return NotifyError(aError, nullptr, true);
} }
NS_IMETHODIMP NS_IMETHODIMP

View File

@ -31,7 +31,7 @@ private:
nsresult NotifySuccess(JS::Handle<JS::Value> aResult, bool aAsync = false); nsresult NotifySuccess(JS::Handle<JS::Value> aResult, bool aAsync = false);
nsresult NotifySuccess(nsISupports *aMessage, bool aAsync = false); nsresult NotifySuccess(nsISupports *aMessage, bool aAsync = false);
nsresult NotifyError(int32_t aError, bool aAsync = false); nsresult NotifyError(int32_t aError, DOMError *aDetailedError = nullptr, bool aAsync = false);
}; };
} // namespace mobilemessage } // namespace mobilemessage

View File

@ -1955,8 +1955,7 @@ MmsService.prototype = {
.setMessageReadStatusByEnvelopeId(envelopeId, address, readStatus, .setMessageReadStatusByEnvelopeId(envelopeId, address, readStatus,
(function(aRv, aDomMessage) { (function(aRv, aDomMessage) {
if (!Components.isSuccessCode(aRv)) { if (!Components.isSuccessCode(aRv)) {
// Notifying observers the read status is error. if (DEBUG) debug("Failed to update read status: " + aRv);
Services.obs.notifyObservers(aDomMessage, kSmsReadSuccessObserverTopic, null);
return; return;
} }
@ -2171,7 +2170,7 @@ MmsService.prototype = {
// If the messsage has been deleted (because the sending process is // If the messsage has been deleted (because the sending process is
// cancelled), we don't need to reset the its delievery state/status. // cancelled), we don't need to reset the its delievery state/status.
if (aErrorCode == Ci.nsIMobileMessageCallback.NOT_FOUND_ERROR) { if (aErrorCode == Ci.nsIMobileMessageCallback.NOT_FOUND_ERROR) {
aRequest.notifySendMessageFailed(aErrorCode); aRequest.notifySendMessageFailed(aErrorCode, aDomMessage);
Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null); Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null);
return; return;
} }
@ -2188,7 +2187,7 @@ MmsService.prototype = {
// TODO bug 832140 handle !Components.isSuccessCode(aRv) // TODO bug 832140 handle !Components.isSuccessCode(aRv)
if (!isSentSuccess) { if (!isSentSuccess) {
if (DEBUG) debug("Sending MMS failed."); if (DEBUG) debug("Sending MMS failed.");
aRequest.notifySendMessageFailed(aErrorCode); aRequest.notifySendMessageFailed(aErrorCode, aDomMessage);
Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null); Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null);
return; return;
} }
@ -2214,7 +2213,8 @@ MmsService.prototype = {
if (!Components.isSuccessCode(aRv)) { if (!Components.isSuccessCode(aRv)) {
if (DEBUG) debug("Error! Fail to save sending message! rv = " + aRv); if (DEBUG) debug("Error! Fail to save sending message! rv = " + aRv);
aRequest.notifySendMessageFailed( aRequest.notifySendMessageFailed(
gMobileMessageDatabaseService.translateCrErrorToMessageCallbackError(aRv)); gMobileMessageDatabaseService.translateCrErrorToMessageCallbackError(aRv),
aDomMessage);
Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null); Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null);
return; return;
} }

View File

@ -8,6 +8,8 @@ include protocol PSms;
include protocol PBlob; include protocol PBlob;
include SmsTypes; include SmsTypes;
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
namespace mobilemessage { namespace mobilemessage {
@ -28,9 +30,16 @@ struct ReplyMessageSend
MobileMessageData messageData; MobileMessageData messageData;
}; };
union OptionalMobileMessageData
{
void_t;
MobileMessageData;
};
struct ReplyMessageSendFail struct ReplyMessageSendFail
{ {
int32_t error; int32_t error;
OptionalMobileMessageData messageData;
}; };
struct ReplyGetMessage struct ReplyGetMessage

View File

@ -191,8 +191,18 @@ SmsRequestChild::Recv__delete__(const MessageReply& aReply)
mReplyRequest->NotifyMessageSent(msg); mReplyRequest->NotifyMessageSent(msg);
} }
break; break;
case MessageReply::TReplyMessageSendFail: case MessageReply::TReplyMessageSendFail: {
mReplyRequest->NotifySendMessageFailed(aReply.get_ReplyMessageSendFail().error()); const ReplyMessageSendFail &replyFail = aReply.get_ReplyMessageSendFail();
nsCOMPtr<nsISupports> msg;
if (replyFail.messageData().type() ==
OptionalMobileMessageData::TMobileMessageData) {
msg = CreateMessageFromMessageData(
replyFail.messageData().get_MobileMessageData());
}
mReplyRequest->NotifySendMessageFailed(replyFail.error(), msg);
}
break; break;
case MessageReply::TReplyGetMessage: { case MessageReply::TReplyGetMessage: {
const MobileMessageData& data = const MobileMessageData& data =

View File

@ -126,6 +126,40 @@ GetParamsFromSendMmsMessageRequest(JSContext* aCx,
return true; return true;
} }
static bool
GetMobileMessageDataFromMessage(ContentParent* aParent,
nsISupports *aMsg,
MobileMessageData &aData)
{
if (!aMsg) {
NS_WARNING("Invalid message to convert!");
return false;
}
nsCOMPtr<nsIDOMMozMmsMessage> mmsMsg = do_QueryInterface(aMsg);
if (mmsMsg) {
if (!aParent) {
NS_ERROR("Invalid ContentParent to convert MMS Message!");
return false;
}
MmsMessageData data;
if (!static_cast<MmsMessage*>(mmsMsg.get())->GetData(aParent, data)) {
return false;
}
aData = data;
return true;
}
nsCOMPtr<nsIDOMMozSmsMessage> smsMsg = do_QueryInterface(aMsg);
if (smsMsg) {
aData = static_cast<SmsMessage*>(smsMsg.get())->GetData();
return true;
}
NS_WARNING("Cannot get MobileMessageData");
return false;
}
NS_IMPL_ISUPPORTS(SmsParent, nsIObserver) NS_IMPL_ISUPPORTS(SmsParent, nsIObserver)
SmsParent::SmsParent() SmsParent::SmsParent()
@ -172,9 +206,11 @@ NS_IMETHODIMP
SmsParent::Observe(nsISupports* aSubject, const char* aTopic, SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) const char16_t* aData)
{ {
ContentParent *parent = static_cast<ContentParent*>(Manager());
if (!strcmp(aTopic, kSmsReceivedObserverTopic)) { if (!strcmp(aTopic, kSmsReceivedObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-received' topic without a valid message!"); NS_ERROR("Got a 'sms-received' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -185,7 +221,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsRetrievingObserverTopic)) { if (!strcmp(aTopic, kSmsRetrievingObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-retrieving' topic without a valid message!"); NS_ERROR("Got a 'sms-retrieving' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -196,7 +232,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsSendingObserverTopic)) { if (!strcmp(aTopic, kSmsSendingObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-sending' topic without a valid message!"); NS_ERROR("Got a 'sms-sending' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -207,7 +243,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsSentObserverTopic)) { if (!strcmp(aTopic, kSmsSentObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-sent' topic without a valid message!"); NS_ERROR("Got a 'sms-sent' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -218,7 +254,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsFailedObserverTopic)) { if (!strcmp(aTopic, kSmsFailedObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-failed' topic without a valid message!"); NS_ERROR("Got a 'sms-failed' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -229,7 +265,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsDeliverySuccessObserverTopic)) { if (!strcmp(aTopic, kSmsDeliverySuccessObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-sending' topic without a valid message!"); NS_ERROR("Got a 'sms-sending' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -240,7 +276,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsDeliveryErrorObserverTopic)) { if (!strcmp(aTopic, kSmsDeliveryErrorObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-delivery-error' topic without a valid message!"); NS_ERROR("Got a 'sms-delivery-error' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -267,10 +303,9 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK; return NS_OK;
} }
if (!strcmp(aTopic, kSmsReadSuccessObserverTopic)) { if (!strcmp(aTopic, kSmsReadSuccessObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-read-success' topic without a valid message!"); NS_ERROR("Got a 'sms-read-success' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -281,7 +316,7 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
if (!strcmp(aTopic, kSmsReadErrorObserverTopic)) { if (!strcmp(aTopic, kSmsReadErrorObserverTopic)) {
MobileMessageData msgData; MobileMessageData msgData;
if (!GetMobileMessageDataFromMessage(aSubject, msgData)) { if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
NS_ERROR("Got a 'sms-read-error' topic without a valid message!"); NS_ERROR("Got a 'sms-read-error' topic without a valid message!");
return NS_OK; return NS_OK;
} }
@ -294,31 +329,6 @@ SmsParent::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK; return NS_OK;
} }
bool
SmsParent::GetMobileMessageDataFromMessage(nsISupports *aMsg,
MobileMessageData &aData)
{
nsCOMPtr<nsIDOMMozMmsMessage> mmsMsg = do_QueryInterface(aMsg);
if (mmsMsg) {
MmsMessageData data;
ContentParent *parent = static_cast<ContentParent*>(Manager());
if (!static_cast<MmsMessage*>(mmsMsg.get())->GetData(parent, data)) {
return false;
}
aData = data;
return true;
}
nsCOMPtr<nsIDOMMozSmsMessage> smsMsg = do_QueryInterface(aMsg);
if (smsMsg) {
aData = static_cast<SmsMessage*>(smsMsg.get())->GetData();
return true;
}
NS_WARNING("Cannot get MobileMessageData");
return false;
}
bool bool
SmsParent::RecvAddSilentNumber(const nsString& aNumber) SmsParent::RecvAddSilentNumber(const nsString& aNumber)
{ {
@ -619,30 +629,27 @@ SmsRequestParent::NotifyMessageSent(nsISupports *aMessage)
{ {
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE); NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMMozMmsMessage> mms = do_QueryInterface(aMessage); ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
if (mms) { MobileMessageData data;
MmsMessage *msg = static_cast<MmsMessage*>(mms.get()); if (GetMobileMessageDataFromMessage(parent, aMessage, data)) {
ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager()); return SendReply(ReplyMessageSend(data));
MmsMessageData data;
if (!msg->GetData(parent, data)) {
return NS_ERROR_FAILURE;
}
return SendReply(ReplyMessageSend(MobileMessageData(data)));
}
nsCOMPtr<nsIDOMMozSmsMessage> sms = do_QueryInterface(aMessage);
if (sms) {
SmsMessage* msg = static_cast<SmsMessage*>(sms.get());
return SendReply(ReplyMessageSend(MobileMessageData(msg->GetData())));
} }
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
NS_IMETHODIMP NS_IMETHODIMP
SmsRequestParent::NotifySendMessageFailed(int32_t aError) SmsRequestParent::NotifySendMessageFailed(int32_t aError, nsISupports *aMessage)
{ {
return SendReply(ReplyMessageSendFail(aError)); NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
MobileMessageData data;
if (!GetMobileMessageDataFromMessage(parent, aMessage, data)) {
return SendReply(ReplyMessageSendFail(aError, OptionalMobileMessageData(void_t())));
}
return SendReply(ReplyMessageSendFail(aError, OptionalMobileMessageData(data)));
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -650,21 +657,10 @@ SmsRequestParent::NotifyMessageGot(nsISupports *aMessage)
{ {
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE); NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMMozMmsMessage> mms = do_QueryInterface(aMessage); ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
if (mms) { MobileMessageData data;
MmsMessage *msg = static_cast<MmsMessage*>(mms.get()); if (GetMobileMessageDataFromMessage(parent, aMessage, data)) {
ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager()); return SendReply(ReplyGetMessage(data));
MmsMessageData data;
if (!msg->GetData(parent, data)) {
return NS_ERROR_FAILURE;
}
return SendReply(ReplyGetMessage(MobileMessageData(data)));
}
nsCOMPtr<nsIDOMMozSmsMessage> sms = do_QueryInterface(aMessage);
if (sms) {
SmsMessage* msg = static_cast<SmsMessage*>(sms.get());
return SendReply(ReplyGetMessage(MobileMessageData(msg->GetData())));
} }
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;

Some files were not shown because too many files have changed in this diff Show More