From 58a735a27a6e654ff8f5421427fe79adaa69846a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 14:05:48 -0700 Subject: [PATCH 01/79] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/171a802a78fd Author: Olle Klang Desc: Bug 1069840 - Update apps links to fetch shared style from default theme r=vingtetun ======== https://hg.mozilla.org/integration/gaia-central/rev/9f6bb27f0bb2 Author: Kevin Grandon Desc: Revert "Update links to fetch gaia-theme from default theme." This reverts commit 2896d5ff8e3b531c3d26b216102ebe55f0cfb5d0. ======== https://hg.mozilla.org/integration/gaia-central/rev/8bcf65a3bdfd Author: Marshall Culpepper Desc: Merge pull request #24844 from marshall/bug1070858_appUsageOnline Bug 1070858: [AppUsageMetrics] Track online status through navigator.onLine ======== https://hg.mozilla.org/integration/gaia-central/rev/a4cf07e8db23 Author: Marshall Culpepper Desc: Bug 1070858: [AppUsageMetrics] Track online status through navigator.onLine r=djf --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 105054c334f9..5e77351006b6 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "9d8c254abad2ceaad8f1ae22a18e0f36af5860c4", + "revision": "171a802a78fde72d16979d5eb0f4c8618ff91b8e", "repo_path": "/integration/gaia-central" } From e54772664f8ffe38f13ac74e1f94eccbd6f00562 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 14:11:56 -0700 Subject: [PATCH 02/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index e2da6de1c320..3cc5512828ba 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 50bf6b9c3e9e..07297486abf3 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 99145ac7b72f..0254f26a75de 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index cd274075775c..0198f3d6cd44 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 50bf6b9c3e9e..07297486abf3 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index a22138fcb6e8..d9279fc54f4c 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index bafabc7ccabb..cc828fd85ddc 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e31d550dc9fd..883f22fdb946 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 6c4807bfe5e6..6578efd921e0 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 661222c10b5e..c9033ab31094 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 71807a173e3d..260b0696500d 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 907726a532f7c75cafb13b0d5e272a0e4720ee1d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 14:20:47 -0700 Subject: [PATCH 03/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3759d8a4b1b5 Author: sv99 Desc: Bug 1066988 - [clock] unittest picker_test.js using assert.include for testing object, not Array or string r=mcav ======== https://hg.mozilla.org/integration/gaia-central/rev/b7b3c15c6f64 Author: Kevin Grandon Desc: Revert "[clock] unittest picker_test.js using assert.include for testing object, not Array or string" This reverts commit a87b3bc0871ce34ea5305b1012d11fb5088cc6b9. This commit was from bug 1066988. Reverting due to not having a proper bug number listed in the commit message. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5e77351006b6..a47e69b12cf8 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "171a802a78fde72d16979d5eb0f4c8618ff91b8e", + "revision": "3759d8a4b1b5adeccda85e1f0aa192c476833048", "repo_path": "/integration/gaia-central" } From c0cbb9c6effb493b47221b06b9aa5c5910351c0a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 14:26:54 -0700 Subject: [PATCH 04/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 3cc5512828ba..c294d9a611cb 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 07297486abf3..3d18e044693b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0254f26a75de..2959b17baa5d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 0198f3d6cd44..a5cbd23f80cd 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 07297486abf3..3d18e044693b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d9279fc54f4c..c436c36ffe81 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index cc828fd85ddc..a7be5982291d 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 883f22fdb946..79de5f6014f6 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 6578efd921e0..3e7ba87668a9 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index c9033ab31094..1cf178d86b2c 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 260b0696500d..8484ee502bb8 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 745b781bde5d544a995bd1fb476ab4839b2f821c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 17:40:47 -0700 Subject: [PATCH 05/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/7a5da83d3763 Author: Yura Zenevich Desc: Merge pull request #24863 from jobara/1069380 Bug 1069380 - Use link role instead of button for open action in cards view ======== https://hg.mozilla.org/integration/gaia-central/rev/a39c47800a74 Author: Justin Obara Desc: Bug 1069380 - Use link role instead of button for open action in cards view Changes the button role on the screenshotView to link, and adds the aria-hidden=true attribute to the iconButton to hide it from AT's. Added tests to ensure the aria properties in the cards view. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index a47e69b12cf8..714e4d92e82b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3759d8a4b1b5adeccda85e1f0aa192c476833048", + "revision": "7a5da83d3763ecf95dc1a6b973fbbf663626e6f1", "repo_path": "/integration/gaia-central" } From c5bdb361ec4b7d1ade888a5e6bccf8417ba4a9bc Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 17:47:01 -0700 Subject: [PATCH 06/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index c294d9a611cb..e2deb583a1f9 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3d18e044693b..4958c176747b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 2959b17baa5d..1cc990ea7216 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index a5cbd23f80cd..d7d9e8a5ffac 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3d18e044693b..4958c176747b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index c436c36ffe81..9c366cc87ebb 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index a7be5982291d..543c90e3f34b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 79de5f6014f6..5e4d8e0470a2 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 3e7ba87668a9..798df86f65f8 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 1cf178d86b2c..e444cfa27f29 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 8484ee502bb8..7736a02e8cd4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From a6806563b02876d897d13598428fd7e1dc339e2c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 18:10:48 -0700 Subject: [PATCH 07/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/32c4c785e4b1 Author: Douglas Sherk Desc: Merge pull request #24909 from DouglasSherk/1077331-system-call-vibrate Bug 1077331 - Only seek ringtone back to start on ringtone if the file is loaded fully enough to seek. r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/75e99a7c5d01 Author: Doug Sherk Desc: Bug 1077331 - Only seek ringtone back to start on ringtone if the file is loaded fully enough to seek. r=etienne --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 714e4d92e82b..e82e44a3a65a 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "7a5da83d3763ecf95dc1a6b973fbbf663626e6f1", + "revision": "32c4c785e4b1e2a939d52780936af69206e8f3b1", "repo_path": "/integration/gaia-central" } From d12abe2749b2d0e6b17945d0196ed60d0e8dcc78 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 18:17:02 -0700 Subject: [PATCH 08/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index e2deb583a1f9..40acabbc8dd4 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4958c176747b..38616b27b311 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1cc990ea7216..8e17fbd11b6b 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index d7d9e8a5ffac..4231c671e1f1 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4958c176747b..38616b27b311 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 9c366cc87ebb..874102c8f075 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 543c90e3f34b..facd29b178f6 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 5e4d8e0470a2..0797dee67c4d 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 798df86f65f8..2cbba7058286 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e444cfa27f29..124bcbc8e815 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 7736a02e8cd4..a04a1494901f 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 15beb5afe9266336ced152683376b06e45c52996 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 19:45:55 -0700 Subject: [PATCH 09/79] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ce8d9929df2a Author: Arthur Chen Desc: Merge pull request #24681 from crh0716/1036210 Bug 1036210 - Recover the automatic connection once the manual connecon is failed r=eragonj ======== https://hg.mozilla.org/integration/gaia-central/rev/adb6473de5d1 Author: Arthur Chen Desc: Bug 1036210 - Recover the automatic connection once the manual connection is failed ======== https://hg.mozilla.org/integration/gaia-central/rev/a56cf66b5c79 Author: Kevin Grandon Desc: Merge pull request #24963 from KevinGrandon/bug_1080285_keyboard_test_mock_dimensions Bug 1080285 - [Keyboard] Mock test dimensions so it will pass in any environment ======== https://hg.mozilla.org/integration/gaia-central/rev/776c0552b706 Author: Kevin Grandon Desc: Bug 1080285 - [Keyboard] Mock test dimensions so it will pass in any environment r=rudyl --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e82e44a3a65a..5daaf40fc718 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "32c4c785e4b1e2a939d52780936af69206e8f3b1", + "revision": "ce8d9929df2a78cf34d2cd2e84ba9bd04964eabe", "repo_path": "/integration/gaia-central" } From d43cca19df70d08fbccbe007d55f9d1140838a68 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 19:52:04 -0700 Subject: [PATCH 10/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 40acabbc8dd4..9052ff0a4561 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 38616b27b311..8c3b1e32705b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 8e17fbd11b6b..b89bbe781a14 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 4231c671e1f1..211ecbdbe0dc 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 38616b27b311..8c3b1e32705b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 874102c8f075..e5e9ad3fe710 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index facd29b178f6..f408b95d0fb1 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 0797dee67c4d..f0850007efb1 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 2cbba7058286..0e10feadb4d4 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 124bcbc8e815..0d4cb48d2e38 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a04a1494901f..8b4f63d2d02d 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From c6d1356864596b9ac851dfa9ec79a512209afb5f Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 20:15:55 -0700 Subject: [PATCH 11/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3ae04d30216f Author: Rudy Lu Desc: Merge pull request #24912 from huskyomega/bug1074774 Bug 1074774 - Backspace is very slow when deleting multiple words. r=rudylu ======== https://hg.mozilla.org/integration/gaia-central/rev/7537f99349c9 Author: huskyomega Desc: Bug 1074774 - Backspace is very slow when deleting multiple words. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5daaf40fc718..be46aa4b219c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ce8d9929df2a78cf34d2cd2e84ba9bd04964eabe", + "revision": "3ae04d30216ff5c53acc8e9d939843c7accb4940", "repo_path": "/integration/gaia-central" } From 66486aeecf88a3502128d657eb0d17123aa2754a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 20:22:05 -0700 Subject: [PATCH 12/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 9052ff0a4561..ad6ea0e0f3e6 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8c3b1e32705b..5e0c8fb6616f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index b89bbe781a14..bc4f125cacdf 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 211ecbdbe0dc..5d0be867a1d9 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8c3b1e32705b..5e0c8fb6616f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e5e9ad3fe710..f3bc57fa4b40 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index f408b95d0fb1..c7a3e1c527a9 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index f0850007efb1..52853a69d466 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0e10feadb4d4..e95ab7796e89 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 0d4cb48d2e38..84a8f3963ce8 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 8b4f63d2d02d..258835bfebd8 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 548a3364acae55da3057ab5cd436976cd8a8ef48 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 20:30:47 -0700 Subject: [PATCH 13/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ff71fccdde25 Author: Timothy Guan-tin Chien Desc: Merge pull request #24928 from timdream/softbutton-focus Bug 1078822 - Prevent the software home button from receiving focus, r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/288c308e7936 Author: Timothy Guan-tin Chien Desc: Bug 1078822 - Prevent the software home button from receving focus --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index be46aa4b219c..b0ff41f642e8 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3ae04d30216ff5c53acc8e9d939843c7accb4940", + "revision": "ff71fccdde254f39f5c1c39f33a866b7f10b638c", "repo_path": "/integration/gaia-central" } From d896be7b54eee961e229127647c4c6020b61bcd6 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 20:36:56 -0700 Subject: [PATCH 14/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ad6ea0e0f3e6..26c05faf3680 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5e0c8fb6616f..8f0942535b2d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index bc4f125cacdf..99d578da8ec2 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 5d0be867a1d9..b6e7623be408 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5e0c8fb6616f..8f0942535b2d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index f3bc57fa4b40..2eab81732242 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c7a3e1c527a9..32ade535f76c 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 52853a69d466..823576b6eeb7 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e95ab7796e89..0728ddae4078 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 84a8f3963ce8..0aa9ce2323b1 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 258835bfebd8..51c99f74f1e1 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 148500f1216dbe70eb4344459a333736635fd2dd Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 20:45:54 -0700 Subject: [PATCH 15/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/5f3e2f2ac117 Author: Douglas Sherk Desc: Merge pull request #24429 from dwi2/bug1070808 Bug 1074601 - Take SIM card 2 into consideration when checking voicemail number r=drs ======== https://hg.mozilla.org/integration/gaia-central/rev/77a20105c1b6 Author: Tzu-Lin Huang Desc: Bug 1070808 - Take SIM card 2 into consideration when checking voicemail number --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index b0ff41f642e8..9436a14b9f20 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ff71fccdde254f39f5c1c39f33a866b7f10b638c", + "revision": "5f3e2f2ac1174d8a05cee700f4233ffdf9cdf305", "repo_path": "/integration/gaia-central" } From 6204e45784d751fdaecf83a50b961820590b256d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 20:52:04 -0700 Subject: [PATCH 16/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 26c05faf3680..3b3753f6eb4e 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8f0942535b2d..496f60798348 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 99d578da8ec2..a92e8e15237f 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index b6e7623be408..94d89e8a5f17 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8f0942535b2d..496f60798348 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 2eab81732242..e66aa27d2ab9 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 32ade535f76c..0514811ed7f5 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 823576b6eeb7..f39e0bb467bf 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0728ddae4078..d90b13b75cdb 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 0aa9ce2323b1..38eb52eae697 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 51c99f74f1e1..f398adc05b7a 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From dec553bc50cac020eca0b76d38072f41a9aecaef Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 21:15:56 -0700 Subject: [PATCH 17/79] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/a414d4dbf1a0 Author: Diego Marcos Desc: Merge pull request #24955 from dmarcos/bug1003381 Bug 1003381 - [camera] confirmation text needed when switching modes ======== https://hg.mozilla.org/integration/gaia-central/rev/e76857e0af3e Author: Diego Marcos Desc: Bug 1003381 - [camera] confirmation text needed when switching modes ======== https://hg.mozilla.org/integration/gaia-central/rev/614784fccf95 Author: John Lu [:mnjul] Desc: Revert "Merge pull request #24743 from mnjul/bug_1075970_no_highlight_after_switching_inputtypes" This reverts commit 1d153c6a9fbbdf50191673d92b3d2aa24d17cb31, reversing changes made to 4b2e5330253adc22d64d3ac5114e3f2ae33a9b81. Conflicts: apps/keyboard/test/unit/render_test.js --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 9436a14b9f20..0f485118bc81 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "5f3e2f2ac1174d8a05cee700f4233ffdf9cdf305", + "revision": "a414d4dbf1a06e37552ee122dbfa3795dd463342", "repo_path": "/integration/gaia-central" } From e07078842449b964b8e0cca174e6654eee1b3d47 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 21:22:05 -0700 Subject: [PATCH 18/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 3b3753f6eb4e..328f012c4b37 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 496f60798348..f4fcb35c1c23 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a92e8e15237f..f59066855331 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 94d89e8a5f17..d8fd0a0a4872 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 496f60798348..f4fcb35c1c23 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e66aa27d2ab9..d37d972efd42 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 0514811ed7f5..5dc228be6d8c 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index f39e0bb467bf..e8bed8d25caa 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index d90b13b75cdb..58136b7fd936 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 38eb52eae697..2a5c1e349262 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index f398adc05b7a..2a2a8e2e36fc 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 13c60fd4af8cf253adcd3dc87c8c8c06d8e3bbf9 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 21:30:48 -0700 Subject: [PATCH 19/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3f7b863e17cf Author: Michael Henretty Desc: Merge pull request #24857 from mikehenrty/bug-1074123-layout-shb Bug 1074123 - Make modal dialogs use layout manager, remove SHB css work... ======== https://hg.mozilla.org/integration/gaia-central/rev/9edcb5b81df6 Author: Michael Henretty Desc: Bug 1074123 - Make modal dialogs use layout manager, remove SHB css workarounds --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0f485118bc81..5de348307828 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "a414d4dbf1a06e37552ee122dbfa3795dd463342", + "revision": "3f7b863e17cfd506851ab3a9cddc83e2dda7be14", "repo_path": "/integration/gaia-central" } From 8d77eb276ceef9a22fc846b50e954f918635c3ec Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 21:32:35 -0700 Subject: [PATCH 20/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 328f012c4b37..dbe04fef69a8 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index f4fcb35c1c23..147c5783967f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index f59066855331..9148aa5e4ef1 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index d8fd0a0a4872..01548dceeef6 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index f4fcb35c1c23..147c5783967f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d37d972efd42..ef90b0af50b4 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5dc228be6d8c..620b40258be1 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e8bed8d25caa..54f0bd57ba16 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 58136b7fd936..ab07124256ac 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 2a5c1e349262..a75934857849 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2a2a8e2e36fc..2a9129f3f0ea 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 3407b2f000df1b34c08fe827971595b3f6df6fb0 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 22:00:49 -0700 Subject: [PATCH 21/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3e37a2b88f0e Author: Kevin Grandon Desc: Merge pull request #24962 from KevinGrandon/bug_1080283_notification_launch_app_wait Bug 1080283 - Add wait in notification_launch_app_test ======== https://hg.mozilla.org/integration/gaia-central/rev/6f0feacc5ead Author: Kevin Grandon Desc: Bug 1080283 - Add wait in notification_launch_app_test r=kgrandon --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5de348307828..07e6cba6eeb3 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3f7b863e17cfd506851ab3a9cddc83e2dda7be14", + "revision": "3e37a2b88f0e785cbdce36dc44be7697dc80762e", "repo_path": "/integration/gaia-central" } From 62c386d2fc4b32ab400d35fbe8bacf07b4ad53d3 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 22:02:34 -0700 Subject: [PATCH 22/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index dbe04fef69a8..7230d97a93e4 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 147c5783967f..47eeb47dccf3 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 9148aa5e4ef1..1985ca0cb2d6 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 01548dceeef6..260c93aa8bab 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 147c5783967f..47eeb47dccf3 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index ef90b0af50b4..7dc1ef95bc65 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 620b40258be1..d6d37bef8c94 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 54f0bd57ba16..52158acd596c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index ab07124256ac..f872c6426852 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index a75934857849..dde1613ad3d2 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2a9129f3f0ea..17f4bccb8625 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 7daaf6a434d660eeefb5f5b6038fd53da7ae2707 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 22:30:48 -0700 Subject: [PATCH 23/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/33aa6fa877e4 Author: Alive.Kuo Desc: Merge pull request #24424 from alivedise/bugzilla/1072757/settings-service-core Bug 1072757 - Implement SettingsCore, r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/9bd78222e6e3 Author: Alive Kuo Desc: Bug 1072757 - Implement SettingsCore, BaseModule, Service Registration System --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 07e6cba6eeb3..c97a6aad9b9b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3e37a2b88f0e785cbdce36dc44be7697dc80762e", + "revision": "33aa6fa877e48ccbcaaaeec6ff0b08d2c15aa6a6", "repo_path": "/integration/gaia-central" } From 968af7f97aa08ae179228cd6ca6bd80fcfdd5f8e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 22:36:57 -0700 Subject: [PATCH 24/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 7230d97a93e4..96fb8590162b 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 47eeb47dccf3..b63f0655927d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1985ca0cb2d6..73c4e51c36c4 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 260c93aa8bab..448c02618490 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 47eeb47dccf3..b63f0655927d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 7dc1ef95bc65..0e9f7775bb8f 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index d6d37bef8c94..4e810882953e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 52158acd596c..90704d4b9fa7 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index f872c6426852..af83ca7085c6 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index dde1613ad3d2..5f72aa630990 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 17f4bccb8625..b69c53f67e00 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ecdd88e5f86a9f17c572372924ecec765901dc3d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 23:15:53 -0700 Subject: [PATCH 25/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/e3849c7faaac Author: Kevin Grandon Desc: Merge pull request #24971 from KevinGrandon/bug_1080348_keyboard_testing_path Bug 1080348 - Failing TC Gu test: keyboard-test/unit/mock_navigator_input_method_test.js ======== https://hg.mozilla.org/integration/gaia-central/rev/8d039aad7465 Author: Kevin Grandon Desc: Bug 1080348 - Failing TC Gu test: keyboard-test/unit/mock_navigator_input_method_test.js r=kgrandon --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c97a6aad9b9b..893635e3538d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "33aa6fa877e48ccbcaaaeec6ff0b08d2c15aa6a6", + "revision": "e3849c7faaacf1526427b9600783d22138a9d4cd", "repo_path": "/integration/gaia-central" } From 4c832c56120afc00a348b90eb241a2c3b2e0ae74 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Wed, 8 Oct 2014 23:22:02 -0700 Subject: [PATCH 26/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 96fb8590162b..523f085e8112 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index b63f0655927d..d38e5f373743 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 73c4e51c36c4..bd795df0d394 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 448c02618490..4c48ab6c45b4 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index b63f0655927d..d38e5f373743 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 0e9f7775bb8f..891ce8ad7220 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 4e810882953e..b167d1f32608 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 90704d4b9fa7..b3ea1f77a5d2 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index af83ca7085c6..43d41866b52a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 5f72aa630990..4eda9d41cb01 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b69c53f67e00..c59908b9bb3f 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 481488c8d2854f470805100687a2bd5b0362ce79 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 01:00:48 -0700 Subject: [PATCH 27/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/0a70d3399de1 Author: lissyx Desc: Merge pull request #24936 from lissyx/bug1079758 Bug 1079758 - Notify user of log capture start r=janx ======== https://hg.mozilla.org/integration/gaia-central/rev/fd33057c0423 Author: Alexandre Lissy Desc: Bug 1079758 - Notify user of log capture start --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 893635e3538d..c566422951f7 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e3849c7faaacf1526427b9600783d22138a9d4cd", + "revision": "0a70d3399de1adeaf194b8ff82dc02b60ce0e9a3", "repo_path": "/integration/gaia-central" } From 0a1aeb1a6073be4af27b5120310f8743b30b638d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 01:06:57 -0700 Subject: [PATCH 28/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 523f085e8112..9ae4386ad5f9 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index d38e5f373743..1a32575a0f2b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index bd795df0d394..fc1a4ebb57b9 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 4c48ab6c45b4..c1e35a10e4a5 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index d38e5f373743..1a32575a0f2b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 891ce8ad7220..6afbe1aac523 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index b167d1f32608..b24aeec57c9e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b3ea1f77a5d2..23045536fb3f 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 43d41866b52a..170d1ebcf1cb 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 4eda9d41cb01..991897512aaf 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index c59908b9bb3f..86355fb9562a 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From b3b1596c437eb6ac92af68c78c702693f35eb127 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 01:45:54 -0700 Subject: [PATCH 29/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/f82b8beab4ea Author: Salvador de la Puente González Desc: Merge pull request #24849 from marshall/bug1064491_smartDataUsageTotal Bug 1064491: Request per-app data usage after first requesting total data usage r=salva ======== https://hg.mozilla.org/integration/gaia-central/rev/43a6de6f758d Author: Marshall Culpepper Desc: Bug 1064491: Request per-app data usage after first requesting total data usage. r=salva --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c566422951f7..8b00b7685b3b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "0a70d3399de1adeaf194b8ff82dc02b60ce0e9a3", + "revision": "f82b8beab4ea64031c5d11c7d83abab89539a23f", "repo_path": "/integration/gaia-central" } From 5bd1ffe804b1f87bca245c66fb0c4f352eaf46f6 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 01:52:01 -0700 Subject: [PATCH 30/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 9ae4386ad5f9..426ce3027f54 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 1a32575a0f2b..444c5f6947f7 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index fc1a4ebb57b9..edd971407a3c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index c1e35a10e4a5..92197ff59688 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 1a32575a0f2b..444c5f6947f7 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 6afbe1aac523..b95ff1468935 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index b24aeec57c9e..5e02d7b5f32c 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 23045536fb3f..961831be25e5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 170d1ebcf1cb..bbb4f86aa945 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 991897512aaf..a77084494e90 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 86355fb9562a..76c609b5fa3d 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 643d379c50493f897d6b89f912f1be4778b2841b Mon Sep 17 00:00:00 2001 From: Jamin Liu Date: Thu, 9 Oct 2014 17:54:38 +0800 Subject: [PATCH 31/79] Bug 1052304 - Notify OPP manager when Bluetooth socket message error occurs. r=btian --- dom/bluetooth/bluedroid/BluetoothSocket.cpp | 33 +++++++++++++++++-- .../bluedroid/BluetoothSocketHALInterface.cpp | 4 +-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/dom/bluetooth/bluedroid/BluetoothSocket.cpp b/dom/bluetooth/bluedroid/BluetoothSocket.cpp index fa6cf0eaa6c1..4b89d23c17d9 100644 --- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp +++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp @@ -368,6 +368,11 @@ public: return; } + if (aConnectionStatus != 0) { + mImpl->mConsumer->NotifyError(); + return; + } + mImpl->mConsumer->SetAddress(aBdAddress); XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new AcceptTask(mImpl, aFd)); } @@ -376,6 +381,14 @@ public: { MOZ_ASSERT(NS_IsMainThread()); BT_LOGR("BluetoothSocketInterface::Accept failed: %d", (int)aStatus); + + if (!mImpl->IsShutdownOnMainThread()) { + // Instead of NotifyError(), call NotifyDisconnect() to trigger + // BluetoothOppManager::OnSocketDisconnect() as + // DroidSocketImpl::OnFileCanReadWithoutBlocking() in Firefox OS 2.0 in + // order to keep the same behavior and reduce regression risk. + mImpl->mConsumer->NotifyDisconnect(); + } } private: @@ -504,9 +517,17 @@ public: { MOZ_ASSERT(NS_IsMainThread()); - if (!mImpl->IsShutdownOnMainThread()) { - mImpl->mConsumer->SetAddress(aBdAddress); + if (mImpl->IsShutdownOnMainThread()) { + BT_LOGD("mConsumer is null, aborting send!"); + return; } + + if (aConnectionStatus != 0) { + mImpl->mConsumer->NotifyError(); + return; + } + + mImpl->mConsumer->SetAddress(aBdAddress); XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketConnectTask(mImpl, aFd)); } @@ -515,6 +536,14 @@ public: { MOZ_ASSERT(NS_IsMainThread()); BT_WARNING("Connect failed: %d", (int)aStatus); + + if (!mImpl->IsShutdownOnMainThread()) { + // Instead of NotifyError(), call NotifyDisconnect() to trigger + // BluetoothOppManager::OnSocketDisconnect() as + // DroidSocketImpl::OnFileCanReadWithoutBlocking() in Firefox OS 2.0 in + // order to keep the same behavior and reduce regression risk. + mImpl->mConsumer->NotifyDisconnect(); + } } private: diff --git a/dom/bluetooth/bluedroid/BluetoothSocketHALInterface.cpp b/dom/bluetooth/bluedroid/BluetoothSocketHALInterface.cpp index 4d9a33f58cee..a024dd794203 100644 --- a/dom/bluetooth/bluedroid/BluetoothSocketHALInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothSocketHALInterface.cpp @@ -286,7 +286,7 @@ private: msg.msg_iovlen = 1; ssize_t res = TEMP_FAILURE_RETRY(recvmsg(mFd, &msg, MSG_NOSIGNAL)); - if (res < 0) { + if (res <= 0) { return STATUS_FAIL; } @@ -311,7 +311,7 @@ private: msg.msg_controllen = sizeof(cmsgbuf); ssize_t res = TEMP_FAILURE_RETRY(recvmsg(mFd, &msg, MSG_NOSIGNAL)); - if (res < 0) { + if (res <= 0) { return STATUS_FAIL; } From 9957d6e6d5015260e01517bc6c82ad9362b26284 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 03:45:52 -0700 Subject: [PATCH 32/79] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/00917e17bcbe Author: Rudy Lu Desc: Merge pull request #24935 from RudyLu/winMgr/bug1077609 Bug 1077609 - [Keyboard] When app permissions page asks user to add r=timdream. ======== https://hg.mozilla.org/integration/gaia-central/rev/6fb82f7acac6 Author: Rudy Lu Desc: Bug 1077609 - [Keyboard] When app permissions page asks user to add keyboard, home button does not take user to home screen. - Hide IME setup and list dialog when home button is pressed. ======== https://hg.mozilla.org/integration/gaia-central/rev/9c025386f943 Author: Rudy Lu Desc: Merge pull request #24988 from RudyLu/keyboard/Bug1016824-Czech_qwertz Bug 1016824 - Czech layout should be Qwertz. r=timdream. ======== https://hg.mozilla.org/integration/gaia-central/rev/5d28a5db3105 Author: Rudy Lu Desc: Bug 1016824 - Czech layout should be Qwertz. ======== https://hg.mozilla.org/integration/gaia-central/rev/d53e3e7b8978 Author: Min-Zhong "John" Lu Desc: Merge pull request #24969 from mnjul/bug_1075970_ensure_one_to_one_mapping Bug 1075970 - Ensure that the forward (DOMElem->TargetObj) and reverse (TargetObj->DOMElem) maps are one-to-one mapping. r=timdream ======== https://hg.mozilla.org/integration/gaia-central/rev/3f0cebda892d Author: John Lu [:mnjul] Desc: Bug 1075970 - Ensure that the forward (DOMElem->TargetObj) and reverse (TargetObj->DOMElem) maps are one-to-one mapping Done by creating "reference stubs" to target objects when we're inserting things to the maps. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 8b00b7685b3b..9f328c819f94 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "f82b8beab4ea64031c5d11c7d83abab89539a23f", + "revision": "00917e17bcbe5d022da368b53c329e0579ae5462", "repo_path": "/integration/gaia-central" } From 420465e0d938bebcf29d6ff90a71851a044aedaf Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 03:52:01 -0700 Subject: [PATCH 33/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 426ce3027f54..74912564819e 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 444c5f6947f7..e236add5e799 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index edd971407a3c..0db44d23c82c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 92197ff59688..0731d20a6fdc 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 444c5f6947f7..e236add5e799 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index b95ff1468935..2b026b3a299a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5e02d7b5f32c..7fa85ca2ef43 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 961831be25e5..ae3b4c5e335a 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index bbb4f86aa945..7c0f397a6087 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index a77084494e90..a275f8707850 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 76c609b5fa3d..e999c130ce53 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 7ffb67ce67f55894199ddac049eb5a9675206840 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 04:20:47 -0700 Subject: [PATCH 34/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/bdc36dfa4369 Author: pacorampas Desc: Merge pull request #24813 from pacorampas/1076759 Bug 1076759 - Add data-icon option in buttons BB r=arnau ======== https://hg.mozilla.org/integration/gaia-central/rev/79f51cdc50fa Author: Paco Rampas Desc: Bug 1076759 - Add data-icon option in buttons BB --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 9f328c819f94..de1748e7ccd9 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "00917e17bcbe5d022da368b53c329e0579ae5462", + "revision": "bdc36dfa436939f83368c0d2976176b01a0d8049", "repo_path": "/integration/gaia-central" } From 082fabf357cac15620ad804f191b337fd2369ef2 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 04:27:01 -0700 Subject: [PATCH 35/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 74912564819e..74ce8aafd624 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index e236add5e799..7f60f2ef8461 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0db44d23c82c..09aa3225c459 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 0731d20a6fdc..20fb6d5a482d 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index e236add5e799..7f60f2ef8461 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 2b026b3a299a..ed334dd54320 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7fa85ca2ef43..7b700e3f1a93 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index ae3b4c5e335a..61f7c18ac1f5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 7c0f397a6087..0df568063f70 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index a275f8707850..6ee78937575b 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index e999c130ce53..39b7290a7e83 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 154e0ab687780e0627d241538f98d7aa1f3f9786 Mon Sep 17 00:00:00 2001 From: George Duan Date: Wed, 8 Oct 2014 00:57:00 +0200 Subject: [PATCH 36/79] Bug 1079130 - Modify AppWindowManager to appWindowManager in Gecko. r=jgriffin --- testing/marionette/client/marionette/marionette_test.py | 2 +- testing/web-platform/harness/wptrunner/browsers/b2g.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/marionette/client/marionette/marionette_test.py b/testing/marionette/client/marionette/marionette_test.py index a80b17edc4b1..d59d897cb52b 100644 --- a/testing/marionette/client/marionette/marionette_test.py +++ b/testing/marionette/client/marionette/marionette_test.py @@ -479,7 +479,7 @@ setReq.onsuccess = function() { for (let i = 0; i < apps.length; i++) { let app = apps[i]; if (app.manifest.name === 'Test Container') { - let manager = window.wrappedJSObject.AppWindowManager || window.wrappedJSObject.WindowManager; + let manager = window.wrappedJSObject.appWindowManager || window.wrappedJSObject.AppWindowManager; if (!manager) { marionetteScriptFinished(false); return; diff --git a/testing/web-platform/harness/wptrunner/browsers/b2g.py b/testing/web-platform/harness/wptrunner/browsers/b2g.py index 5d46e244dfeb..1f5d1ffd6ae2 100644 --- a/testing/web-platform/harness/wptrunner/browsers/b2g.py +++ b/testing/web-platform/harness/wptrunner/browsers/b2g.py @@ -233,7 +233,7 @@ class B2GExecutorBrowser(ExecutorBrowser): def wait_for_homescreen(self, timeout): self.executor.logger.info("Waiting for homescreen") self.marionette.execute_async_script(""" -let manager = window.wrappedJSObject.AppWindowManager || window.wrappedJSObject.WindowManager; +let manager = window.wrappedJSObject.appWindowManager || window.wrappedJSObject.AppWindowManager; let app = null; if (manager) { app = ('getActiveApp' in manager) ? manager.getActiveApp() : manager.getCurrentDisplayedApp(); From 8c1273639521b531900704b86e80f669fe9e780a Mon Sep 17 00:00:00 2001 From: Chuck Lee Date: Tue, 7 Oct 2014 18:06:03 +0800 Subject: [PATCH 37/79] Bug 1078113 - Use Cu.cloneInfo() to wrap returned values. r=bzbarsky r=vchang --- dom/wifi/DOMWifiManager.js | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/dom/wifi/DOMWifiManager.js b/dom/wifi/DOMWifiManager.js index 300b06d1948c..fa570ddf2324 100644 --- a/dom/wifi/DOMWifiManager.js +++ b/dom/wifi/DOMWifiManager.js @@ -183,38 +183,6 @@ DOMWifiManager.prototype = { return capabilities; }, - _genReadonlyPropDesc: function(value) { - return { - enumerable: true, configurable: false, writable: false, value: value - }; - }, - - _convertWifiCertificateInfo: function(aInfo) { - let propList = {}; - for (let k in aInfo) { - propList[k] = this._genReadonlyPropDesc(aInfo[k]); - } - - let info = Cu.createObjectIn(this._window); - Object.defineProperties(info, propList); - Cu.makeObjectPropsNormal(info); - - return info; - }, - - _convertWifiCertificateList: function(aList) { - let propList = {}; - for (let k in aList) { - propList[k] = this._genReadonlyPropDesc(aList[k]); - } - - let list = Cu.createObjectIn(this._window); - Object.defineProperties(list, propList); - Cu.makeObjectPropsNormal(list); - - return list; - }, - _sendMessageForRequest: function(name, data, request) { let id = this.getRequestId(request); this._mm.sendAsyncMessage(name, { data: data, rid: id, mid: this._id }); @@ -307,7 +275,7 @@ DOMWifiManager.prototype = { break; case "WifiManager:importCert:Return:OK": - Services.DOMRequest.fireSuccess(request, this._convertWifiCertificateInfo(msg.data)); + Services.DOMRequest.fireSuccess(request, Cu.cloneInto(msg.data, this._window)); break; case "WifiManager:importCert:Return:NO": @@ -315,7 +283,7 @@ DOMWifiManager.prototype = { break; case "WifiManager:getImportedCerts:Return:OK": - Services.DOMRequest.fireSuccess(request, this._convertWifiCertificateList(msg.data)); + Services.DOMRequest.fireSuccess(request, Cu.cloneInto(msg.data, this._window)); break; case "WifiManager:getImportedCerts:Return:NO": From f61e4ee0209887f80430c7f96fd81608791d3e3f Mon Sep 17 00:00:00 2001 From: Alphan Chen Date: Wed, 8 Oct 2014 03:16:00 +0200 Subject: [PATCH 38/79] Bug 1076715 - Add B2G supported playback formats for device info. r=dhylands --- dom/system/gonk/MozMtpDatabase.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dom/system/gonk/MozMtpDatabase.cpp b/dom/system/gonk/MozMtpDatabase.cpp index 0bd11af65c09..3280f95e4614 100644 --- a/dom/system/gonk/MozMtpDatabase.cpp +++ b/dom/system/gonk/MozMtpDatabase.cpp @@ -697,12 +697,18 @@ MozMtpDatabase::getNumObjects(MtpStorageID aStorageID, MtpObjectFormatList* MozMtpDatabase::getSupportedPlaybackFormats() { - static const uint16_t init_data[] = {MTP_FORMAT_UNDEFINED, MTP_FORMAT_ASSOCIATION, MTP_FORMAT_PNG}; + static const uint16_t init_data[] = {MTP_FORMAT_UNDEFINED, MTP_FORMAT_ASSOCIATION, + MTP_FORMAT_TEXT, MTP_FORMAT_HTML, MTP_FORMAT_WAV, + MTP_FORMAT_MP3, MTP_FORMAT_MPEG, MTP_FORMAT_EXIF_JPEG, + MTP_FORMAT_TIFF_EP, MTP_FORMAT_BMP, MTP_FORMAT_GIF, + MTP_FORMAT_PNG, MTP_FORMAT_TIFF, MTP_FORMAT_WMA, + MTP_FORMAT_OGG, MTP_FORMAT_AAC, MTP_FORMAT_MP4_CONTAINER, + MTP_FORMAT_MP2, MTP_FORMAT_3GP_CONTAINER, MTP_FORMAT_FLAC}; MtpObjectFormatList *list = new MtpObjectFormatList(); list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); - MTP_LOG("returning MTP_FORMAT_UNDEFINED, MTP_FORMAT_ASSOCIATION, MTP_FORMAT_PNG"); + MTP_LOG("returning Supported Playback Formats"); return list; } From 6c885f4bcd2c721b3b067b93879082e566d9298a Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Mon, 6 Oct 2014 19:02:16 +0800 Subject: [PATCH 39/79] Bug 1074092 - Move CBS Settings implementation from RadioInterfaceLayer to CellBroadcastService. r=htsai --- .../gonk/CellBroadcastService.js | 144 ++++++++++++++++++ .../gonk/CellBroadcastService.manifest | 1 + dom/system/gonk/RadioInterfaceLayer.js | 77 ---------- 3 files changed, 145 insertions(+), 77 deletions(-) diff --git a/dom/cellbroadcast/gonk/CellBroadcastService.js b/dom/cellbroadcast/gonk/CellBroadcastService.js index 9f9713aed31b..a4b1d91471c4 100644 --- a/dom/cellbroadcast/gonk/CellBroadcastService.js +++ b/dom/cellbroadcast/gonk/CellBroadcastService.js @@ -16,10 +16,22 @@ XPCOMUtils.defineLazyGetter(this, "RIL", function () { return obj; }); +const kMozSettingsChangedObserverTopic = "mozsettings-changed"; +const kSettingsCellBroadcastDisabled = "ril.cellbroadcast.disabled"; +const kSettingsCellBroadcastSearchList = "ril.cellbroadcast.searchlist"; + XPCOMUtils.defineLazyServiceGetter(this, "gSystemMessenger", "@mozilla.org/system-message-internal;1", "nsISystemMessagesInternal"); +XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService", + "@mozilla.org/settingsService;1", + "nsISettingsService"); + +XPCOMUtils.defineLazyServiceGetter(this, "gRadioInterfaceLayer", + "@mozilla.org/ril;1", + "nsIRadioInterfaceLayer"); + const GONK_CELLBROADCAST_SERVICE_CONTRACTID = "@mozilla.org/cellbroadcast/gonkservice;1"; const GONK_CELLBROADCAST_SERVICE_CID = @@ -41,7 +53,36 @@ function CellBroadcastService() { this._updateDebugFlag(); + let lock = gSettingsService.createLock(); + + /** + * Read the settings of the toggle of Cellbroadcast Service: + * + * Simple Format: Boolean + * true if CBS is disabled. The value is applied to all RadioInterfaces. + * Enhanced Format: Array of Boolean + * Each element represents the toggle of CBS per RadioInterface. + */ + lock.get(kSettingsCellBroadcastDisabled, this); + + /** + * Read the Cell Broadcast Search List setting to set listening channels: + * + * Simple Format: + * String of integers or integer ranges separated by comma. + * For example, "1, 2, 4-6" + * Enhanced Format: + * Array of Objects with search lists specified in gsm/cdma network. + * For example, [{'gsm' : "1, 2, 4-6", 'cdma' : "1, 50, 99"}, + * {'cdma' : "3, 6, 8-9"}] + * This provides the possibility to + * 1. set gsm/cdma search list individually for CDMA+LTE device. + * 2. set search list per RadioInterface. + */ + lock.get(kSettingsCellBroadcastSearchList, this); + Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); + Services.obs.addObserver(this, kMozSettingsChangedObserverTopic, false); } CellBroadcastService.prototype = { classID: GONK_CELLBROADCAST_SERVICE_CID, @@ -55,11 +96,15 @@ CellBroadcastService.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsICellBroadcastService, Ci.nsIGonkCellBroadcastService, + Ci.nsISettingsServiceCallback, Ci.nsIObserver]), // An array of nsICellBroadcastListener instances. _listeners: null, + // Setting values of Cell Broadcast SearchList. + _cellBroadcastSearchList: null, + _updateDebugFlag: function() { try { DEBUG = RIL.DEBUG_RIL || @@ -85,6 +130,74 @@ CellBroadcastService.prototype = { : RIL.CB_ETWS_WARNING_TYPE_NAMES[aWarningType]; }, + _retrieveSettingValueByClient: function(aClientId, aSettings) { + return Array.isArray(aSettings) ? aSettings[aClientId] : aSettings; + }, + + /** + * Helper function to set CellBroadcastDisabled to each RadioInterface. + */ + setCellBroadcastDisabled: function(aSettings) { + let numOfRilClients = gRadioInterfaceLayer.numRadioInterfaces; + let responses = []; + for (let clientId = 0; clientId < numOfRilClients; clientId++) { + gRadioInterfaceLayer + .getRadioInterface(clientId) + .sendWorkerMessage("setCellBroadcastDisabled", + { disabled: this._retrieveSettingValueByClient(clientId, aSettings) }); + } + }, + + /** + * Helper function to set CellBroadcastSearchList to each RadioInterface. + */ + setCellBroadcastSearchList: function(aSettings) { + let numOfRilClients = gRadioInterfaceLayer.numRadioInterfaces; + let responses = []; + for (let clientId = 0; clientId < numOfRilClients; clientId++) { + let newSearchList = this._retrieveSettingValueByClient(clientId, aSettings); + let oldSearchList = this._retrieveSettingValueByClient(clientId, + this._cellBroadcastSearchList); + + if ((newSearchList == oldSearchList) || + (newSearchList && oldSearchList && + newSearchList.gsm == oldSearchList.gsm && + newSearchList.cdma == oldSearchList.cdma)) { + return; + } + + gRadioInterfaceLayer + .getRadioInterface(clientId).sendWorkerMessage("setCellBroadcastSearchList", + { searchList: newSearchList }, + (function callback(aResponse) { + if (DEBUG && !aResponse.success) { + debug("Failed to set new search list: " + newSearchList + + " to client id: " + clientId); + } + + responses.push(aResponse); + if (responses.length == numOfRilClients) { + let successCount = 0; + for (let i = 0; i < responses.length; i++) { + if (responses[i].success) { + successCount++; + } + } + if (successCount == numOfRilClients) { + this._cellBroadcastSearchList = aSettings; + } else { + // Rollback the change when failure. + let lock = gSettingsService.createLock(); + lock.set(kSettingsCellBroadcastSearchList, + this._cellBroadcastSearchList, null); + } + } + + return false; + }).bind(this)); + } + }, + /** * nsICellBroadcastService interface */ @@ -178,13 +291,44 @@ CellBroadcastService.prototype = { } }, + /** + * nsISettingsServiceCallback interface. + */ + handle: function(aName, aResult) { + switch (aName) { + case kSettingsCellBroadcastSearchList: + if (DEBUG) { + debug("'" + kSettingsCellBroadcastSearchList + + "' is now " + JSON.stringify(aResult)); + } + + this.setCellBroadcastSearchList(aResult); + break; + case kSettingsCellBroadcastDisabled: + if (DEBUG) { + debug("'" + kSettingsCellBroadcastDisabled + + "' is now " + JSON.stringify(aResult)); + } + + this.setCellBroadcastDisabled(aResult); + break; + } + }, + /** * nsIObserver interface. */ observe: function(aSubject, aTopic, aData) { switch (aTopic) { + case kMozSettingsChangedObserverTopic: + if ("wrappedJSObject" in aSubject) { + aSubject = aSubject.wrappedJSObject; + } + this.handle(aSubject.key, aSubject.value); + break; case NS_XPCOM_SHUTDOWN_OBSERVER_ID: Services.obs.removeObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); + Services.obs.removeObserver(this, kMozSettingsChangedObserverTopic); // Remove all listeners. this._listeners = []; diff --git a/dom/cellbroadcast/gonk/CellBroadcastService.manifest b/dom/cellbroadcast/gonk/CellBroadcastService.manifest index 53b9eb9a2fda..b621965242a6 100644 --- a/dom/cellbroadcast/gonk/CellBroadcastService.manifest +++ b/dom/cellbroadcast/gonk/CellBroadcastService.manifest @@ -4,3 +4,4 @@ component {7ba407ce-21fd-11e4-a836-1bfdee377e5c} CellBroadcastService.js contract @mozilla.org/cellbroadcast/gonkservice;1 {7ba407ce-21fd-11e4-a836-1bfdee377e5c} +category profile-after-change CellBroadcastService @mozilla.org/cellbroadcast/gonkservice;1 diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index b485188469d3..d3fb3cbce5b8 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -78,8 +78,6 @@ const kSysMsgListenerReadyObserverTopic = "system-message-listener-ready"; const kSysClockChangeObserverTopic = "system-clock-change"; const kScreenStateChangedTopic = "screen-state-changed"; -const kSettingsCellBroadcastDisabled = "ril.cellbroadcast.disabled"; -const kSettingsCellBroadcastSearchList = "ril.cellbroadcast.searchlist"; const kSettingsClockAutoUpdateEnabled = "time.clock.automatic-update.enabled"; const kSettingsClockAutoUpdateAvailable = "time.clock.automatic-update.available"; const kSettingsTimezoneAutoUpdateEnabled = "time.timezone.automatic-update.enabled"; @@ -1823,32 +1821,6 @@ function RadioInterface(aClientId, aWorkerMessenger) { // Set "time.timezone.automatic-update.available" to false when starting up. this.setTimezoneAutoUpdateAvailable(false); - /** - * Read the settings of the toggle of Cellbroadcast Service: - * - * Simple Format: Boolean - * true if CBS is disabled. The value is applied to all RadioInterfaces. - * Enhanced Format: Array of Boolean - * Each element represents the toggle of CBS per RadioInterface. - */ - lock.get(kSettingsCellBroadcastDisabled, this); - - /** - * Read the Cell Broadcast Search List setting to set listening channels: - * - * Simple Format: - * String of integers or integer ranges separated by comma. - * For example, "1, 2, 4-6" - * Enhanced Format: - * Array of Objects with search lists specified in gsm/cdma network. - * For example, [{'gsm' : "1, 2, 4-6", 'cdma' : "1, 50, 99"}, - * {'cdma' : "3, 6, 8-9"}] - * This provides the possibility to - * 1. set gsm/cdma search list individually for CDMA+LTE device. - * 2. set search list per RadioInterface. - */ - lock.get(kSettingsCellBroadcastSearchList, this); - Services.obs.addObserver(this, kMozSettingsChangedObserverTopic, false); Services.obs.addObserver(this, kSysClockChangeObserverTopic, false); Services.obs.addObserver(this, kScreenStateChangedTopic, false); @@ -2241,36 +2213,6 @@ RadioInterface.prototype = { }); }, - setCellBroadcastSearchList: function(settings) { - let newSearchList = - Array.isArray(settings) ? settings[this.clientId] : settings; - let oldSearchList = - Array.isArray(this._cellBroadcastSearchList) ? - this._cellBroadcastSearchList[this.clientId] : - this._cellBroadcastSearchList; - - if ((newSearchList == oldSearchList) || - (newSearchList && oldSearchList && - newSearchList.gsm == oldSearchList.gsm && - newSearchList.cdma == oldSearchList.cdma)) { - return; - } - - this.workerMessenger.send("setCellBroadcastSearchList", - { searchList: newSearchList }, - (function callback(response) { - if (!response.success) { - let lock = gSettingsService.createLock(); - lock.set(kSettingsCellBroadcastSearchList, - this._cellBroadcastSearchList, null); - } else { - this._cellBroadcastSearchList = settings; - } - - return false; - }).bind(this)); - }, - setDataRegistration: function(attach) { let deferred = Promise.defer(); this.workerMessenger.send("setDataRegistration", @@ -3105,25 +3047,6 @@ RadioInterface.prototype = { } } break; - case kSettingsCellBroadcastSearchList: - if (DEBUG) { - this.debug("'" + kSettingsCellBroadcastSearchList + - "' is now " + JSON.stringify(aResult)); - } - - this.setCellBroadcastSearchList(aResult); - break; - case kSettingsCellBroadcastDisabled: - if (DEBUG) { - this.debug("'" + kSettingsCellBroadcastDisabled + - "' is now " + JSON.stringify(aResult)); - } - - let setCbsDisabled = - Array.isArray(aResult) ? aResult[this.clientId] : aResult; - this.workerMessenger.send("setCellBroadcastDisabled", - { disabled: setCbsDisabled }); - break; } }, From d290e279faf502af7a9c8e216e4c81e1f6527b3a Mon Sep 17 00:00:00 2001 From: Tim Nguyen Date: Wed, 8 Oct 2014 15:46:13 -0700 Subject: [PATCH 40/79] Bug 1078067 - Remove custom background from Loop panel. r=mdeboer --- browser/components/loop/content/shared/css/panel.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/components/loop/content/shared/css/panel.css b/browser/components/loop/content/shared/css/panel.css index 8318d9c8c4ef..2e4a90bbd3aa 100644 --- a/browser/components/loop/content/shared/css/panel.css +++ b/browser/components/loop/content/shared/css/panel.css @@ -2,6 +2,10 @@ * 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/. */ +body { + background: none; +} + /* Panel styles */ .panel { @@ -26,7 +30,6 @@ flex-direction: row; padding: 10px; border-bottom: 1px solid #ccc; - background-color: #fbfbfb; color: #000; border-top-right-radius: 2px; border-top-left-radius: 2px; From 941fd72e58414a6d3c251a5d0f4c7592d538135b Mon Sep 17 00:00:00 2001 From: Patrick Brosset Date: Wed, 8 Oct 2014 15:46:16 -0700 Subject: [PATCH 41/79] Bug 917696 - Makes markup-view tag name edition go through the protocol; r=bgrins --- .../inspector/test/browser_inspector_menu.js | 5 +- browser/devtools/markupview/markup-view.js | 215 ++++++++---------- browser/devtools/markupview/test/browser.ini | 2 +- .../test/browser_markupview_html_edit_03.js | 28 ++- .../test/browser_markupview_tag_edit_03.js | 2 +- .../test/browser_markupview_tag_edit_10.js | 33 +++ .../test/helper_outerhtml_test_runner.js | 24 +- toolkit/devtools/server/actors/inspector.js | 43 +++- 8 files changed, 197 insertions(+), 155 deletions(-) create mode 100644 browser/devtools/markupview/test/browser_markupview_tag_edit_10.js diff --git a/browser/devtools/inspector/test/browser_inspector_menu.js b/browser/devtools/inspector/test/browser_inspector_menu.js index eef6ee7c7e40..8ef3438cc702 100644 --- a/browser/devtools/inspector/test/browser_inspector_menu.js +++ b/browser/devtools/inspector/test/browser_inspector_menu.js @@ -185,11 +185,12 @@ let test = asyncTest(function* () { contextMenuClick(getContainerForRawNode(inspector.markup, node).tagLine); + let onNodeReselected = inspector.markup.once("reselectedonremoved"); let menu = inspector.panelDoc.getElementById("node-menu-pasteouterhtml"); dispatchCommandEvent(menu); info("Waiting for inspector selection to update"); - yield inspector.selection.once("new-node"); + yield onNodeReselected; ok(content.document.body.outerHTML.contains(clipboard.get()), "Clipboard content was pasted into the node's outer HTML."); @@ -198,6 +199,8 @@ let test = asyncTest(function* () { function* testDeleteNode() { info("Testing 'Delete Node' menu item for normal elements."); + + yield selectNode("p", inspector); let deleteNode = inspector.panelDoc.getElementById("node-menu-delete"); ok(deleteNode, "the popup menu has a delete menu item"); diff --git a/browser/devtools/markupview/markup-view.js b/browser/devtools/markupview/markup-view.js index f2952937d2e6..94fc46a03481 100644 --- a/browser/devtools/markupview/markup-view.js +++ b/browser/devtools/markupview/markup-view.js @@ -620,8 +620,6 @@ MarkupView.prototype = { */ _mutationObserver: function(aMutations) { let requiresLayoutChange = false; - let reselectParent; - let reselectChildIndex; for (let mutation of aMutations) { let type = mutation.type; @@ -651,22 +649,9 @@ MarkupView.prototype = { requiresLayoutChange = true; } } else if (type === "childList") { - let isFromOuterHTML = mutation.removed.some((n) => { - return n === this._outerHTMLNode; - }); - - // Keep track of which node should be reselected after mutations. - if (isFromOuterHTML) { - reselectParent = target; - reselectChildIndex = this._outerHTMLChildIndex; - - delete this._outerHTMLNode; - delete this._outerHTMLChildIndex; - } - container.childrenDirty = true; // Update the children to take care of changes in the markup view DOM. - this._updateChildren(container, {flash: !isFromOuterHTML}); + this._updateChildren(container, {flash: true}); } } @@ -680,22 +665,6 @@ MarkupView.prototype = { // Since the htmlEditor is absolutely positioned, a mutation may change // the location in which it should be shown. this.htmlEditor.refresh(); - - // If a node has had its outerHTML set, the parent node will be selected. - // Reselect the original node immediately. - if (this._inspector.selection.nodeFront === reselectParent) { - this.walker.children(reselectParent).then((o) => { - let node = o.nodes[reselectChildIndex]; - let container = this.getContainer(node); - if (node && container) { - this.markNodeAsSelected(node, "outerhtml"); - if (container.hasChildren) { - this.expandNode(node); - } - } - }); - - } }); }, @@ -847,26 +816,70 @@ MarkupView.prototype = { }, /** - * Retrieve the index of a child within its parent's children list. - * @param aNode The NodeFront to find the index of. - * @returns A promise that will be resolved with the integer index. - * If the child cannot be found, returns -1 + * Listen to mutations, expect a given node to be removed and try and select + * the node that sits at the same place instead. + * This is useful when changing the outerHTML or the tag name so that the + * newly inserted node gets selected instead of the one that just got removed. */ - getNodeChildIndex: function(aNode) { - let def = promise.defer(); - let parentNode = aNode.parentNode(); + reselectOnRemoved: function(removedNode, reason) { + // Only allow one removed node reselection at a time, so that when there are + // more than 1 request in parallel, the last one wins. + this.cancelReselectOnRemoved(); - // Node may have been removed from the DOM, instead of throwing an error, - // return -1 indicating that it isn't inside of its parent children list. - if (!parentNode) { - def.resolve(-1); - } else { - this.walker.children(parentNode).then(children => { - def.resolve(children.nodes.indexOf(aNode)); - }); + // Get the removedNode index in its parent node to reselect the right node. + let isHTMLTag = removedNode.tagName.toLowerCase() === "html"; + let oldContainer = this.getContainer(removedNode); + let parentContainer = this.getContainer(removedNode.parentNode()); + let childIndex = parentContainer.getChildContainers().indexOf(oldContainer); + + let onMutations = this._removedNodeObserver = (e, mutations) => { + let isNodeRemovalMutation = false; + for (let mutation of mutations) { + let containsRemovedNode = mutation.removed && + mutation.removed.some(n => n === removedNode); + if (mutation.type === "childList" && (containsRemovedNode || isHTMLTag)) { + isNodeRemovalMutation = true; + break; + } + } + if (!isNodeRemovalMutation) { + return; + } + + this._inspector.off("markupmutation", onMutations); + this._removedNodeObserver = null; + + // Don't select the new node if the user has already changed the current + // selection. + if (this._inspector.selection.nodeFront === parentContainer.node || + (this._inspector.selection.nodeFront === removedNode && isHTMLTag)) { + let childContainers = parentContainer.getChildContainers(); + if (childContainers && childContainers[childIndex]) { + this.markNodeAsSelected(childContainers[childIndex].node, reason); + if (childContainers[childIndex].hasChildren) { + this.expandNode(childContainers[childIndex].node); + } + this.emit("reselectedonremoved"); + } + } + }; + + // Start listening for mutations until we find a childList change that has + // removedNode removed. + this._inspector.on("markupmutation", onMutations); + }, + + /** + * Make sure to stop listening for node removal markupmutations and not + * reselect the corresponding node when that happens. + * Useful when the outerHTML/tagname edition failed. + */ + cancelReselectOnRemoved: function() { + if (this._removedNodeObserver) { + this._inspector.off("markupmutation", this._removedNodeObserver); + this._removedNodeObserver = null; + this.emit("canceledreselectonremoved"); } - - return def.promise; }, /** @@ -883,20 +896,12 @@ MarkupView.prototype = { return promise.reject(); } - let def = promise.defer(); - - this.getNodeChildIndex(aNode).then((i) => { - this._outerHTMLChildIndex = i; - this._outerHTMLNode = aNode; - - container.undo.do(() => { - this.walker.setOuterHTML(aNode, newValue).then(def.resolve, def.reject); - }, () => { - this.walker.setOuterHTML(aNode, oldValue).then(def.resolve, def.reject); - }); + // Changing the outerHTML removes the node which outerHTML was changed. + // Listen to this removal to reselect the right node afterwards. + this.reselectOnRemoved(aNode, "outerhtml"); + return this.walker.setOuterHTML(aNode, newValue).then(null, () => { + this.cancelReselectOnRemoved(); }); - - return def.promise; }, /** @@ -1426,6 +1431,18 @@ MarkupContainer.prototype = { } }, + /** + * If the node has children, return the list of containers for all these + * children. + */ + getChildContainers: function() { + if (!this.hasChildren) { + return null; + } + + return [...this.children.children].map(node => node.container); + }, + /** * True if the node has been visually expanded in the tree. */ @@ -1828,7 +1845,15 @@ RootContainer.prototype = { hasChildren: true, expanded: true, update: function() {}, - destroy: function() {} + destroy: function() {}, + + /** + * If the node has children, return the list of containers for all these + * children. + */ + getChildContainers: function() { + return [...this.children.children].map(node => node.container); + } }; /** @@ -1969,13 +1994,9 @@ function ElementEditor(aContainer, aNode) { // Create the main editor this.template("element", this); - if (aNode.isLocal_toBeDeprecated()) { - this.rawNode = aNode.rawNode(); - } - // Make the tag name editable (unless this is a remote node or // a document element) - if (this.rawNode && !aNode.isDocumentElement) { + if (!aNode.isDocumentElement) { this.tag.setAttribute("tabindex", "0"); editableField({ element: this.tag, @@ -2207,57 +2228,19 @@ ElementEditor.prototype = { /** * Called when the tag name editor has is done editing. */ - onTagEdit: function(aVal, aCommit) { - if (!aCommit || aVal == this.rawNode.tagName) { + onTagEdit: function(newTagName, isCommit) { + if (!isCommit || newTagName == this.node.tagName || + !("editTagName" in this.markup.walker)) { return; } - // Create a new element with the same attributes as the - // current element and prepare to replace the current node - // with it. - try { - var newElt = nodeDocument(this.rawNode).createElement(aVal); - } catch(x) { - // Failed to create a new element with that tag name, ignore - // the change. - return; - } - - let attrs = this.rawNode.attributes; - - for (let i = 0 ; i < attrs.length; i++) { - newElt.setAttribute(attrs[i].name, attrs[i].value); - } - let newFront = this.markup.walker.frontForRawNode(newElt); - let newContainer = this.markup.importNode(newFront); - - // Retain the two nodes we care about here so we can undo. - let walker = this.markup.walker; - promise.all([ - walker.retainNode(newFront), walker.retainNode(this.node) - ]).then(() => { - function swapNodes(aOld, aNew) { - aOld.parentNode.insertBefore(aNew, aOld); - while (aOld.firstChild) { - aNew.appendChild(aOld.firstChild); - } - aOld.parentNode.removeChild(aOld); - } - - this.container.undo.do(() => { - swapNodes(this.rawNode, newElt); - this.markup.setNodeExpanded(newFront, this.container.expanded); - if (this.container.selected) { - this.markup.navigate(newContainer); - } - }, () => { - swapNodes(newElt, this.rawNode); - this.markup.setNodeExpanded(this.node, newContainer.expanded); - if (newContainer.selected) { - this.markup.navigate(this.container); - } - }); - }).then(null, console.error); + // Changing the tagName removes the node. Make sure the replacing node gets + // selected afterwards. + this.markup.reselectOnRemoved(this.node, "edittagname"); + this.markup.walker.editTagName(this.node, newTagName).then(null, () => { + // Failed to edit the tag name, cancel the reselection. + this.markup.cancelReselectOnRemoved(); + }); }, destroy: function() {} diff --git a/browser/devtools/markupview/test/browser.ini b/browser/devtools/markupview/test/browser.ini index 18ed98e17c0b..bb051a94175e 100644 --- a/browser/devtools/markupview/test/browser.ini +++ b/browser/devtools/markupview/test/browser.ini @@ -80,13 +80,13 @@ skip-if = e10s # Bug 1036409 - The last selected node isn't reselected [browser_markupview_tag_edit_01.js] [browser_markupview_tag_edit_02.js] [browser_markupview_tag_edit_03.js] -skip-if = e10s # Bug 1036421 - Tag editing isn't remote-safe [browser_markupview_tag_edit_04.js] [browser_markupview_tag_edit_05.js] [browser_markupview_tag_edit_06.js] [browser_markupview_tag_edit_07.js] [browser_markupview_tag_edit_08.js] [browser_markupview_tag_edit_09.js] +[browser_markupview_tag_edit_10.js] [browser_markupview_textcontent_edit_01.js] [browser_markupview_toggle_01.js] [browser_markupview_toggle_02.js] diff --git a/browser/devtools/markupview/test/browser_markupview_html_edit_03.js b/browser/devtools/markupview/test/browser_markupview_html_edit_03.js index 3737aca89f66..d091c24df8b2 100644 --- a/browser/devtools/markupview/test/browser_markupview_html_edit_03.js +++ b/browser/devtools/markupview/test/browser_markupview_html_edit_03.js @@ -107,10 +107,9 @@ function* testBody(inspector) { let bodyFront = yield getNodeFront("body", inspector); let doc = content.document; - let mutated = inspector.once("markupmutation"); - inspector.markup.updateNodeOuterHTML(bodyFront, bodyHTML, body.outerHTML); - - let mutations = yield mutated; + let onReselected = inspector.markup.once("reselectedonremoved"); + yield inspector.markup.updateNodeOuterHTML(bodyFront, bodyHTML, body.outerHTML); + yield onReselected; is(getNode("body").outerHTML, bodyHTML, " HTML has been updated"); is(doc.querySelectorAll("head").length, 1, "no extra s have been added"); @@ -120,14 +119,15 @@ function* testBody(inspector) { function* testHead(inspector) { let head = getNode("head"); + yield selectNode("head", inspector); + let headHTML = 'New Title'; let headFront = yield getNodeFront("head", inspector); let doc = content.document; - let mutated = inspector.once("markupmutation"); - inspector.markup.updateNodeOuterHTML(headFront, headHTML, head.outerHTML); - - let mutations = yield mutated; + let onReselected = inspector.markup.once("reselectedonremoved"); + yield inspector.markup.updateNodeOuterHTML(headFront, headHTML, head.outerHTML); + yield onReselected; is(doc.title, "New Title", "New title has been added"); is(doc.defaultView.foo, undefined, "Script has not been executed"); @@ -143,10 +143,9 @@ function* testDocumentElement(inspector) { let docElementHTML = 'Updated from document element

Hello

'; let docElementFront = yield inspector.markup.walker.documentElement(); - let mutated = inspector.once("markupmutation"); - inspector.markup.updateNodeOuterHTML(docElementFront, docElementHTML, docElement.outerHTML); - - let mutations = yield mutated; + let onReselected = inspector.markup.once("reselectedonremoved"); + yield inspector.markup.updateNodeOuterHTML(docElementFront, docElementHTML, docElement.outerHTML); + yield onReselected; is(doc.title, "Updated from document element", "New title has been added"); is(doc.defaultView.foo, undefined, "Script has not been executed"); @@ -165,10 +164,9 @@ function* testDocumentElement2(inspector) { let docElementHTML = 'Updated again from document element

Hello again

'; let docElementFront = yield inspector.markup.walker.documentElement(); - let mutated = inspector.once("markupmutation"); + let onReselected = inspector.markup.once("reselectedonremoved"); inspector.markup.updateNodeOuterHTML(docElementFront, docElementHTML, docElement.outerHTML); - - let mutations = yield mutated; + yield onReselected; is(doc.title, "Updated again from document element", "New title has been added"); is(doc.defaultView.foo, undefined, "Script has not been executed"); diff --git a/browser/devtools/markupview/test/browser_markupview_tag_edit_03.js b/browser/devtools/markupview/test/browser_markupview_tag_edit_03.js index e1a71da8e9f2..cb2d87679d50 100644 --- a/browser/devtools/markupview/test/browser_markupview_tag_edit_03.js +++ b/browser/devtools/markupview/test/browser_markupview_tag_edit_03.js @@ -6,7 +6,7 @@ // Tests that a node's tagname can be edited in the markup-view -const TEST_URL = "data:text/html,
"; +const TEST_URL = "data:text/html;charset=utf-8,
"; let test = asyncTest(function*() { let {toolbox, inspector} = yield addTab(TEST_URL).then(openInspector); diff --git a/browser/devtools/markupview/test/browser_markupview_tag_edit_10.js b/browser/devtools/markupview/test/browser_markupview_tag_edit_10.js new file mode 100644 index 000000000000..2d9509159b23 --- /dev/null +++ b/browser/devtools/markupview/test/browser_markupview_tag_edit_10.js @@ -0,0 +1,33 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Tests that invalid tagname updates are handled correctly + +const TEST_URL = "data:text/html;charset=utf-8,
"; + +let test = asyncTest(function*() { + let {toolbox, inspector} = yield addTab(TEST_URL).then(openInspector); + yield inspector.markup.expandAll(); + yield selectNode("div", inspector); + + info("Updating the DIV tagname to an invalid value"); + let container = yield getContainerForSelector("div", inspector); + let onCancelReselect = inspector.markup.once("canceledreselectonremoved"); + let tagEditor = container.editor.tag; + setEditableFieldValue(tagEditor, "<<<", inspector); + yield onCancelReselect; + ok(true, "The markup-view emitted the canceledreselectonremoved event"); + is(inspector.selection.nodeFront, container.node, "The test DIV is still selected"); + + info("Updating the DIV tagname to a valid value this time"); + let onReselect = inspector.markup.once("reselectedonremoved"); + setEditableFieldValue(tagEditor, "span", inspector); + yield onReselect; + ok(true, "The markup-view emitted the reselectedonremoved event"); + + let spanFront = yield getNodeFront("span", inspector); + is(inspector.selection.nodeFront, spanFront, "The seelected node is now the SPAN"); +}); diff --git a/browser/devtools/markupview/test/helper_outerhtml_test_runner.js b/browser/devtools/markupview/test/helper_outerhtml_test_runner.js index b257a6de941b..86fe7fe63a29 100644 --- a/browser/devtools/markupview/test/helper_outerhtml_test_runner.js +++ b/browser/devtools/markupview/test/helper_outerhtml_test_runner.js @@ -44,25 +44,11 @@ function* runEditOuterHTMLTest(test, inspector) { let onUpdated = inspector.once("inspector-updated"); - info("Listening for the markupmutation event"); - // This event fires once the outerHTML is set, with a target as the parent node and a type of "childList". - let mutated = inspector.once("markupmutation"); - info("Editing the outerHTML"); - inspector.markup.updateNodeOuterHTML(inspector.selection.nodeFront, test.newHTML, test.oldHTML); - let mutations = yield mutated; - ok(true, "The markupmutation event has fired, mutation done"); - - info("Check to make the sure the correct mutation event was fired, and that the parent is selected"); - let nodeFront = inspector.selection.nodeFront; - let mutation = mutations[0]; - let isFromOuterHTML = mutation.removed.some(n => n === oldNodeFront); - - ok(isFromOuterHTML, "The node is in the 'removed' list of the mutation"); - is(mutation.type, "childList", "Mutation is a childList after updating outerHTML"); - is(mutation.target, nodeFront, "Parent node is selected immediately after setting outerHTML"); - - // Wait for node to be reselected after outerHTML has been set - yield inspector.selection.once("new-node-front"); + info("Listen for reselectedonremoved and edit the outerHTML"); + let onReselected = inspector.markup.once("reselectedonremoved"); + yield inspector.markup.updateNodeOuterHTML(inspector.selection.nodeFront, + test.newHTML, test.oldHTML); + yield onReselected; // Typically selectedNode will === pageNode, but if a new element has been injected in front // of it, this will not be the case. If this happens. diff --git a/toolkit/devtools/server/actors/inspector.js b/toolkit/devtools/server/actors/inspector.js index 217c2977a56a..e9d2c2fb7aa7 100644 --- a/toolkit/devtools/server/actors/inspector.js +++ b/toolkit/devtools/server/actors/inspector.js @@ -2106,8 +2106,7 @@ var WalkerActor = protocol.ActorClass({ node: Arg(0, "domnode"), value: Arg(1), }, - response: { - } + response: {} }), /** @@ -2150,6 +2149,46 @@ var WalkerActor = protocol.ActorClass({ response: {} }), + /** + * Editing a node's tagname actually means creating a new node with the same + * attributes, removing the node and inserting the new one instead. + * This method does not return anything as mutation events are taking care of + * informing the consumers about changes. + */ + editTagName: method(function(node, tagName) { + let oldNode = node.rawNode; + + // Create a new element with the same attributes as the current element and + // prepare to replace the current node with it. + let newNode; + try { + newNode = nodeDocument(oldNode).createElement(tagName); + } catch(x) { + // Failed to create a new element with that tag name, ignore the change, + // and signal the error to the front. + return Promise.reject(new Error("Could not change node's tagName to " + tagName)); + } + + let attrs = oldNode.attributes; + for (let i = 0; i < attrs.length; i ++) { + newNode.setAttribute(attrs[i].name, attrs[i].value); + } + + // Insert the new node, and transfer the old node's children. + oldNode.parentNode.insertBefore(newNode, oldNode); + while (oldNode.firstChild) { + newNode.appendChild(oldNode.firstChild); + } + + oldNode.remove(); + }, { + request: { + node: Arg(0, "domnode"), + tagName: Arg(1, "string") + }, + response: {} + }), + /** * Get any pending mutation records. Must be called by the client after * the `new-mutations` notification is received. Returns an array of From 2f5923417080dc71d77403288fa47d60b54b88d8 Mon Sep 17 00:00:00 2001 From: Manu Jain Date: Wed, 8 Oct 2014 15:49:48 -0700 Subject: [PATCH 42/79] Bug 1066558 - Cant collapse a tree in web IDE, after expanding it; r=bgrins --- browser/devtools/projecteditor/lib/tree.js | 18 ++++++++++++------ .../browser_projecteditor_tree_selection_01.js | 6 ++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/browser/devtools/projecteditor/lib/tree.js b/browser/devtools/projecteditor/lib/tree.js index 3a142c3d33f6..3cdc3bf6c739 100644 --- a/browser/devtools/projecteditor/lib/tree.js +++ b/browser/devtools/projecteditor/lib/tree.js @@ -69,14 +69,12 @@ var ResourceContainer = Class({ this.elt.appendChild(this.children); this.line.addEventListener("click", (evt) => { - if (!this.selected) { - this.select(); - this.expanded = true; - evt.stopPropagation(); - } + this.select(); + this.toggleExpansion(); + evt.stopPropagation(); }, false); this.expander.addEventListener("click", (evt) => { - this.expanded = !this.expanded; + this.toggleExpansion(); this.select(); evt.stopPropagation(); }, true); @@ -87,6 +85,14 @@ var ResourceContainer = Class({ this.update(); }, + toggleExpansion: function() { + if (!this.resource.isRoot) { + this.expanded = !this.expanded; + } else { + this.expanded = true; + } + }, + destroy: function() { this.elt.remove(); this.expander.remove(); diff --git a/browser/devtools/projecteditor/test/browser_projecteditor_tree_selection_01.js b/browser/devtools/projecteditor/test/browser_projecteditor_tree_selection_01.js index d2458a3a4682..334351f6d1b9 100644 --- a/browser/devtools/projecteditor/test/browser_projecteditor_tree_selection_01.js +++ b/browser/devtools/projecteditor/test/browser_projecteditor_tree_selection_01.js @@ -39,10 +39,16 @@ function selectFileFirstLoad(projecteditor, resource) { if (resource.isRoot) { ok (container.expanded, "The root directory is expanded by default."); + container.line.click(); + ok (container.expanded, "Clicking on the line does not toggles expansion."); return; } if (resource.isDir) { ok (!container.expanded, "A directory is not expanded by default."); + container.line.click(); + ok (container.expanded, "Clicking on the line toggles expansion."); + container.line.click(); + ok (!container.expanded, "Clicking on the line toggles expansion."); return; } From c473b8046b99621ce92aea07f62d0ae153c94de2 Mon Sep 17 00:00:00 2001 From: Jan Odvarko Date: Mon, 6 Oct 2014 19:40:59 +0200 Subject: [PATCH 43/79] Bug 1078235 - Implement new 'destroy' panel event; r=bgrins --- browser/devtools/framework/gDevTools.jsm | 14 ++-- browser/devtools/framework/test/browser.ini | 1 + .../test/browser_devtools_api_destroy.js | 71 +++++++++++++++++++ browser/devtools/framework/toolbox.js | 5 ++ 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 browser/devtools/framework/test/browser_devtools_api_destroy.js diff --git a/browser/devtools/framework/gDevTools.jsm b/browser/devtools/framework/gDevTools.jsm index 8b5358b0eb83..bf4fbbbad143 100644 --- a/browser/devtools/framework/gDevTools.jsm +++ b/browser/devtools/framework/gDevTools.jsm @@ -406,6 +406,10 @@ DevTools.prototype = { this._toolboxes.set(target, toolbox); + toolbox.once("destroy", () => { + this.emit("toolbox-destroy", target); + }); + toolbox.once("destroyed", () => { this._toolboxes.delete(target); this.emit("toolbox-destroyed", target); @@ -429,7 +433,7 @@ DevTools.prototype = { * Target value e.g. the target that owns this toolbox * * @return {Toolbox} toolbox - * The toobox that is debugging the given target + * The toolbox that is debugging the given target */ getToolbox: function DT_getToolbox(target) { return this._toolboxes.get(target); @@ -440,7 +444,7 @@ DevTools.prototype = { * * @return promise * This promise will resolve to false if no toolbox was found - * associated to the target. true, if the toolbox was successfuly + * associated to the target. true, if the toolbox was successfully * closed. */ closeToolbox: function DT_closeToolbox(target) { @@ -606,11 +610,11 @@ let gDevToolsBrowser = { * selectToolCommand's behavior: * - if the toolbox is closed, * we open the toolbox and select the tool - * - if the toolbox is open, and the targetted tool is not selected, + * - if the toolbox is open, and the targeted tool is not selected, * we select it - * - if the toolbox is open, and the targetted tool is selected, + * - if the toolbox is open, and the targeted tool is selected, * and the host is NOT a window, we close the toolbox - * - if the toolbox is open, and the targetted tool is selected, + * - if the toolbox is open, and the targeted tool is selected, * and the host is a window, we raise the toolbox window */ selectToolCommand: function(gBrowser, toolId) { diff --git a/browser/devtools/framework/test/browser.ini b/browser/devtools/framework/test/browser.ini index 4d3222a09684..94be1bc8335d 100644 --- a/browser/devtools/framework/test/browser.ini +++ b/browser/devtools/framework/test/browser.ini @@ -8,6 +8,7 @@ support-files = doc_theme.css [browser_devtools_api.js] +[browser_devtools_api_destroy.js] skip-if = e10s # Bug 1070837 - devtools/framework/toolbox.js |doc| getter not e10s friendly [browser_dynamic_tool_enabling.js] [browser_keybindings.js] diff --git a/browser/devtools/framework/test/browser_devtools_api_destroy.js b/browser/devtools/framework/test/browser_devtools_api_destroy.js new file mode 100644 index 000000000000..06100f0ca89f --- /dev/null +++ b/browser/devtools/framework/test/browser_devtools_api_destroy.js @@ -0,0 +1,71 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Tests devtools API + +const Cu = Components.utils; + +function test() { + addTab("about:blank").then(runTests); +} + +function runTests(aTab) { + let toolDefinition = { + id: "testTool", + visibilityswitch: "devtools.testTool.enabled", + isTargetSupported: function() true, + url: "about:blank", + label: "someLabel", + build: function(iframeWindow, toolbox) { + let deferred = promise.defer(); + executeSoon(() => { + deferred.resolve({ + target: toolbox.target, + toolbox: toolbox, + isReady: true, + destroy: function(){}, + }); + }); + return deferred.promise; + }, + }; + + gDevTools.registerTool(toolDefinition); + + let collectedEvents = []; + + let target = TargetFactory.forTab(aTab); + gDevTools.showToolbox(target, toolDefinition.id).then(function(toolbox) { + let panel = toolbox.getPanel(toolDefinition.id); + ok(panel, "Tool open"); + + gDevTools.once("toolbox-destroy", (event, toolbox, iframe) => { + collectedEvents.push(event); + }); + + gDevTools.once(toolDefinition.id + "-destroy", (event, toolbox, iframe) => { + collectedEvents.push("gDevTools-" + event); + }); + + toolbox.once("destroy", (event) => { + collectedEvents.push(event); + }); + + toolbox.once(toolDefinition.id + "-destroy", (event) => { + collectedEvents.push("toolbox-" + event); + }); + + toolbox.destroy().then(function() { + is(collectedEvents.join(":"), + "toolbox-destroy:destroy:gDevTools-testTool-destroy:toolbox-testTool-destroy", + "Found the right amount of collected events."); + + gDevTools.unregisterTool(toolDefinition.id); + gBrowser.removeCurrentTab(); + + executeSoon(function() { + finish(); + }); + }); + }); +} diff --git a/browser/devtools/framework/toolbox.js b/browser/devtools/framework/toolbox.js index cdc863b35f56..8ea154d0866c 100644 --- a/browser/devtools/framework/toolbox.js +++ b/browser/devtools/framework/toolbox.js @@ -1516,6 +1516,8 @@ Toolbox.prototype = { return this._destroyer; } + this.emit("destroy"); + this._target.off("navigate", this._refreshHostTitle); this._target.off("frame-update", this._updateFrames); this.off("select", this._refreshHostTitle); @@ -1537,6 +1539,9 @@ Toolbox.prototype = { let outstanding = []; for (let [id, panel] of this._toolPanels) { try { + gDevTools.emit(id + "-destroy", this, panel); + this.emit(id + "-destroy", panel); + outstanding.push(panel.destroy()); } catch (e) { // We don't want to stop here if any panel fail to close. From b9ca03a04a77c7163d555dfb7fe56fb26bbd999a Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Wed, 8 Oct 2014 20:01:00 +0200 Subject: [PATCH 44/79] Bug 1058397 - Part 1: Separate TelephonyCallback. r=hsinyi --- .../gonk/MobileConnectionService.js | 18 +-- dom/telephony/Telephony.cpp | 6 +- dom/telephony/Telephony.h | 4 +- dom/telephony/TelephonyCallback.cpp | 119 +--------------- dom/telephony/TelephonyCallback.h | 59 ++------ dom/telephony/TelephonyDialCallback.cpp | 133 ++++++++++++++++++ dom/telephony/TelephonyDialCallback.h | 84 +++++++++++ dom/telephony/gonk/TelephonyService.js | 14 +- dom/telephony/ipc/PTelephonyRequest.ipdl | 13 +- dom/telephony/ipc/TelephonyChild.cpp | 35 +++-- dom/telephony/ipc/TelephonyChild.h | 5 +- dom/telephony/ipc/TelephonyIPCService.cpp | 3 +- dom/telephony/ipc/TelephonyParent.cpp | 19 ++- dom/telephony/ipc/TelephonyParent.h | 3 +- dom/telephony/moz.build | 2 + dom/telephony/nsIGonkTelephonyService.idl | 4 +- dom/telephony/nsITelephonyService.idl | 26 ++-- 17 files changed, 327 insertions(+), 220 deletions(-) create mode 100644 dom/telephony/TelephonyDialCallback.cpp create mode 100644 dom/telephony/TelephonyDialCallback.h diff --git a/dom/mobileconnection/gonk/MobileConnectionService.js b/dom/mobileconnection/gonk/MobileConnectionService.js index 65205597bd97..5de6889dffd1 100644 --- a/dom/mobileconnection/gonk/MobileConnectionService.js +++ b/dom/mobileconnection/gonk/MobileConnectionService.js @@ -25,8 +25,8 @@ const MOBILENETWORKINFO_CID = Components.ID("{a6c8416c-09b4-46d1-bf29-6520d677d085}"); const MOBILECELLINFO_CID = Components.ID("{0635d9ab-997e-4cdf-84e7-c1883752dff3}"); -const TELEPHONYCALLBACK_CID = - Components.ID("{6e1af17e-37f3-11e4-aed3-60a44c237d2b}"); +const TELEPHONYDIALCALLBACK_CID = + Components.ID("{c2af1a5d-3649-44ef-a1ff-18e9ac1dec51}"); const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown"; const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed"; @@ -141,14 +141,14 @@ MMIResult.prototype = { }; /** - * Wrap a MobileConnectionCallback to a TelephonyCallback. + * Wrap a MobileConnectionCallback to a TelephonyDialCallback. */ -function TelephonyCallback(aCallback) { +function TelephonyDialCallback(aCallback) { this.callback = aCallback; } -TelephonyCallback.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyCallback]), - classID: TELEPHONYCALLBACK_CID, +TelephonyDialCallback.prototype = { + QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyDialCallback]), + classID: TELEPHONYDIALCALLBACK_CID, notifyDialMMI: function(mmiServiceCode) { this.serviceCode = mmiServiceCode; @@ -725,8 +725,8 @@ MobileConnectionProvider.prototype = { }, sendMMI: function(aMmi, aCallback) { - let telephonyCallback = new TelephonyCallback(aCallback); - gGonkTelephonyService.dialMMI(this._clientId, aMmi, telephonyCallback); + let callback = new TelephonyDialCallback(aCallback); + gGonkTelephonyService.dialMMI(this._clientId, aMmi, callback); }, cancelMMI: function(aCallback) { diff --git a/dom/telephony/Telephony.cpp b/dom/telephony/Telephony.cpp index 4c97f88f9fd6..c27900996733 100644 --- a/dom/telephony/Telephony.cpp +++ b/dom/telephony/Telephony.cpp @@ -26,7 +26,7 @@ #include "TelephonyCall.h" #include "TelephonyCallGroup.h" #include "TelephonyCallId.h" -#include "TelephonyCallback.h" +#include "TelephonyDialCallback.h" // Service instantiation #include "ipc/TelephonyIPCService.h" @@ -235,8 +235,8 @@ Telephony::DialInternal(uint32_t aServiceId, const nsAString& aNumber, return promise.forget(); } - nsCOMPtr callback = - new TelephonyCallback(GetOwner(), this, promise, aServiceId); + nsCOMPtr callback = + new TelephonyDialCallback(GetOwner(), this, promise, aServiceId); nsresult rv = mService->Dial(aServiceId, aNumber, aEmergency, callback); if (NS_FAILED(rv)) { diff --git a/dom/telephony/Telephony.h b/dom/telephony/Telephony.h index e20756eb9c0f..f99b0a04b7cf 100644 --- a/dom/telephony/Telephony.h +++ b/dom/telephony/Telephony.h @@ -23,7 +23,7 @@ namespace mozilla { namespace dom { namespace telephony { -class TelephonyCallback; +class TelephonyDialCallback; } // namespace telephony @@ -43,7 +43,7 @@ class Telephony MOZ_FINAL : public DOMEventTargetHelper, class EnumerationAck; friend class EnumerationAck; - friend class telephony::TelephonyCallback; + friend class telephony::TelephonyDialCallback; nsCOMPtr mService; nsRefPtr mListener; diff --git a/dom/telephony/TelephonyCallback.cpp b/dom/telephony/TelephonyCallback.cpp index 4f7d77c149c0..0590aece6bb4 100644 --- a/dom/telephony/TelephonyCallback.cpp +++ b/dom/telephony/TelephonyCallback.cpp @@ -4,136 +4,31 @@ #include "TelephonyCallback.h" -#include "mozilla/dom/DOMMMIError.h" -#include "nsServiceManagerUtils.h" +#include "mozilla/dom/Promise.h" +#include "nsJSUtils.h" using namespace mozilla::dom; using namespace mozilla::dom::telephony; NS_IMPL_ISUPPORTS(TelephonyCallback, nsITelephonyCallback) -TelephonyCallback::TelephonyCallback(nsPIDOMWindow* aWindow, - Telephony* aTelephony, - Promise* aPromise, - uint32_t aServiceId) - : mWindow(aWindow), mTelephony(aTelephony), mPromise(aPromise), - mServiceId(aServiceId) +TelephonyCallback::TelephonyCallback(Promise* aPromise) + : mPromise(aPromise) { - MOZ_ASSERT(mTelephony); -} - -nsresult -TelephonyCallback::NotifyDialMMISuccess(const nsAString& aStatusMessage) -{ - AutoJSAPI jsapi; - if (!NS_WARN_IF(jsapi.Init(mWindow))) { - return NS_ERROR_FAILURE; - } - - JSContext* cx = jsapi.cx(); - - MozMMIResult result; - - result.mServiceCode.Assign(mServiceCode); - result.mStatusMessage.Assign(aStatusMessage); - - return NotifyDialMMISuccess(cx, result); -} - -nsresult -TelephonyCallback::NotifyDialMMISuccess(JSContext* aCx, - const nsAString& aStatusMessage, - JS::Handle aInfo) -{ - RootedDictionary result(aCx); - - result.mServiceCode.Assign(mServiceCode); - result.mStatusMessage.Assign(aStatusMessage); - result.mAdditionalInformation.Construct().SetAsObject() = &aInfo.toObject(); - - return NotifyDialMMISuccess(aCx, result); -} - -nsresult -TelephonyCallback::NotifyDialMMISuccess(JSContext* aCx, - const MozMMIResult& aResult) -{ - JS::Rooted jsResult(aCx); - - if (!ToJSValue(aCx, aResult, &jsResult)) { - JS_ClearPendingException(aCx); - return NS_ERROR_TYPE_ERR; - } - - return NotifyDialMMISuccess(jsResult); } // nsITelephonyCallback NS_IMETHODIMP -TelephonyCallback::NotifyDialMMI(const nsAString& aServiceCode) +TelephonyCallback::NotifySuccess() { - mMMIRequest = new DOMRequest(mWindow); - mServiceCode.Assign(aServiceCode); - - mPromise->MaybeResolve(mMMIRequest); + mPromise->MaybeResolve(JS::UndefinedHandleValue); return NS_OK; } NS_IMETHODIMP -TelephonyCallback::NotifyDialError(const nsAString& aError) +TelephonyCallback::NotifyError(const nsAString& aError) { mPromise->MaybeRejectBrokenly(aError); return NS_OK; } - -NS_IMETHODIMP -TelephonyCallback::NotifyDialCallSuccess(uint32_t aCallIndex, - const nsAString& aNumber) -{ - nsRefPtr id = mTelephony->CreateCallId(aNumber); - nsRefPtr call = - mTelephony->CreateCall(id, mServiceId, aCallIndex, - nsITelephonyService::CALL_STATE_DIALING); - - mPromise->MaybeResolve(call); - return NS_OK; -} - -NS_IMETHODIMP -TelephonyCallback::NotifyDialMMISuccess(JS::Handle aResult) -{ - nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); - - return rs->FireSuccessAsync(mMMIRequest, aResult); -} - -NS_IMETHODIMP -TelephonyCallback::NotifyDialMMIError(const nsAString& aError) -{ - Nullable info; - - nsRefPtr error = - new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); - - nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); - - return rs->FireDetailedError(mMMIRequest, error); -} - -NS_IMETHODIMP -TelephonyCallback::NotifyDialMMIErrorWithInfo(const nsAString& aError, - uint16_t aInfo) -{ - Nullable info(aInfo); - - nsRefPtr error = - new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); - - nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); - - return rs->FireDetailedError(mMMIRequest, error); -} diff --git a/dom/telephony/TelephonyCallback.h b/dom/telephony/TelephonyCallback.h index cbcc851ab2fb..a184e4b7af82 100644 --- a/dom/telephony/TelephonyCallback.h +++ b/dom/telephony/TelephonyCallback.h @@ -5,73 +5,30 @@ #ifndef mozilla_dom_TelephonyCallback_h #define mozilla_dom_TelephonyCallback_h -#include "Telephony.h" -#include "mozilla/dom/DOMRequest.h" -#include "mozilla/dom/MozMobileConnectionBinding.h" -#include "mozilla/dom/Promise.h" -#include "mozilla/dom/ToJSValue.h" #include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "nsITelephonyService.h" -#include "nsJSUtils.h" -#include "nsString.h" - -class nsPIDOMWindow; namespace mozilla { namespace dom { + +class Promise; + namespace telephony { -class TelephonyCallback MOZ_FINAL : public nsITelephonyCallback +class TelephonyCallback : public nsITelephonyCallback { public: NS_DECL_ISUPPORTS NS_DECL_NSITELEPHONYCALLBACK - TelephonyCallback(nsPIDOMWindow* aWindow, Telephony* aTelephony, - Promise* aPromise, uint32_t aServiceId); + TelephonyCallback(Promise* aPromise); - nsresult - NotifyDialMMISuccess(const nsAString& aStatusMessage); +protected: + virtual ~TelephonyCallback() {} - template - nsresult - NotifyDialMMISuccess(const nsAString& aStatusMessage, const T& aInfo) - { - AutoJSAPI jsapi; - if (!NS_WARN_IF(jsapi.Init(mWindow))) { - return NS_ERROR_FAILURE; - } - - JSContext* cx = jsapi.cx(); - JS::Rooted info(cx); - - if (!ToJSValue(cx, aInfo, &info)) { - JS_ClearPendingException(cx); - return NS_ERROR_TYPE_ERR; - } - - return NotifyDialMMISuccess(cx, aStatusMessage, info); - } - -private: - ~TelephonyCallback() {} - - nsresult - NotifyDialMMISuccess(JSContext* aCx, const nsAString& aStatusMessage, - JS::Handle aInfo); - - nsresult - NotifyDialMMISuccess(JSContext* aCx, const MozMMIResult& aResult); - - - nsCOMPtr mWindow; - nsRefPtr mTelephony; +protected: nsRefPtr mPromise; - uint32_t mServiceId; - - nsRefPtr mMMIRequest; - nsString mServiceCode; }; } // namespace telephony diff --git a/dom/telephony/TelephonyDialCallback.cpp b/dom/telephony/TelephonyDialCallback.cpp new file mode 100644 index 000000000000..f73e3b1ef49d --- /dev/null +++ b/dom/telephony/TelephonyDialCallback.cpp @@ -0,0 +1,133 @@ +/* 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 "TelephonyDialCallback.h" + +#include "mozilla/dom/DOMMMIError.h" +#include "nsServiceManagerUtils.h" + +using namespace mozilla::dom; +using namespace mozilla::dom::telephony; + +NS_IMPL_ISUPPORTS_INHERITED(TelephonyDialCallback, TelephonyCallback, + nsITelephonyDialCallback) + +TelephonyDialCallback::TelephonyDialCallback(nsPIDOMWindow* aWindow, + Telephony* aTelephony, + Promise* aPromise, + uint32_t aServiceId) + : TelephonyCallback(aPromise), mWindow(aWindow), mTelephony(aTelephony), + mServiceId(aServiceId) +{ + MOZ_ASSERT(mTelephony); +} + +nsresult +TelephonyDialCallback::NotifyDialMMISuccess(const nsAString& aStatusMessage) +{ + AutoJSAPI jsapi; + if (!NS_WARN_IF(jsapi.Init(mWindow))) { + return NS_ERROR_FAILURE; + } + + JSContext* cx = jsapi.cx(); + + MozMMIResult result; + + result.mServiceCode.Assign(mServiceCode); + result.mStatusMessage.Assign(aStatusMessage); + + return NotifyDialMMISuccess(cx, result); +} + +nsresult +TelephonyDialCallback::NotifyDialMMISuccess(JSContext* aCx, + const nsAString& aStatusMessage, + JS::Handle aInfo) +{ + RootedDictionary result(aCx); + + result.mServiceCode.Assign(mServiceCode); + result.mStatusMessage.Assign(aStatusMessage); + result.mAdditionalInformation.Construct().SetAsObject() = &aInfo.toObject(); + + return NotifyDialMMISuccess(aCx, result); +} + +nsresult +TelephonyDialCallback::NotifyDialMMISuccess(JSContext* aCx, + const MozMMIResult& aResult) +{ + JS::Rooted jsResult(aCx); + + if (!ToJSValue(aCx, aResult, &jsResult)) { + JS_ClearPendingException(aCx); + return NS_ERROR_TYPE_ERR; + } + + return NotifyDialMMISuccess(jsResult); +} + +// nsITelephonyDialCallback + +NS_IMETHODIMP +TelephonyDialCallback::NotifyDialMMI(const nsAString& aServiceCode) +{ + mMMIRequest = new DOMRequest(mWindow); + mServiceCode.Assign(aServiceCode); + + mPromise->MaybeResolve(mMMIRequest); + return NS_OK; +} + +NS_IMETHODIMP +TelephonyDialCallback::NotifyDialCallSuccess(uint32_t aCallIndex, + const nsAString& aNumber) +{ + nsRefPtr id = mTelephony->CreateCallId(aNumber); + nsRefPtr call = + mTelephony->CreateCall(id, mServiceId, aCallIndex, + nsITelephonyService::CALL_STATE_DIALING); + + mPromise->MaybeResolve(call); + return NS_OK; +} + +NS_IMETHODIMP +TelephonyDialCallback::NotifyDialMMISuccess(JS::Handle aResult) +{ + nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); + + return rs->FireSuccessAsync(mMMIRequest, aResult); +} + +NS_IMETHODIMP +TelephonyDialCallback::NotifyDialMMIError(const nsAString& aError) +{ + Nullable info; + + nsRefPtr error = + new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); + + nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); + + return rs->FireDetailedError(mMMIRequest, error); +} + +NS_IMETHODIMP +TelephonyDialCallback::NotifyDialMMIErrorWithInfo(const nsAString& aError, + uint16_t aInfo) +{ + Nullable info(aInfo); + + nsRefPtr error = + new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); + + nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); + + return rs->FireDetailedError(mMMIRequest, error); +} diff --git a/dom/telephony/TelephonyDialCallback.h b/dom/telephony/TelephonyDialCallback.h new file mode 100644 index 000000000000..6e47a007bc09 --- /dev/null +++ b/dom/telephony/TelephonyDialCallback.h @@ -0,0 +1,84 @@ +/* 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_TelephonyDialCallback_h +#define mozilla_dom_TelephonyDialCallback_h + +#include "Telephony.h" +#include "mozilla/dom/DOMRequest.h" +#include "mozilla/dom/MozMobileConnectionBinding.h" +#include "mozilla/dom/Promise.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/dom/telephony/TelephonyCallback.h" +#include "nsAutoPtr.h" +#include "nsCOMPtr.h" +#include "nsITelephonyService.h" +#include "nsJSUtils.h" +#include "nsString.h" + +class nsPIDOMWindow; + +namespace mozilla { +namespace dom { +namespace telephony { + +class TelephonyDialCallback MOZ_FINAL : public TelephonyCallback, + public nsITelephonyDialCallback +{ +public: + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_NSITELEPHONYDIALCALLBACK + + TelephonyDialCallback(nsPIDOMWindow* aWindow, Telephony* aTelephony, + Promise* aPromise, uint32_t aServiceId); + + NS_FORWARD_NSITELEPHONYCALLBACK(TelephonyCallback::) + + nsresult + NotifyDialMMISuccess(const nsAString& aStatusMessage); + + template + nsresult + NotifyDialMMISuccess(const nsAString& aStatusMessage, const T& aInfo) + { + AutoJSAPI jsapi; + if (!NS_WARN_IF(jsapi.Init(mWindow))) { + return NS_ERROR_FAILURE; + } + + JSContext* cx = jsapi.cx(); + JS::Rooted info(cx); + + if (!ToJSValue(cx, aInfo, &info)) { + JS_ClearPendingException(cx); + return NS_ERROR_TYPE_ERR; + } + + return NotifyDialMMISuccess(cx, aStatusMessage, info); + } + +private: + ~TelephonyDialCallback() {} + + nsresult + NotifyDialMMISuccess(JSContext* aCx, const nsAString& aStatusMessage, + JS::Handle aInfo); + + nsresult + NotifyDialMMISuccess(JSContext* aCx, const MozMMIResult& aResult); + + + nsCOMPtr mWindow; + nsRefPtr mTelephony; + uint32_t mServiceId; + + nsRefPtr mMMIRequest; + nsString mServiceCode; +}; + +} // namespace telephony +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_TelephonyDialCallback_h diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index 94b33dc3f524..2f35602d662c 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -564,7 +564,7 @@ TelephonyService.prototype = { // Note: isPlainPhoneNumber also accepts USSD and SS numbers if (!gPhoneNumberUtils.isPlainPhoneNumber(aNumber)) { if (DEBUG) debug("Error: Number '" + aNumber + "' is not viable. Drop."); - aCallback.notifyDialError(DIAL_ERROR_BAD_NUMBER); + aCallback.notifyError(DIAL_ERROR_BAD_NUMBER); return; } @@ -581,7 +581,7 @@ TelephonyService.prototype = { } else { // Reject MMI code from dialEmergency api. if (aIsDialEmergency) { - aCallback.notifyDialError(DIAL_ERROR_BAD_NUMBER); + aCallback.notifyError(DIAL_ERROR_BAD_NUMBER); return; } @@ -597,14 +597,14 @@ TelephonyService.prototype = { _dialCall: function(aClientId, aOptions, aCallback) { if (this._isDialing) { if (DEBUG) debug("Error: Already has a dialing call."); - aCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR); + aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR); return; } // We can only have at most two calls on the same line (client). if (this._numCallsOnLine(aClientId) >= 2) { if (DEBUG) debug("Error: Already has more than 2 calls on line."); - aCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR); + aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR); return; } @@ -612,7 +612,7 @@ TelephonyService.prototype = { // any new call on other SIM. if (this._hasCallsOnOtherClient(aClientId)) { if (DEBUG) debug("Error: Already has a call on other sim."); - aCallback.notifyDialError(DIAL_ERROR_OTHER_CONNECTION_IN_USE); + aCallback.notifyError(DIAL_ERROR_OTHER_CONNECTION_IN_USE); return; } @@ -622,7 +622,7 @@ TelephonyService.prototype = { aClientId = gRadioInterfaceLayer.getClientIdForEmergencyCall() ; if (aClientId === -1) { if (DEBUG) debug("Error: No client is avaialble for emergency call."); - aCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR); + aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR); return; } } @@ -655,7 +655,7 @@ TelephonyService.prototype = { this._isDialing = false; if (!response.success) { - aCallback.notifyDialError(response.errorMsg); + aCallback.notifyError(response.errorMsg); return; } diff --git a/dom/telephony/ipc/PTelephonyRequest.ipdl b/dom/telephony/ipc/PTelephonyRequest.ipdl index 312c97eba712..997e4d2dddaf 100644 --- a/dom/telephony/ipc/PTelephonyRequest.ipdl +++ b/dom/telephony/ipc/PTelephonyRequest.ipdl @@ -16,7 +16,12 @@ struct EnumerateCallsResponse // empty. }; -struct DialResponseError +struct SuccessResponse +{ + // empty. +}; + +struct ErrorResponse { nsString name; }; @@ -42,8 +47,12 @@ struct DialResponseMMIError union IPCTelephonyResponse { EnumerateCallsResponse; + + // General. + SuccessResponse; + ErrorResponse; + // dial - DialResponseError; DialResponseCallSuccess; DialResponseMMISuccess; DialResponseMMIError; diff --git a/dom/telephony/ipc/TelephonyChild.cpp b/dom/telephony/ipc/TelephonyChild.cpp index a8529a59625f..f9bd0aada99c 100644 --- a/dom/telephony/ipc/TelephonyChild.cpp +++ b/dom/telephony/ipc/TelephonyChild.cpp @@ -5,7 +5,7 @@ #include "TelephonyChild.h" -#include "mozilla/dom/telephony/TelephonyCallback.h" +#include "mozilla/dom/telephony/TelephonyDialCallback.h" #include "TelephonyIPCService.h" USING_TELEPHONY_NAMESPACE @@ -147,8 +147,10 @@ TelephonyRequestChild::Recv__delete__(const IPCTelephonyResponse& aResponse) case IPCTelephonyResponse::TEnumerateCallsResponse: mListener->EnumerateCallStateComplete(); break; - case IPCTelephonyResponse::TDialResponseError: - return DoResponse(aResponse.get_DialResponseError()); + case IPCTelephonyResponse::TSuccessResponse: + return DoResponse(aResponse.get_SuccessResponse()); + case IPCTelephonyResponse::TErrorResponse: + return DoResponse(aResponse.get_ErrorResponse()); case IPCTelephonyResponse::TDialResponseCallSuccess: return DoResponse(aResponse.get_DialResponseCallSuccess()); case IPCTelephonyResponse::TDialResponseMMISuccess: @@ -187,16 +189,24 @@ bool TelephonyRequestChild::RecvNotifyDialMMI(const nsString& aServiceCode) { MOZ_ASSERT(mCallback); - - mCallback->NotifyDialMMI(aServiceCode); + nsCOMPtr callback = do_QueryInterface(mCallback); + callback->NotifyDialMMI(aServiceCode); return true; } bool -TelephonyRequestChild::DoResponse(const DialResponseError& aResponse) +TelephonyRequestChild::DoResponse(const SuccessResponse& aResponse) { MOZ_ASSERT(mCallback); - mCallback->NotifyDialError(aResponse.name()); + mCallback->NotifySuccess(); + return true; +} + +bool +TelephonyRequestChild::DoResponse(const ErrorResponse& aResponse) +{ + MOZ_ASSERT(mCallback); + mCallback->NotifyError(aResponse.name()); return true; } @@ -204,7 +214,8 @@ bool TelephonyRequestChild::DoResponse(const DialResponseCallSuccess& aResponse) { MOZ_ASSERT(mCallback); - mCallback->NotifyDialCallSuccess(aResponse.callIndex(), aResponse.number()); + nsCOMPtr callback = do_QueryInterface(mCallback); + callback->NotifyDialCallSuccess(aResponse.callIndex(), aResponse.number()); return true; } @@ -215,7 +226,8 @@ TelephonyRequestChild::DoResponse(const DialResponseMMISuccess& aResponse) // FIXME: Need to overload NotifyDialMMISuccess in the IDL. mCallback is not // necessarily an instance of TelephonyCallback. - nsRefPtr callback = static_cast(mCallback.get()); + nsCOMPtr dialCallback = do_QueryInterface(mCallback); + nsRefPtr callback = static_cast(dialCallback.get()); nsAutoString statusMessage(aResponse.statusMessage()); AdditionalInformation info(aResponse.additionalInformation()); @@ -242,16 +254,17 @@ bool TelephonyRequestChild::DoResponse(const DialResponseMMIError& aResponse) { MOZ_ASSERT(mCallback); + nsCOMPtr callback = do_QueryInterface(mCallback); nsAutoString name(aResponse.name()); AdditionalInformation info(aResponse.additionalInformation()); switch (info.type()) { case AdditionalInformation::Tvoid_t: - mCallback->NotifyDialMMIError(name); + callback->NotifyDialMMIError(name); break; case AdditionalInformation::Tuint16_t: - mCallback->NotifyDialMMIErrorWithInfo(name, info.get_uint16_t()); + callback->NotifyDialMMIErrorWithInfo(name, info.get_uint16_t()); break; default: MOZ_CRASH("Received invalid type!"); diff --git a/dom/telephony/ipc/TelephonyChild.h b/dom/telephony/ipc/TelephonyChild.h index 49ec3887d463..eaee17ff30f7 100644 --- a/dom/telephony/ipc/TelephonyChild.h +++ b/dom/telephony/ipc/TelephonyChild.h @@ -84,7 +84,10 @@ protected: private: bool - DoResponse(const DialResponseError& aResponse); + DoResponse(const SuccessResponse& aResponse); + + bool + DoResponse(const ErrorResponse& aResponse); bool DoResponse(const DialResponseCallSuccess& aResponse); diff --git a/dom/telephony/ipc/TelephonyIPCService.cpp b/dom/telephony/ipc/TelephonyIPCService.cpp index abebc253418e..65cfe76d7309 100644 --- a/dom/telephony/ipc/TelephonyIPCService.cpp +++ b/dom/telephony/ipc/TelephonyIPCService.cpp @@ -162,7 +162,8 @@ TelephonyIPCService::EnumerateCalls(nsITelephonyListener *aListener) NS_IMETHODIMP TelephonyIPCService::Dial(uint32_t aClientId, const nsAString& aNumber, - bool aIsEmergency, nsITelephonyCallback *aCallback) + bool aIsEmergency, + nsITelephonyDialCallback *aCallback) { return SendRequest(nullptr, aCallback, DialRequest(aClientId, nsString(aNumber), aIsEmergency)); diff --git a/dom/telephony/ipc/TelephonyParent.cpp b/dom/telephony/ipc/TelephonyParent.cpp index 864d55ffe45e..6ff9b181ee72 100644 --- a/dom/telephony/ipc/TelephonyParent.cpp +++ b/dom/telephony/ipc/TelephonyParent.cpp @@ -385,7 +385,8 @@ TelephonyParent::SupplementaryServiceNotification(uint32_t aClientId, NS_IMPL_ISUPPORTS(TelephonyRequestParent, nsITelephonyListener, - nsITelephonyCallback) + nsITelephonyCallback, + nsITelephonyDialCallback) TelephonyRequestParent::TelephonyRequestParent() : mActorDestroyed(false) @@ -426,9 +427,9 @@ TelephonyRequestParent::DoRequest(const DialRequest& aRequest) do_GetService(TELEPHONY_SERVICE_CONTRACTID); if (service) { service->Dial(aRequest.clientId(), aRequest.number(), - aRequest.isEmergency(), this); + aRequest.isEmergency(), this); } else { - return NS_SUCCEEDED(NotifyDialError(NS_LITERAL_STRING("InvalidStateError"))); + return NS_SUCCEEDED(NotifyError(NS_LITERAL_STRING("InvalidStateError"))); } return true; @@ -532,7 +533,7 @@ TelephonyRequestParent::SupplementaryServiceNotification(uint32_t aClientId, MOZ_CRASH("Not a TelephonyParent!"); } -// nsITelephonyCallback +// nsITelephonyDialCallback NS_IMETHODIMP TelephonyRequestParent::NotifyDialMMI(const nsAString& aServiceCode) @@ -543,9 +544,15 @@ TelephonyRequestParent::NotifyDialMMI(const nsAString& aServiceCode) } NS_IMETHODIMP -TelephonyRequestParent::NotifyDialError(const nsAString& aError) +TelephonyRequestParent::NotifySuccess() { - return SendResponse(DialResponseError(nsAutoString(aError))); + return SendResponse(SuccessResponse()); +} + +NS_IMETHODIMP +TelephonyRequestParent::NotifyError(const nsAString& aError) +{ + return SendResponse(ErrorResponse(nsAutoString(aError))); } NS_IMETHODIMP diff --git a/dom/telephony/ipc/TelephonyParent.h b/dom/telephony/ipc/TelephonyParent.h index 5989a6b45796..2fc5da22ff0c 100644 --- a/dom/telephony/ipc/TelephonyParent.h +++ b/dom/telephony/ipc/TelephonyParent.h @@ -98,7 +98,7 @@ private: class TelephonyRequestParent : public PTelephonyRequestParent , public nsITelephonyListener - , public nsITelephonyCallback + , public nsITelephonyDialCallback { friend class TelephonyParent; @@ -106,6 +106,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSITELEPHONYLISTENER NS_DECL_NSITELEPHONYCALLBACK + NS_DECL_NSITELEPHONYDIALCALLBACK protected: TelephonyRequestParent(); diff --git a/dom/telephony/moz.build b/dom/telephony/moz.build index 232b98dc9b37..3b670ccc31f3 100644 --- a/dom/telephony/moz.build +++ b/dom/telephony/moz.build @@ -23,6 +23,7 @@ EXPORTS.mozilla.dom.telephony += [ 'ipc/TelephonyParent.h', 'TelephonyCallback.h', 'TelephonyCommon.h', + 'TelephonyDialCallback.h', ] UNIFIED_SOURCES += [ @@ -35,6 +36,7 @@ UNIFIED_SOURCES += [ 'TelephonyCallback.cpp', 'TelephonyCallGroup.cpp', 'TelephonyCallId.cpp', + 'TelephonyDialCallback.cpp', ] IPDL_SOURCES += [ diff --git a/dom/telephony/nsIGonkTelephonyService.idl b/dom/telephony/nsIGonkTelephonyService.idl index 5b6f0facc8b6..61a65074c23a 100644 --- a/dom/telephony/nsIGonkTelephonyService.idl +++ b/dom/telephony/nsIGonkTelephonyService.idl @@ -10,7 +10,7 @@ "@mozilla.org/telephony/gonktelephonyservice;1" %} -[scriptable, uuid(8790e2cc-2c68-4ce9-90dc-f68e1b6e4886)] +[scriptable, uuid(518165dc-2d55-4db3-9549-60dc4062d1c5)] interface nsIGonkTelephonyService : nsITelephonyService { void notifyCallDisconnected(in unsigned long clientId, in jsval call); @@ -28,5 +28,5 @@ interface nsIGonkTelephonyService : nsITelephonyService void notifyConferenceCallStateChanged(in short state); void dialMMI(in unsigned long clientId, in AString mmiString, - in nsITelephonyCallback callback); + in nsITelephonyDialCallback callback); }; diff --git a/dom/telephony/nsITelephonyService.idl b/dom/telephony/nsITelephonyService.idl index 4d764567482e..3c52f6c6677f 100644 --- a/dom/telephony/nsITelephonyService.idl +++ b/dom/telephony/nsITelephonyService.idl @@ -177,10 +177,20 @@ interface nsITelephonyListener : nsISupports }; /** - * A callback interface for handling asynchronous response of Telephony.dial(). + * A callback interface for handling asynchronous response. */ -[scriptable, uuid(67533db3-cd38-475c-a774-8d0bbf9169fb)] +[scriptable, uuid(cffc3f9d-2c88-4a14-8ebc-f216caf0cc1d)] interface nsITelephonyCallback : nsISupports +{ + void notifySuccess(); + void notifyError(in AString error); +}; + +/** + * A callback interface for handling asynchronous response for telephony.dial. + */ +[scriptable, uuid(4481212f-72e9-4aef-97e1-5397af782113)] +interface nsITelephonyDialCallback : nsITelephonyCallback { /** * Called when a dial request is treated as an MMI code and it is about to @@ -191,14 +201,6 @@ interface nsITelephonyCallback : nsISupports */ void notifyDialMMI(in AString serviceCode); - /** - * Called when a dial request fails. - * - * @param error - * Error from RIL. - */ - void notifyDialError(in AString error); - /** * Called when a dial request is treated as a call setup and the result * succeeds. @@ -238,7 +240,7 @@ interface nsITelephonyCallback : nsISupports * XPCOM component (in the content process) that provides the telephony * information. */ -[scriptable, uuid(4ff3ecb7-b024-4752-9dd6-c3623c6e6b8a)] +[scriptable, uuid(600929fb-269c-4ae2-a61f-3c8a62cf5456)] interface nsITelephonyService : nsISupports { const unsigned short CALL_STATE_UNKNOWN = 0; @@ -281,7 +283,7 @@ interface nsITelephonyService : nsISupports * Functionality for making and managing phone calls. */ void dial(in unsigned long clientId, in DOMString number, - in boolean isEmergency, in nsITelephonyCallback callback); + in boolean isEmergency, in nsITelephonyDialCallback callback); void hangUp(in unsigned long clientId, in unsigned long callIndex); void startTone(in unsigned long clientId, in DOMString dtmfChar); From f974940b2324a83ed100799e495df501619ba49d Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Wed, 8 Oct 2014 20:01:00 +0200 Subject: [PATCH 45/79] Bug 1058397 - Part 2: USSDSession interface. r=hsinyi --- dom/webidl/USSDReceivedEvent.webidl | 10 ++++++++-- dom/webidl/USSDSession.webidl | 14 ++++++++++++++ dom/webidl/moz.build | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 dom/webidl/USSDSession.webidl diff --git a/dom/webidl/USSDReceivedEvent.webidl b/dom/webidl/USSDReceivedEvent.webidl index 45be49491afa..627beb3712d4 100644 --- a/dom/webidl/USSDReceivedEvent.webidl +++ b/dom/webidl/USSDReceivedEvent.webidl @@ -4,16 +4,22 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="dom.mobileconnection.enabled", +[Pref="dom.telephony.enabled", + CheckPermissions="telephony mobileconnection", + AvailableIn="CertifiedApps", Constructor(DOMString type, optional USSDReceivedEventInit eventInitDict)] interface USSDReceivedEvent : Event { + readonly attribute unsigned long serviceId; readonly attribute DOMString? message; - readonly attribute boolean sessionEnded; + readonly attribute USSDSession? session; // null if session is ended. + readonly attribute boolean sessionEnded; // deprecated. Bug 1070831 }; dictionary USSDReceivedEventInit : EventInit { + unsigned long serviceId = 0; DOMString? message = null; + USSDSession? session = null; boolean sessionEnded = false; }; diff --git a/dom/webidl/USSDSession.webidl b/dom/webidl/USSDSession.webidl new file mode 100644 index 000000000000..88062f9f831f --- /dev/null +++ b/dom/webidl/USSDSession.webidl @@ -0,0 +1,14 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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="dom.telephony.enabled", + CheckPermissions="telephony", + AvailableIn="CertifiedApps", + Constructor(unsigned long serviceId)] +interface USSDSession { + [Throws] + Promise send(DOMString ussd); +}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 2fe400636b0d..b7b6124eda5e 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -501,6 +501,7 @@ WEBIDL_FILES = [ 'URLSearchParams.webidl', 'URLUtils.webidl', 'URLUtilsReadOnly.webidl', + 'USSDSession.webidl', 'ValidityState.webidl', 'VideoPlaybackQuality.webidl', 'VideoStreamTrack.webidl', From 1525f1cf74d935a303112a0b31eb9fe6c0c1bdb5 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Wed, 8 Oct 2014 20:01:00 +0200 Subject: [PATCH 46/79] Bug 1058397 - Part 3: USSDSession implement. r=hsinyi --- dom/system/gonk/ril_worker.js | 50 ++++++++++-- dom/telephony/USSDSession.cpp | 96 +++++++++++++++++++++++ dom/telephony/USSDSession.h | 61 ++++++++++++++ dom/telephony/gonk/TelephonyService.js | 28 ++++++- dom/telephony/ipc/PTelephony.ipdl | 7 ++ dom/telephony/ipc/TelephonyIPCService.cpp | 8 ++ dom/telephony/ipc/TelephonyParent.cpp | 16 ++++ dom/telephony/ipc/TelephonyParent.h | 3 + dom/telephony/moz.build | 2 + dom/telephony/nsITelephonyService.idl | 12 ++- 10 files changed, 271 insertions(+), 12 deletions(-) create mode 100644 dom/telephony/USSDSession.cpp create mode 100644 dom/telephony/USSDSession.h diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 1b5294f10b35..e90d2c4d5e9c 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -2641,22 +2641,48 @@ RilObject.prototype = { } options.ussd = mmi.fullMMI; + + if (options.startNewSession && this._ussdSession) { + if (DEBUG) this.context.debug("Cancel existing ussd session."); + this.cachedUSSDRequest = options; + this.cancelUSSD({}); + return; + } + this.sendUSSD(options); }, + /** + * Cache the request for send out a new ussd when there is an existing + * session. We should do cancelUSSD first. + */ + cachedUSSDRequest : null, + /** * Send USSD. * * @param ussd * String containing the USSD code. - * + * @param checkSession + * True if an existing session should be there. */ - sendUSSD: function(options) { - let Buf = this.context.Buf; - Buf.newParcel(REQUEST_SEND_USSD, options); - Buf.writeString(options.ussd); - Buf.sendParcel(); - }, + sendUSSD: function(options) { + if (options.checkSession && !this._ussdSession) { + options.success = false; + options.errorMsg = GECKO_ERROR_GENERIC_FAILURE; + this.sendChromeMessage(options); + return; + } + + this.sendRilRequestSendUSSD(options); + }, + + sendRilRequestSendUSSD: function(options) { + let Buf = this.context.Buf; + Buf.newParcel(REQUEST_SEND_USSD, options); + Buf.writeString(options.ussd); + Buf.sendParcel(); + }, /** * Cancel pending USSD. @@ -5681,9 +5707,19 @@ RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, if (DEBUG) { this.context.debug("REQUEST_CANCEL_USSD" + JSON.stringify(options)); } + options.success = (options.rilRequestError === 0); this._ussdSession = !options.success; options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError]; + + // The cancelUSSD is triggered by ril_worker itself. + if (this.cachedUSSDRequest) { + if (DEBUG) this.context.debug("Send out the cached ussd request"); + this.sendUSSD(this.cachedUSSDRequest); + this.cachedUSSDRequest = null; + return; + } + this.sendChromeMessage(options); }; RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) { diff --git a/dom/telephony/USSDSession.cpp b/dom/telephony/USSDSession.cpp new file mode 100644 index 000000000000..4680e782034a --- /dev/null +++ b/dom/telephony/USSDSession.cpp @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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 "mozilla/dom/USSDSession.h" + +#include "mozilla/dom/USSDSessionBinding.h" +#include "mozilla/dom/telephony/TelephonyCallback.h" +#include "nsIGlobalObject.h" +#include "nsServiceManagerUtils.h" + +using namespace mozilla::dom; +using namespace mozilla::dom::telephony; + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(USSDSession, mWindow) +NS_IMPL_CYCLE_COLLECTING_ADDREF(USSDSession) +NS_IMPL_CYCLE_COLLECTING_RELEASE(USSDSession) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(USSDSession) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +USSDSession::USSDSession(nsPIDOMWindow* aWindow, nsITelephonyService* aService, + uint32_t aServiceId) + : mWindow(aWindow), mService(aService), mServiceId(aServiceId) +{ +} + +USSDSession::~USSDSession() +{ +} + +nsPIDOMWindow* +USSDSession::GetParentObject() const +{ + return mWindow; +} + +JSObject* +USSDSession::WrapObject(JSContext* aCx) +{ + return USSDSessionBinding::Wrap(aCx, this); +} + +// WebIDL + +already_AddRefed +USSDSession::Constructor(const GlobalObject& aGlobal, uint32_t aServiceId, + ErrorResult& aRv) +{ + nsCOMPtr window = do_QueryInterface(aGlobal.GetAsSupports()); + if (!window) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return nullptr; + } + + nsCOMPtr ril = + do_GetService(TELEPHONY_SERVICE_CONTRACTID); + if (!ril) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return nullptr; + } + + nsRefPtr session = new USSDSession(window, ril, aServiceId); + return session.forget(); +} + +already_AddRefed +USSDSession::Send(const nsAString& aUssd, ErrorResult& aRv) +{ + if (!mService) { + aRv.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + nsCOMPtr global = do_QueryInterface(mWindow); + if (!global) { + return nullptr; + } + + nsRefPtr promise = Promise::Create(global, aRv); + if (aRv.Failed()) { + return nullptr; + } + + nsCOMPtr callback = new TelephonyCallback(promise); + + nsresult rv = mService->SendUSSD(mServiceId, aUssd, callback); + if (NS_FAILED(rv)) { + promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR); + } + + return promise.forget(); +} diff --git a/dom/telephony/USSDSession.h b/dom/telephony/USSDSession.h new file mode 100644 index 000000000000..a681a1fe91b7 --- /dev/null +++ b/dom/telephony/USSDSession.h @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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_USSDSession_h +#define mozilla_dom_USSDSession_h + +#include "mozilla/Attributes.h" +#include "mozilla/ErrorResult.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "mozilla/dom/Promise.h" +#include "nsAutoPtr.h" +#include "nsCOMPtr.h" +#include "nsCycleCollectionParticipant.h" +#include "nsITelephonyService.h" +#include "nsPIDOMWindow.h" +#include "nsWrapperCache.h" + +struct JSContext; + +namespace mozilla { +namespace dom { + +class USSDSession MOZ_FINAL : public nsISupports, + public nsWrapperCache +{ +public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(USSDSession) + + USSDSession(nsPIDOMWindow* aWindow, nsITelephonyService* aService, + uint32_t aServiceId); + + nsPIDOMWindow* + GetParentObject() const; + + virtual JSObject* + WrapObject(JSContext* aCx) MOZ_OVERRIDE; + + // WebIDL + static already_AddRefed + Constructor(const GlobalObject& aGlobal, uint32_t aServiceId, + ErrorResult& aRv); + + already_AddRefed + Send(const nsAString& aUssd, ErrorResult& aRv); + +private: + ~USSDSession(); + + nsCOMPtr mWindow; + nsCOMPtr mService; + uint32_t mServiceId; +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_USSDSession_h diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index 2f35602d662c..4216814d6e38 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -585,7 +585,7 @@ TelephonyService.prototype = { return; } - this._dialMMI(aClientId, mmi, aCallback); + this._dialMMI(aClientId, mmi, aCallback, true); } }, @@ -673,16 +673,24 @@ TelephonyService.prototype = { }, /** + * @param aClientId + * Client id. * @param aMmi * Parsed MMI structure. + * @param aCallback + * A nsITelephonyDialCallback object. + * @param aStartNewSession + * True to start a new session for ussd request. */ - _dialMMI: function(aClientId, aMmi, aCallback) { + _dialMMI: function(aClientId, aMmi, aCallback, aStartNewSession) { let mmiServiceCode = aMmi ? this._serviceCodeToKeyString(aMmi.serviceCode) : RIL.MMI_KS_SC_USSD; aCallback.notifyDialMMI(mmiServiceCode); - this._sendToRilWorker(aClientId, "sendMMI", { mmi: aMmi }, response => { + this._sendToRilWorker(aClientId, "sendMMI", + { mmi: aMmi, + startNewSession: aStartNewSession }, response => { if (DEBUG) debug("MMI response: " + JSON.stringify(response)); if (!response.success) { @@ -1048,6 +1056,18 @@ TelephonyService.prototype = { this._sendToRilWorker(aClientId, "resumeConference"); }, + sendUSSD: function(aClientId, aUssd, aCallback) { + this._sendToRilWorker(aClientId, "sendUSSD", + { ussd: aUssd, checkSession: true }, + response => { + if (!response.success) { + aCallback.notifyError(response.errorMsg); + } else { + aCallback.notifySuccess(); + } + }); + }, + get microphoneMuted() { return gAudioManager.microphoneMuted; }, @@ -1268,7 +1288,7 @@ TelephonyService.prototype = { dialMMI: function(aClientId, aMmiString, aCallback) { let mmi = this._parseMMI(aMmiString, this._hasCalls(aClientId)); - this._dialMMI(aClientId, mmi, aCallback); + this._dialMMI(aClientId, mmi, aCallback, false); }, /** diff --git a/dom/telephony/ipc/PTelephony.ipdl b/dom/telephony/ipc/PTelephony.ipdl index 22713254526e..229525b58946 100644 --- a/dom/telephony/ipc/PTelephony.ipdl +++ b/dom/telephony/ipc/PTelephony.ipdl @@ -24,10 +24,17 @@ struct DialRequest bool isEmergency; }; +struct USSDRequest +{ + uint32_t clientId; + nsString ussd; +}; + union IPCTelephonyRequest { EnumerateCallsRequest; DialRequest; + USSDRequest; }; sync protocol PTelephony { diff --git a/dom/telephony/ipc/TelephonyIPCService.cpp b/dom/telephony/ipc/TelephonyIPCService.cpp index 65cfe76d7309..1d31ae5c7433 100644 --- a/dom/telephony/ipc/TelephonyIPCService.cpp +++ b/dom/telephony/ipc/TelephonyIPCService.cpp @@ -301,6 +301,14 @@ TelephonyIPCService::StopTone(uint32_t aClientId) return NS_OK; } +NS_IMETHODIMP +TelephonyIPCService::SendUSSD(uint32_t aClientId, const nsAString& aUssd, + nsITelephonyCallback *aCallback) +{ + return SendRequest(nullptr, aCallback, + USSDRequest(aClientId, nsString(aUssd))); +} + NS_IMETHODIMP TelephonyIPCService::GetMicrophoneMuted(bool* aMuted) { diff --git a/dom/telephony/ipc/TelephonyParent.cpp b/dom/telephony/ipc/TelephonyParent.cpp index 6ff9b181ee72..4cb5fe4714a6 100644 --- a/dom/telephony/ipc/TelephonyParent.cpp +++ b/dom/telephony/ipc/TelephonyParent.cpp @@ -43,6 +43,8 @@ TelephonyParent::RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActo return actor->DoRequest(aRequest.get_EnumerateCallsRequest()); case IPCTelephonyRequest::TDialRequest: return actor->DoRequest(aRequest.get_DialRequest()); + case IPCTelephonyRequest::TUSSDRequest: + return actor->DoRequest(aRequest.get_USSDRequest()); default: MOZ_CRASH("Unknown type!"); } @@ -435,6 +437,20 @@ TelephonyRequestParent::DoRequest(const DialRequest& aRequest) return true; } +bool +TelephonyRequestParent::DoRequest(const USSDRequest& aRequest) +{ + nsCOMPtr service = + do_GetService(TELEPHONY_SERVICE_CONTRACTID); + if (service) { + service->SendUSSD(aRequest.clientId(), aRequest.ussd(), this); + } else { + return NS_SUCCEEDED(NotifyError(NS_LITERAL_STRING("InvalidStateError"))); + } + + return true; +} + nsresult TelephonyRequestParent::SendResponse(const IPCTelephonyResponse& aResponse) { diff --git a/dom/telephony/ipc/TelephonyParent.h b/dom/telephony/ipc/TelephonyParent.h index 2fc5da22ff0c..e88710e092d1 100644 --- a/dom/telephony/ipc/TelephonyParent.h +++ b/dom/telephony/ipc/TelephonyParent.h @@ -126,6 +126,9 @@ private: bool DoRequest(const DialRequest& aRequest); + + bool + DoRequest(const USSDRequest& aRequest); }; END_TELEPHONY_NAMESPACE diff --git a/dom/telephony/moz.build b/dom/telephony/moz.build index 3b670ccc31f3..a8fdfc99cc40 100644 --- a/dom/telephony/moz.build +++ b/dom/telephony/moz.build @@ -16,6 +16,7 @@ EXPORTS.mozilla.dom += [ 'TelephonyCall.h', 'TelephonyCallGroup.h', 'TelephonyCallId.h', + 'USSDSession.h' ] EXPORTS.mozilla.dom.telephony += [ @@ -37,6 +38,7 @@ UNIFIED_SOURCES += [ 'TelephonyCallGroup.cpp', 'TelephonyCallId.cpp', 'TelephonyDialCallback.cpp', + 'USSDSession.cpp', ] IPDL_SOURCES += [ diff --git a/dom/telephony/nsITelephonyService.idl b/dom/telephony/nsITelephonyService.idl index 3c52f6c6677f..56872631ebd4 100644 --- a/dom/telephony/nsITelephonyService.idl +++ b/dom/telephony/nsITelephonyService.idl @@ -240,7 +240,7 @@ interface nsITelephonyDialCallback : nsITelephonyCallback * XPCOM component (in the content process) that provides the telephony * information. */ -[scriptable, uuid(600929fb-269c-4ae2-a61f-3c8a62cf5456)] +[scriptable, uuid(79188caa-046a-48e1-b9c5-2e891504dc7a)] interface nsITelephonyService : nsISupports { const unsigned short CALL_STATE_UNKNOWN = 0; @@ -299,6 +299,16 @@ interface nsITelephonyService : nsISupports void holdConference(in unsigned long clientId); void resumeConference(in unsigned long clientId); + /** + * Send an USSD on existing session. It results in error if the session is + * not existed. + * + * If successful, callback.notifySuccess() will be called. + * Otherwise, callback.notifyError() will be called. + */ + void sendUSSD(in unsigned long clientId, in DOMString ussd, + in nsITelephonyCallback callback); + attribute bool microphoneMuted; attribute bool speakerEnabled; }; From 2709d86f49cc58f074243aa26f228431d2463e98 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Wed, 8 Oct 2014 20:02:00 +0200 Subject: [PATCH 47/79] Bug 1058397 - Part 4: Wrap system message. r=hsinyi --- .../gonk/MobileConnectionService.js | 8 --- dom/system/gonk/RadioInterfaceLayer.js | 12 ++--- dom/telephony/gonk/TelephonyService.js | 54 ++++++++++++++++++- dom/telephony/gonk/TelephonyService.manifest | 3 ++ dom/telephony/nsIGonkTelephonyService.idl | 5 +- 5 files changed, 66 insertions(+), 16 deletions(-) diff --git a/dom/mobileconnection/gonk/MobileConnectionService.js b/dom/mobileconnection/gonk/MobileConnectionService.js index 5de6889dffd1..5d4febc65e8d 100644 --- a/dom/mobileconnection/gonk/MobileConnectionService.js +++ b/dom/mobileconnection/gonk/MobileConnectionService.js @@ -1056,14 +1056,6 @@ MobileConnectionService.prototype = { this.getItemByServiceId(aClientId) .deliverListenerEvent("notifyUssdReceived", [aMessage, aSessionEnded]); - - let info = { - message: aMessage, - sessionEnded: aSessionEnded, - serviceId: aClientId - }; - - gSystemMessenger.broadcastMessage("ussd-received", info); }, notifyDataError: function(aClientId, aMessage) { diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index d3fb3cbce5b8..e119d42f7048 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -1976,13 +1976,18 @@ RadioInterface.prototype = { gTelephonyService.notifyConferenceCallStateChanged(message.state); break; case "cdmaCallWaiting": - gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.waitingCall); + gTelephonyService.notifyCdmaCallWaiting(this.clientId, + message.waitingCall); break; case "suppSvcNotification": gTelephonyService.notifySupplementaryService(this.clientId, message.callIndex, message.notification); break; + case "ussdreceived": + gTelephonyService.notifyUssdReceived(this.clientId, message.message, + message.sessionEnded); + break; case "datacallerror": connHandler.handleDataCallError(message); break; @@ -2036,11 +2041,6 @@ RadioInterface.prototype = { gRadioEnabledController.notifyRadioStateChanged(this.clientId, message.radioState); break; - case "ussdreceived": - gMobileConnectionService.notifyUssdReceived(this.clientId, - message.message, - message.sessionEnded); - break; case "cardstatechange": this.rilContext.cardState = message.cardState; gRadioEnabledController.receiveCardState(this.clientId); diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index 4216814d6e38..3d870d94a4b7 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -1286,6 +1286,24 @@ TelephonyService.prototype = { this._notifyAllListeners("conferenceCallStateChanged", [aState]); }, + notifyUssdReceived: function(aClientId, aMessage, aSessionEnded) { + if (DEBUG) { + debug("notifyUssdReceived for " + aClientId + ": " + + aMessage + " (sessionEnded : " + aSessionEnded + ")"); + } + + let info = { + serviceId: aClientId, + message: aMessage, + sessionEnded: aSessionEnded + }; + + gSystemMessenger.broadcastMessage("ussd-received", info); + + gGonkMobileConnectionService.notifyUssdReceived(aClientId, aMessage, + aSessionEnded); + }, + dialMMI: function(aClientId, aMmiString, aCallback) { let mmi = this._parseMMI(aMmiString, this._hasCalls(aClientId)); this._dialMMI(aClientId, mmi, aCallback, false); @@ -1315,4 +1333,38 @@ TelephonyService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelephonyService]); +/** + * This implements nsISystemMessagesWrapper.wrapMessage(), which provides a + * plugable way to wrap a "ussd-received" type system message. + * + * Please see SystemMessageManager.js to know how it customizes the wrapper. + */ +function USSDReceivedWrapper() { + if (DEBUG) debug("USSDReceivedWrapper()"); +} +USSDReceivedWrapper.prototype = { + // nsISystemMessagesWrapper implementation. + wrapMessage: function(aMessage, aWindow) { + if (DEBUG) debug("wrapMessage: " + JSON.stringify(aMessage)); + + let session = aMessage.sessionEnded ? null : + new aWindow.USSDSession(aMessage.serviceId); + + let event = new aWindow.USSDReceivedEvent("ussdreceived", { + serviceId: aMessage.serviceId, + message: aMessage.message, + sessionEnded: aMessage.sessionEnded, + session: session + }); + + return event; + }, + + classDescription: "USSDReceivedWrapper", + classID: Components.ID("{d03684ed-ede4-4210-8206-f4f32772d9f5}"), + contractID: "@mozilla.org/dom/system-messages/wrapper/ussd-received;1", + QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessagesWrapper]) +}; + +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelephonyService, + USSDReceivedWrapper]); diff --git a/dom/telephony/gonk/TelephonyService.manifest b/dom/telephony/gonk/TelephonyService.manifest index fae2b0641dcc..28c8d8633f07 100644 --- a/dom/telephony/gonk/TelephonyService.manifest +++ b/dom/telephony/gonk/TelephonyService.manifest @@ -1,2 +1,5 @@ component {67d26434-d063-4d28-9f48-5b3189788155} TelephonyService.js contract @mozilla.org/telephony/gonktelephonyservice;1 {67d26434-d063-4d28-9f48-5b3189788155} + +component {d03684ed-ede4-4210-8206-f4f32772d9f5} TelephonyService.js +contract @mozilla.org/dom/system-messages/wrapper/ussd-received;1 {d03684ed-ede4-4210-8206-f4f32772d9f5} diff --git a/dom/telephony/nsIGonkTelephonyService.idl b/dom/telephony/nsIGonkTelephonyService.idl index 61a65074c23a..f8ff7172f49c 100644 --- a/dom/telephony/nsIGonkTelephonyService.idl +++ b/dom/telephony/nsIGonkTelephonyService.idl @@ -10,7 +10,7 @@ "@mozilla.org/telephony/gonktelephonyservice;1" %} -[scriptable, uuid(518165dc-2d55-4db3-9549-60dc4062d1c5)] +[scriptable, uuid(79eec3c3-2dfc-4bbf-b106-af5457651ae0)] interface nsIGonkTelephonyService : nsITelephonyService { void notifyCallDisconnected(in unsigned long clientId, in jsval call); @@ -27,6 +27,9 @@ interface nsIGonkTelephonyService : nsITelephonyService void notifyConferenceCallStateChanged(in short state); + void notifyUssdReceived(in unsigned long clientId, in DOMString message, + in boolean sessionEnded); + void dialMMI(in unsigned long clientId, in AString mmiString, in nsITelephonyDialCallback callback); }; From 6fbc9cc47c2121248a3f977d2df3ae5d95506bea Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 05:05:45 -0700 Subject: [PATCH 48/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/f120e79a6735 Author: Ben Francis Desc: Merge pull request #24958 from benfrancis/1075011 Bug 1075011 - Swap browser app for search app on old homescreen r=kgrandon ======== https://hg.mozilla.org/integration/gaia-central/rev/d2492f566ca1 Author: Ben Francis Desc: Bug 1075011 - Swap browser app for search app on old homescreen --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index de1748e7ccd9..335fe934ef15 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "bdc36dfa436939f83368c0d2976176b01a0d8049", + "revision": "f120e79a6735573f98b7a121e350cf01bcd855d3", "repo_path": "/integration/gaia-central" } From aab2779f9afbc52d1166f325e17070fc8d8d9e7e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 05:11:56 -0700 Subject: [PATCH 49/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 74ce8aafd624..c74c74263561 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7f60f2ef8461..3bc2d8c3c6cf 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 09aa3225c459..68e2cd13673b 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 20fb6d5a482d..ccb3181295cf 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7f60f2ef8461..3bc2d8c3c6cf 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index ed334dd54320..b155666c8ff4 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7b700e3f1a93..99ba25bc3327 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 61f7c18ac1f5..cb46fa26ad7a 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0df568063f70..704767b3341a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6ee78937575b..578ebbe217c2 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 39b7290a7e83..1240874f6ee7 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 04e0057fd0b6ec9946779b02af1353728da03ce9 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 05:50:48 -0700 Subject: [PATCH 50/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/b4ad6c153e80 Author: Aleh Zasypkin Desc: Merge pull request #23901 from azasypkin/bug-1058459-share-drafts Bug 1058459 - [SMS] Data shared from other applications are not shown as Drafts until the app is killed and open again. r=schung ======== https://hg.mozilla.org/integration/gaia-central/rev/047fab1e5724 Author: Aleh Zasypkin Desc: Bug 1058459 - [SMS] Data shared from other applications are not shown as Drafts until the app is killed and open again. Using SharedWorker as inter app communication bus. r=schung --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 335fe934ef15..23b306db3ddb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "f120e79a6735573f98b7a121e350cf01bcd855d3", + "revision": "b4ad6c153e80752fbc5dae6ea66cc2178173832d", "repo_path": "/integration/gaia-central" } From 2db33f9d434b0d804ed171c351ba8049ee197ebc Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 05:56:57 -0700 Subject: [PATCH 51/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index c74c74263561..8d11dbe85e63 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3bc2d8c3c6cf..c9cb2fafc138 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 68e2cd13673b..42417f5054c4 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ccb3181295cf..c68d3d573b3f 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3bc2d8c3c6cf..c9cb2fafc138 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index b155666c8ff4..d80a7a59d069 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 99ba25bc3327..62b0da2fe0f7 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index cb46fa26ad7a..d737341a997e 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 704767b3341a..e7718691607a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 578ebbe217c2..c50289c800cc 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 1240874f6ee7..f5d78d6bc0ff 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From f32d972055caed08732c2586c48c4ca7d4b5b724 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 06:05:47 -0700 Subject: [PATCH 52/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/36b8b1df0f7a Author: Florin Strugariu Desc: Merge pull request #24879 from chirarobert/fix_keyboard Bug 1078247 - [v2.2] Fix keyboard object app after updates from Bug 9963... ======== https://hg.mozilla.org/integration/gaia-central/rev/4b6ea5745b43 Author: Robert Chira Desc: Bug 1078247 - [v2.2] Fix keyboard object app after updates from Bug 996332 --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 23b306db3ddb..c126ee6707ee 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "b4ad6c153e80752fbc5dae6ea66cc2178173832d", + "revision": "36b8b1df0f7a15fcf4a5d1063bce06e8dc0f76a6", "repo_path": "/integration/gaia-central" } From f97ba9dd3f03efeb35c104e72b28c0e476632cc6 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 06:07:33 -0700 Subject: [PATCH 53/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 8d11dbe85e63..b6f803d06cb0 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c9cb2fafc138..99b39411a0ff 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 42417f5054c4..f3b11abb60f9 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index c68d3d573b3f..e1bce4fec156 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c9cb2fafc138..99b39411a0ff 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d80a7a59d069..9c7bdb126dd0 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 62b0da2fe0f7..f226809a28cc 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d737341a997e..48ca3c95517a 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e7718691607a..4b40f3c2bff5 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index c50289c800cc..c4ddf7064a02 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index f5d78d6bc0ff..b39680ea6d7c 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From bc194a1d9676133c909370b910d76444f71ec55c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 06:20:47 -0700 Subject: [PATCH 54/79] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ac26decce30e Author: Miller Medeiros Desc: Merge pull request #24950 from millermedeiros/1065520-week-view-delete Bug 1065520 - [Calendar][Week View] Events still display in Week view after they are deleted from another View r=gaye ======== https://hg.mozilla.org/integration/gaia-central/rev/ed41504130cd Author: Miller Medeiros Desc: Bug 1065520 - [Calendar][Week View] Events still display in Week view after they are deleted from another View --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c126ee6707ee..3860affb4b05 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "36b8b1df0f7a15fcf4a5d1063bce06e8dc0f76a6", + "revision": "ac26decce30e2927d98b1969a32e5353e57c767f", "repo_path": "/integration/gaia-central" } From 7d2a168070b9c76c9bb3cd300efad487950f4c3f Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 06:27:36 -0700 Subject: [PATCH 55/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index b6f803d06cb0..33890a96a7d4 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 99b39411a0ff..9e0cb0237910 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index f3b11abb60f9..d55fbe9b2b7e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index e1bce4fec156..90d7432c91a5 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 99b39411a0ff..9e0cb0237910 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 9c7bdb126dd0..7ef309669d84 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index f226809a28cc..f77154350e17 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 48ca3c95517a..80d49d707a90 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 4b40f3c2bff5..ea2524e8629f 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index c4ddf7064a02..ca1fff853fbc 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b39680ea6d7c..b401d90e3c46 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 9261b9ccddbf6889d4fa85550400354da9e8c6c7 Mon Sep 17 00:00:00 2001 From: Morris Tseng Date: Tue, 7 Oct 2014 02:28:00 -0400 Subject: [PATCH 56/79] Bug 1027631 - Send touch caret tap event. r=ehsan --- b2g/chrome/content/shell.js | 8 ++++ .../BrowserElementChildPreload.js | 11 +++++ dom/browser-element/BrowserElementParent.jsm | 9 +++- layout/base/TouchCaret.cpp | 42 ++++++++++++++++++- layout/base/TouchCaret.h | 7 ++++ 5 files changed, 75 insertions(+), 2 deletions(-) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 1fa01820bdc6..ae5b7479d834 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -333,6 +333,7 @@ var shell = { this.contentBrowser.addEventListener('mozbrowserloadstart', this, true); this.contentBrowser.addEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.addEventListener('mozbrowserscrollviewchange', this, true); + this.contentBrowser.addEventListener('mozbrowsertouchcarettap', this, true); CustomEventManager.init(); WebappsHelper.init(); @@ -361,6 +362,7 @@ var shell = { this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true); this.contentBrowser.removeEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.removeEventListener('mozbrowserscrollviewchange', this, true); + this.contentBrowser.removeEventListener('mozbrowsertouchcarettap', this, true); ppmm.removeMessageListener("content-handler", this); UserAgentOverrides.uninit(); @@ -508,6 +510,12 @@ var shell = { detail: evt.detail, }); break; + case 'mozbrowsertouchcarettap': + this.sendChromeEvent({ + type: 'touchcarettap', + detail: evt.detail, + }); + break; case 'mozbrowserselectionchange': // The mozbrowserselectionchange event, may have crossed the chrome-content boundary. // This event always dispatch to shell.js. But the offset we got from this event is diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 9d9dc207890d..9b1ee279b9ff 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -226,6 +226,12 @@ BrowserElementChild.prototype = { /* useCapture = */ false, /* wantsUntrusted = */ false); + addEventListener('touchcarettap', + this._touchCaretTapHandler.bind(this), + /* useCapture = */ false, + /* wantsUntrusted = */ false); + + // This listens to unload events from our message manager, but /not/ from // the |content| window. That's because the window's unload event doesn't // bubble, and we're not using a capturing listener. If we'd used @@ -631,6 +637,11 @@ BrowserElementChild.prototype = { sendAsyncMsg('metachange', meta); }, + _touchCaretTapHandler: function(e) { + e.stopPropagation(); + sendAsyncMsg('touchcarettap'); + }, + _ScrollViewChangeHandler: function(e) { e.stopPropagation(); let detail = { diff --git a/dom/browser-element/BrowserElementParent.jsm b/dom/browser-element/BrowserElementParent.jsm index 066c59a040a8..588536c21144 100644 --- a/dom/browser-element/BrowserElementParent.jsm +++ b/dom/browser-element/BrowserElementParent.jsm @@ -258,7 +258,8 @@ BrowserElementParent.prototype = { "visibilitychange": this._childVisibilityChange, "got-set-input-method-active": this._gotDOMRequestResult, "selectionchange": this._handleSelectionChange, - "scrollviewchange": this._handleScrollViewChange + "scrollviewchange": this._handleScrollViewChange, + "touchcarettap": this._handleTouchCaretTap }; let mmSecuritySensitiveCalls = { @@ -505,6 +506,12 @@ BrowserElementParent.prototype = { this._frameElement.dispatchEvent(evt); }, + _handleTouchCaretTap: function(data) { + let evt = this._createEvent("touchcarettap", data.json, + /* cancelable = */ false); + this._frameElement.dispatchEvent(evt); + }, + _createEvent: function(evtName, detail, cancelable) { // This will have to change if we ever want to send a CustomEvent with null // detail. For now, it's OK. diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index 98822a8895c9..acc79de2a8d6 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -30,6 +30,7 @@ #include "nsView.h" #include "nsDOMTokenList.h" #include "nsCaret.h" +#include "mozilla/dom/CustomEvent.h" using namespace mozilla; @@ -58,7 +59,8 @@ TouchCaret::TouchCaret(nsIPresShell* aPresShell) : mState(TOUCHCARET_NONE), mActiveTouchId(-1), mCaretCenterToDownPointOffsetY(0), - mVisible(false) + mVisible(false), + mIsValidTap(false) { TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell); MOZ_ASSERT(NS_IsMainThread()); @@ -601,6 +603,7 @@ TouchCaret::HandleMouseMoveEvent(WidgetMouseEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); + mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -638,6 +641,7 @@ TouchCaret::HandleTouchMoveEvent(WidgetTouchEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); + mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -848,6 +852,35 @@ TouchCaret::HandleTouchDownEvent(WidgetTouchEvent* aEvent) return status; } +void +TouchCaret::DispatchTapEvent() +{ + nsCOMPtr presShell = do_QueryReferent(mPresShell); + if (!presShell) { + return; + } + + nsCOMPtr doc = presShell->GetDocument(); + if (!doc) { + return; + } + + ErrorResult res; + nsRefPtr domEvent = + doc->CreateEvent(NS_LITERAL_STRING("CustomEvent"), res); + if (res.Failed()) { + return; + } + + CustomEvent* customEvent = static_cast(domEvent.get()); + customEvent->InitCustomEvent(NS_LITERAL_STRING("touchcarettap"), + true, false, nullptr); + customEvent->SetTrusted(true); + customEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true; + bool ret; + doc->DispatchEvent(domEvent, &ret); +} + void TouchCaret::SetState(TouchCaretState aState) { @@ -879,5 +912,12 @@ TouchCaret::SetState(TouchCaretState aState) if (mState == TOUCHCARET_NONE) { mActiveTouchId = -1; mCaretCenterToDownPointOffsetY = 0; + if (mIsValidTap) { + DispatchTapEvent(); + mIsValidTap = false; + } + } else if (mState == TOUCHCARET_TOUCHDRAG_ACTIVE || + mState == TOUCHCARET_MOUSEDRAG_ACTIVE) { + mIsValidTap = true; } } diff --git a/layout/base/TouchCaret.h b/layout/base/TouchCaret.h index ab3d4ef94e39..32bf995d6f8e 100644 --- a/layout/base/TouchCaret.h +++ b/layout/base/TouchCaret.h @@ -209,6 +209,11 @@ private: */ void SetState(TouchCaretState aState); + /** + * Dispatch touch caret tap event to chrome. + */ + void DispatchTapEvent(); + /** * Current state we're dealing with. */ @@ -249,6 +254,8 @@ private: // Touch caret visibility bool mVisible; + // Use for detecting single tap on touch caret. + bool mIsValidTap; // Touch caret timer nsCOMPtr mTouchCaretExpirationTimer; From 343378644a3610272d1ab5f0a6f412bad9a5bcf5 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Tue, 7 Oct 2014 06:35:00 -0400 Subject: [PATCH 57/79] Bug 1076597 - Fix Settings API shutdown race condition. r=bent --- dom/settings/SettingsRequestManager.jsm | 29 ++++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/dom/settings/SettingsRequestManager.jsm b/dom/settings/SettingsRequestManager.jsm index 21e7ac2028ba..9ffcece82edb 100644 --- a/dom/settings/SettingsRequestManager.jsm +++ b/dom/settings/SettingsRequestManager.jsm @@ -743,20 +743,33 @@ let SettingsRequestManager = { } }, - removeMessageManager: function(aMsgMgr){ + removeMessageManager: function(aMsgMgr, aPrincipal) { if (DEBUG) debug("Removing message manager"); this.removeObserver(aMsgMgr); let closedLockIDs = []; let lockIDs = Object.keys(this.lockInfo); for (let i in lockIDs) { - if (this.lockInfo[lockIDs[i]]._mm == aMsgMgr) { - if (DEBUG) debug("Removing lock " + lockIDs[i] + " due to process close/crash"); - closedLockIDs.push(lockIDs[i]); + let lock = this.lockInfo[lockIDs[i]]; + if (lock._mm == aMsgMgr) { + let is_finalizing = false; + for (let task_index in lock.tasks) { + if (lock.tasks[task_index].operation === "finalize") { + is_finalizing = true; + break; + } + } + if (!is_finalizing) { + this.queueTask("finalize", {lockID: lockIDs[i]}, aPrincipal).then( + function() { + if (DEBUG) debug("Lock " + lockIDs[i] + " with dead message manager finalized"); + }, + function(error) { + if (DEBUG) debug("Lock " + lockIDs[i] + " with dead message manager NOT FINALIZED due to error: " + error); + } + ); + } } } - for (let i in closedLockIDs) { - this.removeLock(closedLockIDs[i]); - } }, receiveMessage: function(aMessage) { @@ -812,7 +825,7 @@ let SettingsRequestManager = { switch (aMessage.name) { case "child-process-shutdown": if (DEBUG) debug("Child process shutdown received."); - this.removeMessageManager(mm); + this.removeMessageManager(mm, aMessage.principal); break; case "Settings:RegisterForMessages": if (!SettingsPermissions.hasSomeReadPermission(aMessage.principal)) { From b01fa9f557dc3a87278a9fe6f5e5da1ba6a19f02 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 08:39:21 -0700 Subject: [PATCH 58/79] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/e58f3b4297d4 Author: Ryan VanderMeulen Desc: Merge pull request #24953 from eliperelman/bug-1079700 Bug 1079700 - Correcting errors in performance testing ======== https://hg.mozilla.org/integration/gaia-central/rev/34e18affed8e Author: Eli Perelman Desc: Bug 1079700 - Correcting errors in performance testing r=hfiguiere ======== https://hg.mozilla.org/integration/gaia-central/rev/3fcf0aaa50a9 Author: Douglas Sherk Desc: Merge pull request #24961 from DouglasSherk/1079440-dialer-multicall-keypad Bug 1079440 - Fix call indicators overlapping with multiple calls. r=gtorodelvalle ======== https://hg.mozilla.org/integration/gaia-central/rev/f58015ce49a9 Author: Doug Sherk Desc: Bug 1079440 - Fix call indicators overlapping with multiple calls. r=gtorodelvalle --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 3860affb4b05..b989de78b09e 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ac26decce30e2927d98b1969a32e5353e57c767f", + "revision": "e58f3b4297d4a8b416eab4050e8cdc132a171d5f", "repo_path": "/integration/gaia-central" } From 9e0116a4f759a0f434a9d47fc9a0dd3436218bc7 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 08:39:35 -0700 Subject: [PATCH 59/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 4 ++-- b2g/config/emulator-ics/sources.xml | 4 ++-- b2g/config/emulator-jb/sources.xml | 4 ++-- b2g/config/emulator-kk/sources.xml | 4 ++-- b2g/config/emulator/sources.xml | 4 ++-- b2g/config/flame-kk/sources.xml | 4 ++-- b2g/config/flame/sources.xml | 4 ++-- b2g/config/hamachi/sources.xml | 4 ++-- b2g/config/helix/sources.xml | 4 ++-- b2g/config/nexus-4/sources.xml | 4 ++-- b2g/config/wasabi/sources.xml | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 33890a96a7d4..7d99397aa78c 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,9 +15,9 @@ - + - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 9e0cb0237910..e910c13c9169 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,8 +19,8 @@ - - + + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d55fbe9b2b7e..dbf63f97801f 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,8 +17,8 @@ - - + + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 90d7432c91a5..8815559a8d60 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,9 +15,9 @@ - + - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 9e0cb0237910..e910c13c9169 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,8 +19,8 @@ - - + + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 7ef309669d84..09e135fb2452 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,9 +15,9 @@ - + - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index f77154350e17..8cfe20f80cb4 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,8 +17,8 @@ - - + + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 80d49d707a90..fec0cc41e1d8 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,8 +17,8 @@ - - + + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index ea2524e8629f..1e78dc7043c0 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,8 +15,8 @@ - - + + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index ca1fff853fbc..2dfedfb14f2b 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,8 +17,8 @@ - - + + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b401d90e3c46..ae051c932300 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,8 +17,8 @@ - - + + From b3ab357b12d655e368f6a0d528f9d0fa61d0fca4 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 9 Oct 2014 11:39:12 -0400 Subject: [PATCH 60/79] Backed out changeset 0f7fe4800ace for landing with the wrong bug number. --HG-- extra : rebase_source : fe37a4e6b566cb2121079ad95bfdce99ab997d33 --- b2g/chrome/content/shell.js | 8 ---- .../BrowserElementChildPreload.js | 11 ----- dom/browser-element/BrowserElementParent.jsm | 9 +--- layout/base/TouchCaret.cpp | 42 +------------------ layout/base/TouchCaret.h | 7 ---- 5 files changed, 2 insertions(+), 75 deletions(-) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index ae5b7479d834..1fa01820bdc6 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -333,7 +333,6 @@ var shell = { this.contentBrowser.addEventListener('mozbrowserloadstart', this, true); this.contentBrowser.addEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.addEventListener('mozbrowserscrollviewchange', this, true); - this.contentBrowser.addEventListener('mozbrowsertouchcarettap', this, true); CustomEventManager.init(); WebappsHelper.init(); @@ -362,7 +361,6 @@ var shell = { this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true); this.contentBrowser.removeEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.removeEventListener('mozbrowserscrollviewchange', this, true); - this.contentBrowser.removeEventListener('mozbrowsertouchcarettap', this, true); ppmm.removeMessageListener("content-handler", this); UserAgentOverrides.uninit(); @@ -510,12 +508,6 @@ var shell = { detail: evt.detail, }); break; - case 'mozbrowsertouchcarettap': - this.sendChromeEvent({ - type: 'touchcarettap', - detail: evt.detail, - }); - break; case 'mozbrowserselectionchange': // The mozbrowserselectionchange event, may have crossed the chrome-content boundary. // This event always dispatch to shell.js. But the offset we got from this event is diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 9b1ee279b9ff..9d9dc207890d 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -226,12 +226,6 @@ BrowserElementChild.prototype = { /* useCapture = */ false, /* wantsUntrusted = */ false); - addEventListener('touchcarettap', - this._touchCaretTapHandler.bind(this), - /* useCapture = */ false, - /* wantsUntrusted = */ false); - - // This listens to unload events from our message manager, but /not/ from // the |content| window. That's because the window's unload event doesn't // bubble, and we're not using a capturing listener. If we'd used @@ -637,11 +631,6 @@ BrowserElementChild.prototype = { sendAsyncMsg('metachange', meta); }, - _touchCaretTapHandler: function(e) { - e.stopPropagation(); - sendAsyncMsg('touchcarettap'); - }, - _ScrollViewChangeHandler: function(e) { e.stopPropagation(); let detail = { diff --git a/dom/browser-element/BrowserElementParent.jsm b/dom/browser-element/BrowserElementParent.jsm index 588536c21144..066c59a040a8 100644 --- a/dom/browser-element/BrowserElementParent.jsm +++ b/dom/browser-element/BrowserElementParent.jsm @@ -258,8 +258,7 @@ BrowserElementParent.prototype = { "visibilitychange": this._childVisibilityChange, "got-set-input-method-active": this._gotDOMRequestResult, "selectionchange": this._handleSelectionChange, - "scrollviewchange": this._handleScrollViewChange, - "touchcarettap": this._handleTouchCaretTap + "scrollviewchange": this._handleScrollViewChange }; let mmSecuritySensitiveCalls = { @@ -506,12 +505,6 @@ BrowserElementParent.prototype = { this._frameElement.dispatchEvent(evt); }, - _handleTouchCaretTap: function(data) { - let evt = this._createEvent("touchcarettap", data.json, - /* cancelable = */ false); - this._frameElement.dispatchEvent(evt); - }, - _createEvent: function(evtName, detail, cancelable) { // This will have to change if we ever want to send a CustomEvent with null // detail. For now, it's OK. diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index acc79de2a8d6..98822a8895c9 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -30,7 +30,6 @@ #include "nsView.h" #include "nsDOMTokenList.h" #include "nsCaret.h" -#include "mozilla/dom/CustomEvent.h" using namespace mozilla; @@ -59,8 +58,7 @@ TouchCaret::TouchCaret(nsIPresShell* aPresShell) : mState(TOUCHCARET_NONE), mActiveTouchId(-1), mCaretCenterToDownPointOffsetY(0), - mVisible(false), - mIsValidTap(false) + mVisible(false) { TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell); MOZ_ASSERT(NS_IsMainThread()); @@ -603,7 +601,6 @@ TouchCaret::HandleMouseMoveEvent(WidgetMouseEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); - mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -641,7 +638,6 @@ TouchCaret::HandleTouchMoveEvent(WidgetTouchEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); - mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -852,35 +848,6 @@ TouchCaret::HandleTouchDownEvent(WidgetTouchEvent* aEvent) return status; } -void -TouchCaret::DispatchTapEvent() -{ - nsCOMPtr presShell = do_QueryReferent(mPresShell); - if (!presShell) { - return; - } - - nsCOMPtr doc = presShell->GetDocument(); - if (!doc) { - return; - } - - ErrorResult res; - nsRefPtr domEvent = - doc->CreateEvent(NS_LITERAL_STRING("CustomEvent"), res); - if (res.Failed()) { - return; - } - - CustomEvent* customEvent = static_cast(domEvent.get()); - customEvent->InitCustomEvent(NS_LITERAL_STRING("touchcarettap"), - true, false, nullptr); - customEvent->SetTrusted(true); - customEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true; - bool ret; - doc->DispatchEvent(domEvent, &ret); -} - void TouchCaret::SetState(TouchCaretState aState) { @@ -912,12 +879,5 @@ TouchCaret::SetState(TouchCaretState aState) if (mState == TOUCHCARET_NONE) { mActiveTouchId = -1; mCaretCenterToDownPointOffsetY = 0; - if (mIsValidTap) { - DispatchTapEvent(); - mIsValidTap = false; - } - } else if (mState == TOUCHCARET_TOUCHDRAG_ACTIVE || - mState == TOUCHCARET_MOUSEDRAG_ACTIVE) { - mIsValidTap = true; } } diff --git a/layout/base/TouchCaret.h b/layout/base/TouchCaret.h index 32bf995d6f8e..ab3d4ef94e39 100644 --- a/layout/base/TouchCaret.h +++ b/layout/base/TouchCaret.h @@ -209,11 +209,6 @@ private: */ void SetState(TouchCaretState aState); - /** - * Dispatch touch caret tap event to chrome. - */ - void DispatchTapEvent(); - /** * Current state we're dealing with. */ @@ -254,8 +249,6 @@ private: // Touch caret visibility bool mVisible; - // Use for detecting single tap on touch caret. - bool mIsValidTap; // Touch caret timer nsCOMPtr mTouchCaretExpirationTimer; From d1862b0e6a3548adec24baf4800be6400cc8f16d Mon Sep 17 00:00:00 2001 From: Morris Tseng Date: Tue, 7 Oct 2014 02:28:00 -0400 Subject: [PATCH 61/79] Bug 1067231 - Send touch caret tap event. r=ehsan DONTBUILD --HG-- extra : rebase_source : 0dfc843425bccd13da56fd17d9d854352b07f9a3 --- b2g/chrome/content/shell.js | 8 ++++ .../BrowserElementChildPreload.js | 11 +++++ dom/browser-element/BrowserElementParent.jsm | 9 +++- layout/base/TouchCaret.cpp | 42 ++++++++++++++++++- layout/base/TouchCaret.h | 7 ++++ 5 files changed, 75 insertions(+), 2 deletions(-) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 1fa01820bdc6..ae5b7479d834 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -333,6 +333,7 @@ var shell = { this.contentBrowser.addEventListener('mozbrowserloadstart', this, true); this.contentBrowser.addEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.addEventListener('mozbrowserscrollviewchange', this, true); + this.contentBrowser.addEventListener('mozbrowsertouchcarettap', this, true); CustomEventManager.init(); WebappsHelper.init(); @@ -361,6 +362,7 @@ var shell = { this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true); this.contentBrowser.removeEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.removeEventListener('mozbrowserscrollviewchange', this, true); + this.contentBrowser.removeEventListener('mozbrowsertouchcarettap', this, true); ppmm.removeMessageListener("content-handler", this); UserAgentOverrides.uninit(); @@ -508,6 +510,12 @@ var shell = { detail: evt.detail, }); break; + case 'mozbrowsertouchcarettap': + this.sendChromeEvent({ + type: 'touchcarettap', + detail: evt.detail, + }); + break; case 'mozbrowserselectionchange': // The mozbrowserselectionchange event, may have crossed the chrome-content boundary. // This event always dispatch to shell.js. But the offset we got from this event is diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 9d9dc207890d..9b1ee279b9ff 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -226,6 +226,12 @@ BrowserElementChild.prototype = { /* useCapture = */ false, /* wantsUntrusted = */ false); + addEventListener('touchcarettap', + this._touchCaretTapHandler.bind(this), + /* useCapture = */ false, + /* wantsUntrusted = */ false); + + // This listens to unload events from our message manager, but /not/ from // the |content| window. That's because the window's unload event doesn't // bubble, and we're not using a capturing listener. If we'd used @@ -631,6 +637,11 @@ BrowserElementChild.prototype = { sendAsyncMsg('metachange', meta); }, + _touchCaretTapHandler: function(e) { + e.stopPropagation(); + sendAsyncMsg('touchcarettap'); + }, + _ScrollViewChangeHandler: function(e) { e.stopPropagation(); let detail = { diff --git a/dom/browser-element/BrowserElementParent.jsm b/dom/browser-element/BrowserElementParent.jsm index 066c59a040a8..588536c21144 100644 --- a/dom/browser-element/BrowserElementParent.jsm +++ b/dom/browser-element/BrowserElementParent.jsm @@ -258,7 +258,8 @@ BrowserElementParent.prototype = { "visibilitychange": this._childVisibilityChange, "got-set-input-method-active": this._gotDOMRequestResult, "selectionchange": this._handleSelectionChange, - "scrollviewchange": this._handleScrollViewChange + "scrollviewchange": this._handleScrollViewChange, + "touchcarettap": this._handleTouchCaretTap }; let mmSecuritySensitiveCalls = { @@ -505,6 +506,12 @@ BrowserElementParent.prototype = { this._frameElement.dispatchEvent(evt); }, + _handleTouchCaretTap: function(data) { + let evt = this._createEvent("touchcarettap", data.json, + /* cancelable = */ false); + this._frameElement.dispatchEvent(evt); + }, + _createEvent: function(evtName, detail, cancelable) { // This will have to change if we ever want to send a CustomEvent with null // detail. For now, it's OK. diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index 98822a8895c9..acc79de2a8d6 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -30,6 +30,7 @@ #include "nsView.h" #include "nsDOMTokenList.h" #include "nsCaret.h" +#include "mozilla/dom/CustomEvent.h" using namespace mozilla; @@ -58,7 +59,8 @@ TouchCaret::TouchCaret(nsIPresShell* aPresShell) : mState(TOUCHCARET_NONE), mActiveTouchId(-1), mCaretCenterToDownPointOffsetY(0), - mVisible(false) + mVisible(false), + mIsValidTap(false) { TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell); MOZ_ASSERT(NS_IsMainThread()); @@ -601,6 +603,7 @@ TouchCaret::HandleMouseMoveEvent(WidgetMouseEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); + mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -638,6 +641,7 @@ TouchCaret::HandleTouchMoveEvent(WidgetTouchEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); + mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -848,6 +852,35 @@ TouchCaret::HandleTouchDownEvent(WidgetTouchEvent* aEvent) return status; } +void +TouchCaret::DispatchTapEvent() +{ + nsCOMPtr presShell = do_QueryReferent(mPresShell); + if (!presShell) { + return; + } + + nsCOMPtr doc = presShell->GetDocument(); + if (!doc) { + return; + } + + ErrorResult res; + nsRefPtr domEvent = + doc->CreateEvent(NS_LITERAL_STRING("CustomEvent"), res); + if (res.Failed()) { + return; + } + + CustomEvent* customEvent = static_cast(domEvent.get()); + customEvent->InitCustomEvent(NS_LITERAL_STRING("touchcarettap"), + true, false, nullptr); + customEvent->SetTrusted(true); + customEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true; + bool ret; + doc->DispatchEvent(domEvent, &ret); +} + void TouchCaret::SetState(TouchCaretState aState) { @@ -879,5 +912,12 @@ TouchCaret::SetState(TouchCaretState aState) if (mState == TOUCHCARET_NONE) { mActiveTouchId = -1; mCaretCenterToDownPointOffsetY = 0; + if (mIsValidTap) { + DispatchTapEvent(); + mIsValidTap = false; + } + } else if (mState == TOUCHCARET_TOUCHDRAG_ACTIVE || + mState == TOUCHCARET_MOUSEDRAG_ACTIVE) { + mIsValidTap = true; } } diff --git a/layout/base/TouchCaret.h b/layout/base/TouchCaret.h index ab3d4ef94e39..32bf995d6f8e 100644 --- a/layout/base/TouchCaret.h +++ b/layout/base/TouchCaret.h @@ -209,6 +209,11 @@ private: */ void SetState(TouchCaretState aState); + /** + * Dispatch touch caret tap event to chrome. + */ + void DispatchTapEvent(); + /** * Current state we're dealing with. */ @@ -249,6 +254,8 @@ private: // Touch caret visibility bool mVisible; + // Use for detecting single tap on touch caret. + bool mIsValidTap; // Touch caret timer nsCOMPtr mTouchCaretExpirationTimer; From 1efd6c1743f8f08088a9cb409bb88d62b3cee82a Mon Sep 17 00:00:00 2001 From: Randall Barker Date: Wed, 8 Oct 2014 15:50:29 -0700 Subject: [PATCH 62/79] Bug 1080012 - Fennec no longer able to mirror tabs on chromecast r=mfinkle on a CLOSED TREE --- mobile/android/base/ChromeCast.java | 2 +- mobile/android/modules/TabMirror.jsm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/android/base/ChromeCast.java b/mobile/android/base/ChromeCast.java index 61dabc5d7bd3..7a007a2710a9 100644 --- a/mobile/android/base/ChromeCast.java +++ b/mobile/android/base/ChromeCast.java @@ -37,7 +37,7 @@ import android.util.Log; class ChromeCast implements GeckoMediaPlayer { private static final boolean SHOW_DEBUG = false; - static final String MIRROR_RECIEVER_APP_ID = "D40D28D6"; + static final String MIRROR_RECIEVER_APP_ID = "5F72F863"; private final Context context; private final RouteInfo route; diff --git a/mobile/android/modules/TabMirror.jsm b/mobile/android/modules/TabMirror.jsm index d77ca42bd035..54784c73f18a 100644 --- a/mobile/android/modules/TabMirror.jsm +++ b/mobile/android/modules/TabMirror.jsm @@ -162,7 +162,7 @@ let TabMirror = function(deviceId, window) { iceServers: [{ "url": "stun:stun.services.mozilla.com" }] }; - let pc = new RTCPeerConnection(config, {}); + pc = new RTCPeerConnection(config, {}); if (!pc) { log("Failure creating Webrtc object"); From 0d84d7d1e0d3a3a279702a4398fe0b6bf058328b Mon Sep 17 00:00:00 2001 From: "Adam Roach [:abr]" Date: Wed, 8 Oct 2014 18:30:45 -0500 Subject: [PATCH 63/79] Bug 1080094 - Google import fails if a contact contains an org but no title r=dmose --- browser/components/loop/GoogleImporter.jsm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/browser/components/loop/GoogleImporter.jsm b/browser/components/loop/GoogleImporter.jsm index 5295fccb2fc6..489f670b4dd0 100644 --- a/browser/components/loop/GoogleImporter.jsm +++ b/browser/components/loop/GoogleImporter.jsm @@ -461,8 +461,10 @@ this.GoogleImporter.prototype = { contact.org = []; contact.jobTitle = []; for (let [,orgNode] of Iterator(orgNodes)) { - contact.org.push(orgNode.getElementsByTagNameNS(kNS_GD, "orgName")[0].firstChild.nodeValue); - contact.jobTitle.push(orgNode.getElementsByTagNameNS(kNS_GD, "orgTitle")[0].firstChild.nodeValue); + let orgElement = orgNode.getElementsByTagNameNS(kNS_GD, "orgName")[0]; + let titleElement = orgNode.getElementsByTagNameNS(kNS_GD, "orgTitle")[0]; + contact.org.push(orgElement ? orgElement.firstChild.nodeValue : "") + contact.jobTitle.push(titleElement ? titleElement.firstChild.nodeValue : ""); } } From 3f727a66955354080817f276efc363b73f5794f9 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Wed, 8 Oct 2014 15:18:59 -0700 Subject: [PATCH 64/79] Bug 1079629 - Fix build error when new tablet UI is disabled. r=rnewman --- .../resources/drawable/new_tablet_action_bar_button.xml | 7 +++++++ .../resources/drawable/new_tablet_url_bar_nav_button.xml | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 mobile/android/base/resources/drawable/new_tablet_action_bar_button.xml create mode 100644 mobile/android/base/resources/drawable/new_tablet_url_bar_nav_button.xml diff --git a/mobile/android/base/resources/drawable/new_tablet_action_bar_button.xml b/mobile/android/base/resources/drawable/new_tablet_action_bar_button.xml new file mode 100644 index 000000000000..d3e7c7917252 --- /dev/null +++ b/mobile/android/base/resources/drawable/new_tablet_action_bar_button.xml @@ -0,0 +1,7 @@ + + + + diff --git a/mobile/android/base/resources/drawable/new_tablet_url_bar_nav_button.xml b/mobile/android/base/resources/drawable/new_tablet_url_bar_nav_button.xml new file mode 100644 index 000000000000..d3e7c7917252 --- /dev/null +++ b/mobile/android/base/resources/drawable/new_tablet_url_bar_nav_button.xml @@ -0,0 +1,7 @@ + + + + From 5a7d5e605f62678d564bef753901bf68e6ea8a97 Mon Sep 17 00:00:00 2001 From: Nicolas Perriault Date: Wed, 8 Oct 2014 16:59:56 -0700 Subject: [PATCH 65/79] Bug 1074672 Part 1 - Implement a room list view for Loop, r=mikedeboer. --- browser/app/profile/firefox.js | 1 + browser/components/loop/content/js/panel.js | 170 ++++++++++++++++- browser/components/loop/content/js/panel.jsx | 170 ++++++++++++++++- browser/components/loop/content/panel.html | 4 + .../loop/content/shared/css/panel.css | 64 +++++++ .../loop/content/shared/js/actions.js | 7 + .../content/shared/js/conversationStore.js | 14 +- .../loop/content/shared/js/roomListStore.js | 171 ++++++++++++++++++ browser/components/loop/jar.mn | 1 + .../loop/test/desktop-local/index.html | 1 + .../loop/test/desktop-local/panel_test.js | 138 ++++++++++++-- .../test/functional/test_1_browser_call.py | 12 +- .../components/loop/test/shared/index.html | 2 + .../loop/test/shared/roomListStore_test.js | 130 +++++++++++++ browser/components/loop/ui/fake-mozLoop.js | 7 +- browser/components/loop/ui/index.html | 3 + browser/components/loop/ui/ui-showcase.css | 7 + browser/components/loop/ui/ui-showcase.js | 58 ++++-- browser/components/loop/ui/ui-showcase.jsx | 58 ++++-- .../en-US/chrome/browser/loop/loop.properties | 5 + 20 files changed, 958 insertions(+), 65 deletions(-) create mode 100644 browser/components/loop/content/shared/js/roomListStore.js create mode 100644 browser/components/loop/test/shared/roomListStore_test.js diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index b70b84891cdb..cd1488b4d960 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1623,6 +1623,7 @@ pref("loop.CSP", "default-src 'self' about: file: chrome:; img-src 'self' data: #endif pref("loop.oauth.google.redirect_uri", "urn:ietf:wg:oauth:2.0:oob:auto"); pref("loop.oauth.google.scope", "https://www.google.com/m8/feeds"); +pref("loop.rooms.enabled", false); // serverURL to be assigned by services team pref("services.push.serverURL", "wss://push.services.mozilla.com/"); diff --git a/browser/components/loop/content/js/panel.js b/browser/components/loop/content/js/panel.js index 122ce62b578e..23ab5b4b5bf3 100644 --- a/browser/components/loop/content/js/panel.js +++ b/browser/components/loop/content/js/panel.js @@ -14,6 +14,7 @@ loop.panel = (function(_, mozL10n) { var sharedViews = loop.shared.views; var sharedModels = loop.shared.models; var sharedMixins = loop.shared.mixins; + var sharedActions = loop.shared.actions; var Button = sharedViews.Button; var ButtonGroup = sharedViews.ButtonGroup; var ContactsList = loop.contacts.ContactsList; @@ -21,12 +22,23 @@ loop.panel = (function(_, mozL10n) { var __ = mozL10n.get; // aliasing translation function as __ for concision var TabView = React.createClass({displayName: 'TabView', - getInitialState: function() { + propTypes: { + buttonsHidden: React.PropTypes.bool, + // The selectedTab prop is used by the UI showcase. + selectedTab: React.PropTypes.string + }, + + getDefaultProps: function() { return { + buttonsHidden: false, selectedTab: "call" }; }, + getInitialState: function() { + return {selectedTab: this.props.selectedTab}; + }, + handleSelectTab: function(event) { var tabName = event.target.dataset.tabName; this.setState({selectedTab: tabName}); @@ -37,6 +49,10 @@ loop.panel = (function(_, mozL10n) { var tabButtons = []; var tabs = []; React.Children.forEach(this.props.children, function(tab, i) { + // Filter out null tabs (eg. rooms when the feature is disabled) + if (!tab) { + return; + } var tabName = tab.props.name; var isSelected = (this.state.selectedTab == tabName); if (!tab.props.hidden) { @@ -442,6 +458,121 @@ loop.panel = (function(_, mozL10n) { } }); + /** + * Room list entry. + */ + var RoomEntry = React.createClass({displayName: 'RoomEntry', + propTypes: { + openRoom: React.PropTypes.func.isRequired, + room: React.PropTypes.instanceOf(loop.store.Room).isRequired + }, + + shouldComponentUpdate: function(nextProps, nextState) { + return nextProps.room.ctime > this.props.room.ctime; + }, + + handleClickRoom: function(event) { + event.preventDefault(); + this.props.openRoom(this.props.room); + }, + + _isActive: function() { + // XXX bug 1074679 will implement this properly + return this.props.room.currSize > 0; + }, + + render: function() { + var room = this.props.room; + var roomClasses = React.addons.classSet({ + "room-entry": true, + "room-active": this._isActive() + }); + + return ( + React.DOM.div({className: roomClasses}, + React.DOM.h2(null, + React.DOM.span({className: "room-notification"}), + room.roomName + ), + React.DOM.p(null, + React.DOM.a({ref: "room", href: "#", onClick: this.handleClickRoom}, + room.roomUrl + ) + ) + ) + ); + } + }); + + /** + * Room list. + */ + var RoomList = React.createClass({displayName: 'RoomList', + mixins: [Backbone.Events], + + propTypes: { + store: React.PropTypes.instanceOf(loop.store.RoomListStore).isRequired, + dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, + rooms: React.PropTypes.array + }, + + getInitialState: function() { + var storeState = this.props.store.getStoreState(); + return { + error: this.props.error || storeState.error, + rooms: this.props.rooms || storeState.rooms, + }; + }, + + componentWillMount: function() { + this.listenTo(this.props.store, "change", this._onRoomListChanged); + + this.props.dispatcher.dispatch(new sharedActions.GetAllRooms()); + }, + + componentWillUnmount: function() { + this.stopListening(this.props.store); + }, + + _onRoomListChanged: function() { + var storeState = this.props.store.getStoreState(); + this.setState({ + error: storeState.error, + rooms: storeState.rooms + }); + }, + + _getListHeading: function() { + var numRooms = this.state.rooms.length; + if (numRooms === 0) { + return mozL10n.get("rooms_list_no_current_conversations"); + } + return mozL10n.get("rooms_list_current_conversations", {num: numRooms}); + }, + + openRoom: function(room) { + // XXX implement me; see bug 1074678 + }, + + render: function() { + if (this.state.error) { + // XXX Better end user reporting of errors. + console.error(this.state.error); + } + + return ( + React.DOM.div({className: "room-list"}, + React.DOM.h1(null, this._getListHeading()), + + this.state.rooms.map(function(room, i) { + return RoomEntry({key: i, room: room, openRoom: this.openRoom}); + }, this) + + ) + ); + } + }); + /** * Panel view. */ @@ -453,6 +584,10 @@ loop.panel = (function(_, mozL10n) { callUrl: React.PropTypes.string, userProfile: React.PropTypes.object, showTabButtons: React.PropTypes.bool, + selectedTab: React.PropTypes.string, + dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, + roomListStore: + React.PropTypes.instanceOf(loop.store.RoomListStore).isRequired }, getInitialState: function() { @@ -498,6 +633,22 @@ loop.panel = (function(_, mozL10n) { this.updateServiceErrors(); }, + /** + * The rooms feature is hidden by default for now. Once it gets mainstream, + * this method can be safely removed. + */ + _renderRoomsTab: function() { + if (!navigator.mozLoop.getLoopBoolPref("rooms.enabled")) { + return null; + } + return ( + Tab({name: "rooms"}, + RoomList({dispatcher: this.props.dispatcher, + store: this.props.roomListStore}) + ) + ); + }, + startForm: function(name, contact) { this.refs[name].initForm(contact); this.selectTab(name); @@ -527,7 +678,8 @@ loop.panel = (function(_, mozL10n) { React.DOM.div(null, NotificationListView({notifications: this.props.notifications, clearOnDocumentHidden: true}), - TabView({ref: "tabView", buttonsHidden: !this.state.userProfile && !this.props.showTabButtons}, + TabView({ref: "tabView", selectedTab: this.props.selectedTab, + buttonsHidden: !this.state.userProfile && !this.props.showTabButtons}, Tab({name: "call"}, React.DOM.div({className: "content-area"}, CallUrlResult({client: this.props.client, @@ -536,6 +688,7 @@ loop.panel = (function(_, mozL10n) { ToSView(null) ) ), + this._renderRoomsTab(), Tab({name: "contacts"}, ContactsList({selectTab: this.selectTab, startForm: this.startForm}) @@ -575,11 +728,19 @@ loop.panel = (function(_, mozL10n) { mozL10n.initialize(navigator.mozLoop); var client = new loop.Client(); - var notifications = new sharedModels.NotificationCollection() + var notifications = new sharedModels.NotificationCollection(); + var dispatcher = new loop.Dispatcher(); + var roomListStore = new loop.store.RoomListStore({ + mozLoop: navigator.mozLoop, + dispatcher: dispatcher + }); React.renderComponent(PanelView({ client: client, - notifications: notifications}), document.querySelector("#main")); + notifications: notifications, + roomListStore: roomListStore, + dispatcher: dispatcher} + ), document.querySelector("#main")); document.body.classList.add(loop.shared.utils.getTargetPlatform()); document.body.setAttribute("dir", mozL10n.getDirection()); @@ -597,6 +758,7 @@ loop.panel = (function(_, mozL10n) { AvailabilityDropdown: AvailabilityDropdown, CallUrlResult: CallUrlResult, PanelView: PanelView, + RoomList: RoomList, SettingsDropdown: SettingsDropdown, ToSView: ToSView }; diff --git a/browser/components/loop/content/js/panel.jsx b/browser/components/loop/content/js/panel.jsx index cd7c5a7b42f8..3fe901b6e450 100644 --- a/browser/components/loop/content/js/panel.jsx +++ b/browser/components/loop/content/js/panel.jsx @@ -14,6 +14,7 @@ loop.panel = (function(_, mozL10n) { var sharedViews = loop.shared.views; var sharedModels = loop.shared.models; var sharedMixins = loop.shared.mixins; + var sharedActions = loop.shared.actions; var Button = sharedViews.Button; var ButtonGroup = sharedViews.ButtonGroup; var ContactsList = loop.contacts.ContactsList; @@ -21,12 +22,23 @@ loop.panel = (function(_, mozL10n) { var __ = mozL10n.get; // aliasing translation function as __ for concision var TabView = React.createClass({ - getInitialState: function() { + propTypes: { + buttonsHidden: React.PropTypes.bool, + // The selectedTab prop is used by the UI showcase. + selectedTab: React.PropTypes.string + }, + + getDefaultProps: function() { return { + buttonsHidden: false, selectedTab: "call" }; }, + getInitialState: function() { + return {selectedTab: this.props.selectedTab}; + }, + handleSelectTab: function(event) { var tabName = event.target.dataset.tabName; this.setState({selectedTab: tabName}); @@ -37,6 +49,10 @@ loop.panel = (function(_, mozL10n) { var tabButtons = []; var tabs = []; React.Children.forEach(this.props.children, function(tab, i) { + // Filter out null tabs (eg. rooms when the feature is disabled) + if (!tab) { + return; + } var tabName = tab.props.name; var isSelected = (this.state.selectedTab == tabName); if (!tab.props.hidden) { @@ -442,6 +458,121 @@ loop.panel = (function(_, mozL10n) { } }); + /** + * Room list entry. + */ + var RoomEntry = React.createClass({ + propTypes: { + openRoom: React.PropTypes.func.isRequired, + room: React.PropTypes.instanceOf(loop.store.Room).isRequired + }, + + shouldComponentUpdate: function(nextProps, nextState) { + return nextProps.room.ctime > this.props.room.ctime; + }, + + handleClickRoom: function(event) { + event.preventDefault(); + this.props.openRoom(this.props.room); + }, + + _isActive: function() { + // XXX bug 1074679 will implement this properly + return this.props.room.currSize > 0; + }, + + render: function() { + var room = this.props.room; + var roomClasses = React.addons.classSet({ + "room-entry": true, + "room-active": this._isActive() + }); + + return ( +
+

+ + {room.roomName} +

+

+ + {room.roomUrl} + +

+
+ ); + } + }); + + /** + * Room list. + */ + var RoomList = React.createClass({ + mixins: [Backbone.Events], + + propTypes: { + store: React.PropTypes.instanceOf(loop.store.RoomListStore).isRequired, + dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, + rooms: React.PropTypes.array + }, + + getInitialState: function() { + var storeState = this.props.store.getStoreState(); + return { + error: this.props.error || storeState.error, + rooms: this.props.rooms || storeState.rooms, + }; + }, + + componentWillMount: function() { + this.listenTo(this.props.store, "change", this._onRoomListChanged); + + this.props.dispatcher.dispatch(new sharedActions.GetAllRooms()); + }, + + componentWillUnmount: function() { + this.stopListening(this.props.store); + }, + + _onRoomListChanged: function() { + var storeState = this.props.store.getStoreState(); + this.setState({ + error: storeState.error, + rooms: storeState.rooms + }); + }, + + _getListHeading: function() { + var numRooms = this.state.rooms.length; + if (numRooms === 0) { + return mozL10n.get("rooms_list_no_current_conversations"); + } + return mozL10n.get("rooms_list_current_conversations", {num: numRooms}); + }, + + openRoom: function(room) { + // XXX implement me; see bug 1074678 + }, + + render: function() { + if (this.state.error) { + // XXX Better end user reporting of errors. + console.error(this.state.error); + } + + return ( +
+

{this._getListHeading()}

+ { + this.state.rooms.map(function(room, i) { + return ; + }, this) + } +
+ ); + } + }); + /** * Panel view. */ @@ -453,6 +584,10 @@ loop.panel = (function(_, mozL10n) { callUrl: React.PropTypes.string, userProfile: React.PropTypes.object, showTabButtons: React.PropTypes.bool, + selectedTab: React.PropTypes.string, + dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, + roomListStore: + React.PropTypes.instanceOf(loop.store.RoomListStore).isRequired }, getInitialState: function() { @@ -498,6 +633,22 @@ loop.panel = (function(_, mozL10n) { this.updateServiceErrors(); }, + /** + * The rooms feature is hidden by default for now. Once it gets mainstream, + * this method can be safely removed. + */ + _renderRoomsTab: function() { + if (!navigator.mozLoop.getLoopBoolPref("rooms.enabled")) { + return null; + } + return ( + + + + ); + }, + startForm: function(name, contact) { this.refs[name].initForm(contact); this.selectTab(name); @@ -527,7 +678,8 @@ loop.panel = (function(_, mozL10n) {
- +
+ {this._renderRoomsTab()} @@ -575,11 +728,19 @@ loop.panel = (function(_, mozL10n) { mozL10n.initialize(navigator.mozLoop); var client = new loop.Client(); - var notifications = new sharedModels.NotificationCollection() + var notifications = new sharedModels.NotificationCollection(); + var dispatcher = new loop.Dispatcher(); + var roomListStore = new loop.store.RoomListStore({ + mozLoop: navigator.mozLoop, + dispatcher: dispatcher + }); React.renderComponent(, document.querySelector("#main")); + notifications={notifications} + roomListStore={roomListStore} + dispatcher={dispatcher} + />, document.querySelector("#main")); document.body.classList.add(loop.shared.utils.getTargetPlatform()); document.body.setAttribute("dir", mozL10n.getDirection()); @@ -597,6 +758,7 @@ loop.panel = (function(_, mozL10n) { AvailabilityDropdown: AvailabilityDropdown, CallUrlResult: CallUrlResult, PanelView: PanelView, + RoomList: RoomList, SettingsDropdown: SettingsDropdown, ToSView: ToSView }; diff --git a/browser/components/loop/content/panel.html b/browser/components/loop/content/panel.html index b169ace11226..2e19a2c9a834 100644 --- a/browser/components/loop/content/panel.html +++ b/browser/components/loop/content/panel.html @@ -25,6 +25,10 @@ + + + + diff --git a/browser/components/loop/content/shared/css/panel.css b/browser/components/loop/content/shared/css/panel.css index 2e4a90bbd3aa..0ee995a7f491 100644 --- a/browser/components/loop/content/shared/css/panel.css +++ b/browser/components/loop/content/shared/css/panel.css @@ -123,6 +123,70 @@ body { box-shadow: 0 0 4px #c43c3e; } +/* Rooms */ +.room-list { + background: #f5f5f5; +} + +.room-list > h1 { + font-weight: bold; + color: #999; + padding: .5rem 1rem; + border-bottom: 1px solid #ddd; +} + +.room-list > .room-entry { + padding: 1rem 1rem 0 .5rem; +} + +.room-list > .room-entry > h2 { + font-size: .85rem; + color: #777; +} + +.room-list > .room-entry.room-active > h2 { + font-weight: bold; + color: #000; +} + +.room-list > .room-entry > h2 > .room-notification { + display: inline-block; + background: transparent; + width: 8px; + height: 8px; + border-radius: 50%; + margin-right: .3rem; +} + +.room-list > .room-entry.room-active > h2 > .room-notification { + background-color: #00a0ec; +} + +.room-list > .room-entry:hover { + background: #f1f1f1; +} + +.room-list > .room-entry:not(:last-child) { + border-bottom: 1px solid #ddd; +} + +.room-list > .room-entry > p { + margin: 0; + padding: .2em 0 1rem .8rem; +} + +.room-list > .room-entry > p > a { + color: #777; + opacity: .5; + transition: opacity .1s ease-in-out 0s; + text-decoration: none; +} + +.room-list > .room-entry > p > a:hover { + opacity: 1; + text-decoration: underline; +} + /* Buttons */ .button-group { diff --git a/browser/components/loop/content/shared/js/actions.js b/browser/components/loop/content/shared/js/actions.js index ca2525a653ce..b77f65d6e6ec 100644 --- a/browser/components/loop/content/shared/js/actions.js +++ b/browser/components/loop/content/shared/js/actions.js @@ -118,6 +118,13 @@ loop.shared.actions = (function() { type: String, // Whether or not to enable the stream. enabled: Boolean + }), + + /** + * Retrieves room list. + * XXX: should move to some roomActions module - refs bug 1079284 + */ + GetAllRooms: Action.define("getAllRooms", { }) }; })(); diff --git a/browser/components/loop/content/shared/js/conversationStore.js b/browser/components/loop/content/shared/js/conversationStore.js index 9b4049fa73a3..2551e74af26e 100644 --- a/browser/components/loop/content/shared/js/conversationStore.js +++ b/browser/components/loop/content/shared/js/conversationStore.js @@ -5,8 +5,9 @@ /* global loop:true */ var loop = loop || {}; -loop.store = (function() { +loop.store = loop.store || {}; +loop.store.ConversationStore = (function() { var sharedActions = loop.shared.actions; var CALL_TYPES = loop.shared.utils.CALL_TYPES; @@ -14,7 +15,7 @@ loop.store = (function() { * Websocket states taken from: * https://docs.services.mozilla.com/loop/apis.html#call-progress-state-change-progress */ - var WS_STATES = { + var WS_STATES = loop.store.WS_STATES = { // The call is starting, and the remote party is not yet being alerted. INIT: "init", // The called party is being alerted. @@ -31,7 +32,7 @@ loop.store = (function() { CONNECTED: "connected" }; - var CALL_STATES = { + var CALL_STATES = loop.store.CALL_STATES = { // The initial state of the view. INIT: "cs-init", // The store is gathering the call data from the server. @@ -52,7 +53,6 @@ loop.store = (function() { TERMINATED: "cs-terminated" }; - var ConversationStore = Backbone.Model.extend({ defaults: { // The current state of the call @@ -402,9 +402,5 @@ loop.store = (function() { } }); - return { - CALL_STATES: CALL_STATES, - ConversationStore: ConversationStore, - WS_STATES: WS_STATES - }; + return ConversationStore; })(); diff --git a/browser/components/loop/content/shared/js/roomListStore.js b/browser/components/loop/content/shared/js/roomListStore.js new file mode 100644 index 000000000000..2871f630d3cf --- /dev/null +++ b/browser/components/loop/content/shared/js/roomListStore.js @@ -0,0 +1,171 @@ +/* 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/. */ + +/* global loop:true */ + +var loop = loop || {}; +loop.store = loop.store || {}; + +(function() { + "use strict"; + + /** + * Room validation schema. See validate.js. + * @type {Object} + */ + var roomSchema = { + roomToken: String, + roomUrl: String, + roomName: String, + maxSize: Number, + currSize: Number, + ctime: Number + }; + + /** + * Temporary sample raw room list data. + * XXX Should be removed when we plug the real mozLoop API for rooms. + * See bug 1074664. + * @type {Array} + */ + var temporaryRawRoomList = [{ + roomToken: "_nxD4V4FflQ", + roomUrl: "http://sample/_nxD4V4FflQ", + roomName: "First Room Name", + maxSize: 2, + currSize: 0, + ctime: 1405517546 + }, { + roomToken: "QzBbvGmIZWU", + roomUrl: "http://sample/QzBbvGmIZWU", + roomName: "Second Room Name", + maxSize: 2, + currSize: 0, + ctime: 1405517418 + }, { + roomToken: "3jKS_Els9IU", + roomUrl: "http://sample/3jKS_Els9IU", + roomName: "Third Room Name", + maxSize: 3, + clientMaxSize: 2, + currSize: 1, + ctime: 1405518241 + }]; + + /** + * Room type. Basically acts as a typed object constructor. + * + * @param {Object} values Room property values. + */ + function Room(values) { + var validatedData = new loop.validate.Validator(roomSchema || {}) + .validate(values || {}); + for (var prop in validatedData) { + this[prop] = validatedData[prop]; + } + } + + loop.store.Room = Room; + + /** + * Room store. + * + * Options: + * - {loop.Dispatcher} dispatcher The dispatcher for dispatching actions and + * registering to consume actions. + * - {mozLoop} mozLoop The MozLoop API object. + * + * @extends {Backbone.Events} + * @param {Object} options Options object. + */ + function RoomListStore(options) { + options = options || {}; + this.storeState = {error: null, rooms: []}; + + if (!options.dispatcher) { + throw new Error("Missing option dispatcher"); + } + this.dispatcher = options.dispatcher; + + if (!options.mozLoop) { + throw new Error("Missing option mozLoop"); + } + this.mozLoop = options.mozLoop; + + this.dispatcher.register(this, [ + "getAllRooms", + "openRoom" + ]); + } + + RoomListStore.prototype = _.extend({ + /** + * Retrieves current store state. + * + * @return {Object} + */ + getStoreState: function() { + return this.storeState; + }, + + /** + * Updates store states and trigger a "change" event. + * + * @param {Object} state The new store state. + */ + setStoreState: function(state) { + this.storeState = state; + this.trigger("change"); + }, + + /** + * Proxy to navigator.mozLoop.rooms.getAll. + * XXX Could probably be removed when bug 1074664 lands. + * + * @param {Function} cb Callback(error, roomList) + */ + _fetchRoomList: function(cb) { + // Faking this.mozLoop.rooms until it's available; bug 1074664. + if (!this.mozLoop.hasOwnProperty("rooms")) { + cb(null, temporaryRawRoomList); + return; + } + this.mozLoop.rooms.getAll(cb); + }, + + /** + * Maps and sorts the raw room list received from the mozLoop API. + * + * @param {Array} rawRoomList Raw room list. + * @return {Array} + */ + _processRawRoomList: function(rawRoomList) { + if (!rawRoomList) { + return []; + } + return rawRoomList + .map(function(rawRoom) { + return new Room(rawRoom); + }) + .slice() + .sort(function(a, b) { + return b.ctime - a.ctime; + }); + }, + + /** + * Gather the list of all available rooms from the MozLoop API. + */ + getAllRooms: function() { + this._fetchRoomList(function(err, rawRoomList) { + this.setStoreState({ + error: err, + rooms: this._processRawRoomList(rawRoomList) + }); + }.bind(this)); + } + }, Backbone.Events); + + loop.store.RoomListStore = RoomListStore; +})(); diff --git a/browser/components/loop/jar.mn b/browser/components/loop/jar.mn index 53838e4b9039..635d85708949 100644 --- a/browser/components/loop/jar.mn +++ b/browser/components/loop/jar.mn @@ -55,6 +55,7 @@ browser.jar: # Shared scripts content/browser/loop/shared/js/actions.js (content/shared/js/actions.js) content/browser/loop/shared/js/conversationStore.js (content/shared/js/conversationStore.js) + content/browser/loop/shared/js/roomListStore.js (content/shared/js/roomListStore.js) content/browser/loop/shared/js/dispatcher.js (content/shared/js/dispatcher.js) content/browser/loop/shared/js/feedbackApiClient.js (content/shared/js/feedbackApiClient.js) content/browser/loop/shared/js/models.js (content/shared/js/models.js) diff --git a/browser/components/loop/test/desktop-local/index.html b/browser/components/loop/test/desktop-local/index.html index c7618e26bf72..ef710643e3fb 100644 --- a/browser/components/loop/test/desktop-local/index.html +++ b/browser/components/loop/test/desktop-local/index.html @@ -43,6 +43,7 @@ + diff --git a/browser/components/loop/test/desktop-local/panel_test.js b/browser/components/loop/test/desktop-local/panel_test.js index dc5355f356a6..d37dc1f28211 100644 --- a/browser/components/loop/test/desktop-local/panel_test.js +++ b/browser/components/loop/test/desktop-local/panel_test.js @@ -7,13 +7,14 @@ var expect = chai.expect; var TestUtils = React.addons.TestUtils; +var sharedActions = loop.shared.actions; describe("loop.panel", function() { "use strict"; var sandbox, notifications, fakeXHR, requests = []; - beforeEach(function() { + beforeEach(function(done) { sandbox = sinon.sandbox.create(); fakeXHR = sandbox.useFakeXMLHttpRequest(); requests = []; @@ -32,8 +33,12 @@ describe("loop.panel", function() { get locale() { return "en-US"; }, + getLoopBoolPref: sandbox.stub(), setLoopCharPref: sandbox.stub(), getLoopCharPref: sandbox.stub().returns("unseen"), + getPluralForm: function() { + return "fakeText"; + }, copyString: sandbox.stub(), noteCallUrlExpiry: sinon.spy(), composeEmail: sinon.spy(), @@ -47,6 +52,8 @@ describe("loop.panel", function() { }; document.mozL10n.initialize(navigator.mozLoop); + // XXX prevent a race whenever mozL10n hasn't been initialized yet + setTimeout(done, 0); }); afterEach(function() { @@ -126,7 +133,7 @@ describe("loop.panel", function() { }); describe("loop.panel.PanelView", function() { - var fakeClient, callUrlData, view, callTab, contactsTab; + var fakeClient, dispatcher, roomListStore, callUrlData; beforeEach(function() { callUrlData = { @@ -140,31 +147,94 @@ describe("loop.panel", function() { } }; - view = TestUtils.renderIntoDocument(loop.panel.PanelView({ + dispatcher = new loop.Dispatcher(); + roomListStore = new loop.store.RoomListStore({ + dispatcher: dispatcher, + mozLoop: navigator.mozLoop + }); + }); + + function createTestPanelView() { + return TestUtils.renderIntoDocument(loop.panel.PanelView({ notifications: notifications, client: fakeClient, showTabButtons: true, + dispatcher: dispatcher, + roomListStore: roomListStore })); - - [callTab, contactsTab] = - TestUtils.scryRenderedDOMComponentsWithClass(view, "tab"); - }); + } describe('TabView', function() { - it("should select contacts tab when clicking tab button", function() { - TestUtils.Simulate.click( - view.getDOMNode().querySelector('li[data-tab-name="contacts"]')); + var view, callTab, roomsTab, contactsTab; - expect(contactsTab.getDOMNode().classList.contains("selected")) - .to.be.true; + describe("loop.rooms.enabled on", function() { + beforeEach(function() { + navigator.mozLoop.getLoopBoolPref = function(pref) { + if (pref === "rooms.enabled") { + return true; + } + }; + + view = createTestPanelView(); + + [callTab, roomsTab, contactsTab] = + TestUtils.scryRenderedDOMComponentsWithClass(view, "tab"); + }); + + it("should select contacts tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector("li[data-tab-name=\"contacts\"]")); + + expect(contactsTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); + + it("should select rooms tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector("li[data-tab-name=\"rooms\"]")); + + expect(roomsTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); + + it("should select call tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector("li[data-tab-name=\"call\"]")); + + expect(callTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); }); - it("should select call tab when clicking tab button", function() { - TestUtils.Simulate.click( - view.getDOMNode().querySelector('li[data-tab-name="call"]')); + describe("loop.rooms.enabled off", function() { + beforeEach(function() { + navigator.mozLoop.getLoopBoolPref = function(pref) { + if (pref === "rooms.enabled") { + return false; + } + }; - expect(callTab.getDOMNode().classList.contains("selected")) - .to.be.true; + view = createTestPanelView(); + + [callTab, contactsTab] = + TestUtils.scryRenderedDOMComponentsWithClass(view, "tab"); + }); + + it("should select contacts tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector("li[data-tab-name=\"contacts\"]")); + + expect(contactsTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); + + it("should select call tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector("li[data-tab-name=\"call\"]")); + + expect(callTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); }); }); @@ -174,6 +244,8 @@ describe("loop.panel", function() { navigator.mozLoop.loggedInToFxA = false; navigator.mozLoop.logInToFxA = sandbox.stub(); + var view = createTestPanelView(); + TestUtils.Simulate.click( view.getDOMNode().querySelector(".signin-link a")); @@ -193,8 +265,6 @@ describe("loop.panel", function() { }); describe("SettingsDropdown", function() { - var view; - beforeEach(function() { navigator.mozLoop.logInToFxA = sandbox.stub(); navigator.mozLoop.logOutFromFxA = sandbox.stub(); @@ -288,6 +358,8 @@ describe("loop.panel", function() { describe("#render", function() { it("should render a ToSView", function() { + var view = createTestPanelView(); + TestUtils.findRenderedComponentWithType(view, loop.panel.ToSView); }); }); @@ -550,6 +622,34 @@ describe("loop.panel", function() { }); }); + describe("loop.panel.RoomList", function() { + var roomListStore, dispatcher; + + beforeEach(function() { + dispatcher = new loop.Dispatcher(); + roomListStore = new loop.store.RoomListStore({ + dispatcher: dispatcher, + mozLoop: navigator.mozLoop + }); + }); + + function createTestComponent() { + return TestUtils.renderIntoDocument(loop.panel.RoomList({ + store: roomListStore, + dispatcher: dispatcher + })); + } + + it("should dispatch a GetAllRooms action on mount", function() { + var dispatch = sandbox.stub(dispatcher, "dispatch"); + + createTestComponent(); + + sinon.assert.calledOnce(dispatch); + sinon.assert.calledWithExactly(dispatch, new sharedActions.GetAllRooms()); + }); + }); + describe('loop.panel.ToSView', function() { it("should render when the value of loop.seenToS is not set", function() { diff --git a/browser/components/loop/test/functional/test_1_browser_call.py b/browser/components/loop/test/functional/test_1_browser_call.py index 952e4da3a789..06f610caf8a4 100644 --- a/browser/components/loop/test/functional/test_1_browser_call.py +++ b/browser/components/loop/test/functional/test_1_browser_call.py @@ -131,12 +131,12 @@ class Test1BrowserCall(MarionetteTestCase): self.marionette.set_context("chrome") button = self.marionette.find_element(By.CLASS_NAME, "btn-hangup") - # XXX For whatever reason, the click doesn't take effect unless we - # wait for a bit (even if we wait for the element to actually be - # displayed first, which we're not currently bothering with). It's - # not entirely clear whether the click is being delivered in this case, - # or whether there's a Marionette bug here. - sleep(2) + # XXX bug 1080095 For whatever reason, the click doesn't take effect + # unless we wait for a bit (even if we wait for the element to + # actually be displayed first, which we're not currently bothering + # with). It's not entirely clear whether the click is being + # delivered in this case, or whether there's a Marionette bug here. + sleep(5) button.click() # check that the feedback form is displayed diff --git a/browser/components/loop/test/shared/index.html b/browser/components/loop/test/shared/index.html index f11056db7445..28d29aa1371e 100644 --- a/browser/components/loop/test/shared/index.html +++ b/browser/components/loop/test/shared/index.html @@ -44,6 +44,7 @@ + @@ -56,6 +57,7 @@ + + + + diff --git a/browser/components/loop/ui/ui-showcase.css b/browser/components/loop/ui/ui-showcase.css index fc77da4da2ef..4f56411d5498 100644 --- a/browser/components/loop/ui/ui-showcase.css +++ b/browser/components/loop/ui/ui-showcase.css @@ -69,9 +69,16 @@ font-weight: bold; border-bottom: 1px dashed #aaa; margin: 1em 0; + margin-top: -14em; + padding-top: 14em; text-align: left; } +.showcase > section .example > h3 a { + text-decoration: none; + color: #555; +} + .showcase p.note { margin: 0; padding: 0; diff --git a/browser/components/loop/ui/ui-showcase.js b/browser/components/loop/ui/ui-showcase.js index 086877789721..68fc3ec258e3 100644 --- a/browser/components/loop/ui/ui-showcase.js +++ b/browser/components/loop/ui/ui-showcase.js @@ -56,6 +56,12 @@ } ); + var dispatcher = new loop.Dispatcher(); + var roomListStore = new loop.store.RoomListStore({ + dispatcher: dispatcher, + mozLoop: {} + }); + // Local mocks var mockContact = { @@ -93,11 +99,18 @@ }); var Example = React.createClass({displayName: 'Example', + makeId: function(prefix) { + return (prefix || "") + this.props.summary.toLowerCase().replace(/\s/g, "-"); + }, + render: function() { var cx = React.addons.classSet; return ( React.DOM.div({className: "example"}, - React.DOM.h3(null, this.props.summary), + React.DOM.h3({id: this.makeId()}, + this.props.summary, + React.DOM.a({href: this.makeId("#")}, " ¶") + ), React.DOM.div({className: cx({comp: true, dashed: this.props.dashed}), style: this.props.style || {}}, this.props.children @@ -150,26 +163,45 @@ ), Example({summary: "Call URL retrieved", dashed: "true", style: {width: "332px"}}, PanelView({client: mockClient, notifications: notifications, - callUrl: "http://invalid.example.url/"}) + callUrl: "http://invalid.example.url/", + dispatcher: dispatcher, + roomListStore: roomListStore}) ), Example({summary: "Call URL retrieved - authenticated", dashed: "true", style: {width: "332px"}}, PanelView({client: mockClient, notifications: notifications, callUrl: "http://invalid.example.url/", - userProfile: {email: "test@example.com"}}) + userProfile: {email: "test@example.com"}, + dispatcher: dispatcher, + roomListStore: roomListStore}) ), Example({summary: "Pending call url retrieval", dashed: "true", style: {width: "332px"}}, - PanelView({client: mockClient, notifications: notifications}) + PanelView({client: mockClient, notifications: notifications, + dispatcher: dispatcher, + roomListStore: roomListStore}) ), Example({summary: "Pending call url retrieval - authenticated", dashed: "true", style: {width: "332px"}}, PanelView({client: mockClient, notifications: notifications, - userProfile: {email: "test@example.com"}}) + userProfile: {email: "test@example.com"}, + dispatcher: dispatcher, + roomListStore: roomListStore}) ), Example({summary: "Error Notification", dashed: "true", style: {width: "332px"}}, - PanelView({client: mockClient, notifications: errNotifications}) + PanelView({client: mockClient, notifications: errNotifications, + dispatcher: dispatcher, + roomListStore: roomListStore}) ), Example({summary: "Error Notification - authenticated", dashed: "true", style: {width: "332px"}}, PanelView({client: mockClient, notifications: errNotifications, - userProfile: {email: "test@example.com"}}) + userProfile: {email: "test@example.com"}, + dispatcher: dispatcher, + roomListStore: roomListStore}) + ), + Example({summary: "Room list tab", dashed: "true", style: {width: "332px"}}, + PanelView({client: mockClient, notifications: notifications, + userProfile: {email: "test@example.com"}, + dispatcher: dispatcher, + roomListStore: roomListStore, + selectedTab: "rooms"}) ) ), @@ -247,12 +279,15 @@ Section({name: "PendingConversationView"}, Example({summary: "Pending conversation view (connecting)", dashed: "true"}, React.DOM.div({className: "standalone"}, - PendingConversationView({websocket: mockWebSocket}) + PendingConversationView({websocket: mockWebSocket, + dispatcher: dispatcher}) ) ), Example({summary: "Pending conversation view (ringing)", dashed: "true"}, React.DOM.div({className: "standalone"}, - PendingConversationView({websocket: mockWebSocket, callState: "ringing"}) + PendingConversationView({websocket: mockWebSocket, + dispatcher: dispatcher, + callState: "ringing"}) ) ) ), @@ -262,7 +297,8 @@ style: {width: "260px", height: "265px"}}, React.DOM.div({className: "fx-embedded"}, DesktopPendingConversationView({callState: "gather", - contact: mockContact}) + contact: mockContact, + dispatcher: dispatcher}) ) ) ), @@ -271,7 +307,7 @@ Example({summary: "Call Failed", dashed: "true", style: {width: "260px", height: "265px"}}, React.DOM.div({className: "fx-embedded"}, - CallFailedView(null) + CallFailedView({dispatcher: dispatcher}) ) ) ), diff --git a/browser/components/loop/ui/ui-showcase.jsx b/browser/components/loop/ui/ui-showcase.jsx index 21216a8d1449..f642005c3a5d 100644 --- a/browser/components/loop/ui/ui-showcase.jsx +++ b/browser/components/loop/ui/ui-showcase.jsx @@ -56,6 +56,12 @@ } ); + var dispatcher = new loop.Dispatcher(); + var roomListStore = new loop.store.RoomListStore({ + dispatcher: dispatcher, + mozLoop: {} + }); + // Local mocks var mockContact = { @@ -93,11 +99,18 @@ }); var Example = React.createClass({ + makeId: function(prefix) { + return (prefix || "") + this.props.summary.toLowerCase().replace(/\s/g, "-"); + }, + render: function() { var cx = React.addons.classSet; return (
-

{this.props.summary}

+

+ {this.props.summary} +  Â¶ +

{this.props.children} @@ -150,26 +163,45 @@

+ callUrl="http://invalid.example.url/" + dispatcher={dispatcher} + roomListStore={roomListStore} /> + userProfile={{email: "test@example.com"}} + dispatcher={dispatcher} + roomListStore={roomListStore} /> - + + userProfile={{email: "test@example.com"}} + dispatcher={dispatcher} + roomListStore={roomListStore} /> - + + userProfile={{email: "test@example.com"}} + dispatcher={dispatcher} + roomListStore={roomListStore} /> + + + @@ -247,12 +279,15 @@
- +
- +
@@ -262,7 +297,8 @@ style={{width: "260px", height: "265px"}}>
+ contact={mockContact} + dispatcher={dispatcher} />
@@ -271,7 +307,7 @@
- +
diff --git a/browser/locales/en-US/chrome/browser/loop/loop.properties b/browser/locales/en-US/chrome/browser/loop/loop.properties index 468cd5376129..4dc621ff1892 100644 --- a/browser/locales/en-US/chrome/browser/loop/loop.properties +++ b/browser/locales/en-US/chrome/browser/loop/loop.properties @@ -272,3 +272,8 @@ feedback_rejoin_button=Rejoin ## LOCALIZATION NOTE (feedback_report_user_button): Used to report a user in the case of ## an abusive user. feedback_report_user_button=Report User + +## LOCALIZATION NOTE (rooms_list_current_conversations): We prefer to have no +## number in the string, but if you need it for your language please use {{num}}. +rooms_list_current_conversations=Current conversation;Current conversations +rooms_list_no_current_conversations=No current conversations From 5a95e287b1c609623e8fdda1f4f89d60a9f59b99 Mon Sep 17 00:00:00 2001 From: Chenxia Liu Date: Wed, 8 Oct 2014 17:10:03 -0700 Subject: [PATCH 66/79] Bug 1059792 - Launching Firefox for the first time through an external intent should not display First Run experience. r=margaret --- mobile/android/base/BrowserApp.java | 52 +++++++++++-------- mobile/android/base/GeckoProfile.java | 7 +-- .../android/base/tests/testGeckoProfile.java | 26 ++++++---- 3 files changed, 52 insertions(+), 33 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index f5b4ea320bd4..32a9da7ee292 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -85,7 +85,6 @@ import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -160,7 +159,8 @@ public class BrowserApp extends GeckoApp // Request ID for startActivityForResult. private static final int ACTIVITY_REQUEST_PREFERENCES = 1001; - public static final String ACTION_NEW_PROFILE = "org.mozilla.gecko.NEW_PROFILE"; + + public static final String PREF_STARTPANE_ENABLED = "startpane_enabled"; private BrowserSearch mBrowserSearch; private View mBrowserSearchContainer; @@ -621,8 +621,6 @@ public class BrowserApp extends GeckoApp "Updater:Launch", "BrowserToolbar:Visibility"); - registerOnboardingReceiver(this); - Distribution distribution = Distribution.init(this); // Init suggested sites engine in BrowserDB. @@ -688,24 +686,31 @@ public class BrowserApp extends GeckoApp tintManager.setStatusBarTintEnabled(true); } - private void registerOnboardingReceiver(Context context) { - final LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this); + /** + * Check and show Onboarding start pane if Firefox has never been launched and + * is not opening an external link from another application. + * + * @param context Context of application; used to show Start Pane if appropriate + * @param intentAction Intent that launched this activity + */ + private void checkStartPane(Context context, String intentAction) { + final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads(); - // Receiver for launching first run start pane on new profile creation. - mOnboardingReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - launchStartPane(BrowserApp.this); + try { + final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this); + + if (prefs.getBoolean(PREF_STARTPANE_ENABLED, false)) { + if (!Intent.ACTION_VIEW.equals(intentAction)) { + final Intent startIntent = new Intent(this, StartPane.class); + context.startActivity(startIntent); + } + // Don't bother trying again to show the v1 minimal first run. + prefs.edit().putBoolean(PREF_STARTPANE_ENABLED, false).apply(); } - }; - - lbm.registerReceiver(mOnboardingReceiver, new IntentFilter(ACTION_NEW_PROFILE)); - } - - private void launchStartPane(Context context) { - final Intent startIntent = new Intent(context, StartPane.class); - context.startActivity(startIntent); - } + } finally { + StrictMode.setThreadPolicy(savedPolicy); + } + } private Class getMediaPlayerManager() { if (AppConstants.MOZ_MEDIA_PLAYER) { @@ -740,6 +745,12 @@ public class BrowserApp extends GeckoApp super.onBackPressed(); } + @Override + public void onAttachedToWindow() { + // We can't show Onboarding until Gecko has finished initialization (bug 1077583). + checkStartPane(this, getIntent().getAction()); + } + @Override public void onResume() { super.onResume(); @@ -2668,7 +2679,6 @@ public class BrowserApp extends GeckoApp // or if the user has explicitly enabled the clear on shutdown pref. // (We check the pref last to save the pref read.) // In ICS+, it's easy to kill an app through the task switcher. - final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this); final boolean visible = Versions.preICS || HardwareUtils.isTelevision() || !PrefUtils.getStringSet(GeckoSharedPrefs.forProfile(this), diff --git a/mobile/android/base/GeckoProfile.java b/mobile/android/base/GeckoProfile.java index 5120dcfcbd4f..174247ddd016 100644 --- a/mobile/android/base/GeckoProfile.java +++ b/mobile/android/base/GeckoProfile.java @@ -27,6 +27,7 @@ import android.app.Activity; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.support.v4.content.LocalBroadcastManager; import android.text.TextUtils; import android.util.Log; @@ -692,9 +693,9 @@ public final class GeckoProfile { Log.w(LOGTAG, "Couldn't write times.json.", e); } - LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(mApplicationContext); - final Intent intent = new Intent(BrowserApp.ACTION_NEW_PROFILE); - lbm.sendBroadcast(intent); + // Initialize pref flag for displaying the start pane for a new profile. + final SharedPreferences prefs = GeckoSharedPrefs.forProfile(mApplicationContext); + prefs.edit().putBoolean(BrowserApp.PREF_STARTPANE_ENABLED, true).apply(); return profileDir; } diff --git a/mobile/android/base/tests/testGeckoProfile.java b/mobile/android/base/tests/testGeckoProfile.java index 81644b656faf..ada10ae00b6c 100644 --- a/mobile/android/base/tests/testGeckoProfile.java +++ b/mobile/android/base/tests/testGeckoProfile.java @@ -4,19 +4,18 @@ package org.mozilla.gecko.tests; -import org.mozilla.gecko.GeckoApp; -import org.mozilla.gecko.GeckoProfile; -import org.mozilla.gecko.GeckoProfileDirectories; -import org.mozilla.gecko.R; -import org.mozilla.gecko.util.INIParser; -import org.mozilla.gecko.util.INISection; - -import android.view.View; - import java.io.File; import java.util.Enumeration; import java.util.Hashtable; +import org.mozilla.gecko.GeckoApp; +import org.mozilla.gecko.GeckoProfile; +import org.mozilla.gecko.GeckoProfileDirectories; +import org.mozilla.gecko.GeckoSharedPrefs; +import org.mozilla.gecko.util.INIParser; +import org.mozilla.gecko.util.INISection; + +import android.content.Context; import android.text.TextUtils; /** @@ -279,4 +278,13 @@ public class testGeckoProfile extends PixelTest { return null; } + + @Override + public void tearDown() throws Exception { + // Clear SharedPreferences. + final Context context = getInstrumentation().getContext(); + GeckoSharedPrefs.forProfile(context).edit().clear().apply(); + + super.tearDown(); + } } From 32350bb8de035521416822a33f7ebbe1129f20f9 Mon Sep 17 00:00:00 2001 From: Mark Capella Date: Wed, 8 Oct 2014 20:41:15 -0400 Subject: [PATCH 67/79] Bug 1080016 - Display favicons properly after interrupted page loads, r=ckitching --- mobile/android/base/db/LocalBrowserDB.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/db/LocalBrowserDB.java b/mobile/android/base/db/LocalBrowserDB.java index 5272341e4e44..321a3c1788f0 100644 --- a/mobile/android/base/db/LocalBrowserDB.java +++ b/mobile/android/base/db/LocalBrowserDB.java @@ -1013,7 +1013,14 @@ public class LocalBrowserDB { try { if (c.moveToFirst()) { - return c.getString(c.getColumnIndexOrThrow(History.FAVICON_URL)); + // Interrupted page loads can leave History items without a valid favicon_id. + final int columnIndex = c.getColumnIndexOrThrow(History.FAVICON_URL); + if (!c.isNull(columnIndex)) { + final String faviconURL = c.getString(columnIndex); + if (faviconURL != null) { + return faviconURL; + } + } } } finally { c.close(); From df090e95e37d1cd22ab32232014956b6baeb27b3 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 8 Oct 2014 17:48:21 -0700 Subject: [PATCH 68/79] Bug 1071267 - Part 1: Remove padding inside site security assets. --- .../resources/drawable-hdpi/lock_identified.png | Bin 416 -> 622 bytes .../resources/drawable-hdpi/lock_verified.png | Bin 319 -> 532 bytes .../base/resources/drawable-hdpi/shield.png | Bin 520 -> 740 bytes .../base/resources/drawable-hdpi/warning.png | Bin 456 -> 676 bytes .../resources/drawable-mdpi/lock_identified.png | Bin 326 -> 533 bytes .../resources/drawable-mdpi/lock_verified.png | Bin 264 -> 476 bytes .../base/resources/drawable-mdpi/shield.png | Bin 426 -> 640 bytes .../base/resources/drawable-mdpi/warning.png | Bin 318 -> 533 bytes .../drawable-xhdpi/lock_identified.png | Bin 485 -> 686 bytes .../resources/drawable-xhdpi/lock_verified.png | Bin 367 -> 570 bytes .../base/resources/drawable-xhdpi/shield.png | Bin 706 -> 926 bytes .../base/resources/drawable-xhdpi/warning.png | Bin 529 -> 756 bytes .../resources/layout/toolbar_display_layout.xml | 4 +++- mobile/android/base/resources/values/dimens.xml | 2 +- 14 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mobile/android/base/resources/drawable-hdpi/lock_identified.png b/mobile/android/base/resources/drawable-hdpi/lock_identified.png index fb59a8fed97c35fe529f089794a4880206838e99..781682895789077a55dec2cbf05b3f48d6ce2e93 100644 GIT binary patch literal 622 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9e!3-n~@4mkVq*&4&eH|GXHuiJ>Nn{1`6_P!I zd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC0n}eGXIG#NP-1d`Plzj!o^UP*j{469 zg4kyRC!7V5{bvIEfg~CN3Z4nPTOebKr;B5V#O2&GH-(xE1Y9n%xr#ZmnrLaA@+pY__y7GAfwfH^ z_bhq6OlZNw9nA~Pi)8=&a7<wrtB>`t?__$f|b%tY)R>#oQUyAI4j8@8H=swjF*NBpo#FA92Wb&;n{;@O1TaS?83{1OQxH?n?jw literal 416 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TGlLLH0T!D1&$-utTf&FK|=v?50 zvw?l5KxF5kfc~?A6V3$z5s(2=0OXzx>O2?#LWcr?8bRn32tkwq%>gn%rU4BBlR!q# zagb3!m7PZdIu8eQ9SP_<8rXd_u=hk@_pv~rQ9v`{ih)KgRXBGQ=q$yOAirP+i@nWH zKdampd8d`n`K}`UMr6Y4t2f>-{yN2YT5gHLO8t1ZeWgIfvproLLn;`Lo^%&#au9G! z{KO+!%-0pUEBjr&m3QLhKbs2|=YL&g_dGoHWs=;wOJ~*vUaeWBH2c+pmt0#~&CgV> zES+imK0x`ILFIY76u*YrXN&eW-DLmPaqVqxr%i(EmAjKX7}<}Nm>Z|vat^<$^ps2P z`d+oB_Y)p4f8n)PIB4$iK~$)wk!8NZ!E}!gf|H-z_*t!=Q>GKDW_h>( P=u8GrS3j3^P6Nn{1`6_P!I zd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC0n}eGXIG#NP$D+KC&U#<$0ujd0{#F0 z|4+K=X`ltNB|(0{44nC=|9n=tc2nf>^7rXl`pxB4yX6%2Gd_Q7aVLh?c{<3Oj7i?^ zE^~GtVrcH6IS!FP$K! z?|tdeC#J8JO0gfWs&NDDS1oakC`m~yNwrEYN(E93Mh1o^x&{`yMy4T#W>%&qRt9Fe n2If`<25&?hrlDxa%}>cptHiBguICRepaup{S3j3^P69wRnEjWKXf$@;cQmzj*W)sJ&Nb z?GCxTxc&Ma6P~8%ik$M+FxwB3dbjUB)VSfegW2NXa{q0dVWxqlqJ_?rx+N~2yMJ@p hDkVMP?WrHX&s*!I#2MjJ=?`=RgQu&X%Q~loCIAgETkik> diff --git a/mobile/android/base/resources/drawable-hdpi/shield.png b/mobile/android/base/resources/drawable-hdpi/shield.png index cdaf60fdc749f2d67a004127fa7ae9d5529a3ee4..a278aab4658236fd07cb25d8dcca83f3edaf26b7 100644 GIT binary patch literal 740 zcmeAS@N?(olHy`uVBq!ia0vp^B0wy`!3-qNPSte*QY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIU5>i5E){Ta(S%DQ%O(Hg}$Nwh=ui+m&>9w(F#2C!2(Y-E-6|Pk(wEebB7(n6&1K zCx>6zu4`QQX7QsII(@ z`QLc{ZDtD4%dt5zoh7n)$;Skyc^G$mC2nccv8`189%Qev*1x{ePqW6 z#>Gq?m0Ryj@~PR*Y*Rel>vsm@t5@m@(Y!OI_U_gekI&nF@aHYx&o5#>$KI~aFDW;- ztX&@dH0pWqKW83mbmUtW z*fQV*A9m9eZjlPKumAu6^hrcPRCocs$=7b`P!vVc?Q+V&#S}2T7q~Yi^Z&mtGK$DH zkXPo@S{m}QLKa0?cy1GKxMuw1QP(qWf6dl+*s~5eS9M*T0cU$!Lj)w{>1!%7DH9+H zigR$qr%j=G{|g7X;vuQ;9suN;PZ=sUjJhemEF+BKInfc#5p%^EgSy27GQ|t%Xzs&8 zvA^R0UU72|iai9yv7;I(u5huahHR|j4gW;9;^U||Vb$U-Za2R1$+2y54bw3DPT}4Z z>K4a2B;kF~@GgNomR3H6w0O%TE}G@#uFet|@AqS1*^!6()^W|*zC7z<0L(@Hsx+pQ am-P*mKPIV6fyGh)0000Nn{1`6_P!I zd>I(3)EF2VS{N990fib~096|>FuY1&V6d9Oz#v{QXIG#NP@*fqC&U#<|6F4@;OPJV z|4i$C_W)g^QxfDC%nF`CqTxDe?8>R<$+r zgdd&%W^JP#ACVUW)W?|Q?e3y`_Lie9ki(hp=2i@(S-@EJy5Sv=U|E4@8AzW3Gd0bUzS8IxSnD)H&Nxd zYHWJTbCI*{B?~q79%az?yssYqzr;7M$w6vueWt|3=mdAShy3@v?%NhDxc64{$Ryzh z8s0KBALD!{GO5oBc6;t~ROZGCQ|stCFJ|gHtUG(~!lElHnX+=6e3n0%~CJboFyt=akR{07}vq9{>OV delta 328 zcmV-O0k{671;_&>iBL{Q4GJ0x0000DNk~Le0000U0000U2m=5B01WP4kN^Mxhmm26 ze?R0Km;e9(EOb&%QvitdtkMGp{Qfug7~;w6bG5HvsU{E4D=FklgO}i$p7EtSJXlx3 z!V_(|ke)SwSpWb4#7RU!RCoc+(N}hYPyhzu9~DptU9l*Z^fLQjUoKopl=AMkf;ngO zFkZLYH;vl(;BPc0!^kvZL2bU!un#z&f8kw&c5v~$40ame&LEe*VCJeX2NG!y$7{%2QW@ag+`ii8@v>Mj>4=;+5_>)V`&H+Fp0U3AIQ{sZB!NI?{+8r=oGtjipbA zztq1e*6A}mVNLaCF{kn5N^V8>Oo}y=QDUWP1z7WE>BYyIs8wbo&hNU3icci>^>IQbu_T+NI>Ud zkb?jJ|FiRXGXZUtE(!7rX3*a7Nyq$)70cc4)8?^y{|anbzr1tKpZB;FA*1hEOLS=d2nMr+( zbG)Ul2HkE?%ha?^7GC=jsA;8K{PNbR2ahGB7Z_Mb@?1|p@MHZ;w$7~r1`@L@o&#-D zEpd$~Nl7e8wMs5Z1yT$~28JfO1{S(TrXhxAR;DIa24=bj=2ivPsvQH W#I0ej=MOEQ1_n=8KbLh*2~7aag}kl+ literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQa`2jv5u0VRi*+39F7u0(yu>VY8 z|JlIalYu~X=b-?gAdoxZY!HwQL_qPr(;zh<@+=YqtR1BC97rWlS{W@x90g lSH`=dmJb%ajPZTXd)0t%$;B|HbwFzwJYD@<);T3K0RYtrkqZC- diff --git a/mobile/android/base/resources/drawable-mdpi/lock_verified.png b/mobile/android/base/resources/drawable-mdpi/lock_verified.png index f88b451598e482676516c7e7139b7d255545d8bf..e729acf01f9e9b8bbae2c4e88b228cfb065bc2ff 100644 GIT binary patch literal 476 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CP!3-py+uy4OQY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIis*gWkqNIzlf=do$HVX``?!PFmoQJb#r-^N_0=+<`Kl$Z5hW>!C8<`)MX5lF!N|bSMAyJV z*T^))(9Fuz#LB=-*TCG$z~GID!!#5Px%nxXX_dG&%=P@C1=PUc>FVdQ&MBb@0A03| AN&o-= literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQa9sxcfu0T3IIfHWKDkZZCXqI?M zkY6yv=et%b=KT2G`ER{>e_#u%H_J3_oef{U%!{}JR1)Fo;us=vdFu&tz6JvkmW!o+ zPquvDugQAi-xLnRyEYGUv%|9P&kGarlykea=B4=amF|tg&5T{?`UMGW45u|N#EQS1 ub@agQ3!!V=+PXykcCCzDl`%W2<~>We4Yy~aYn24h4hBzGKbLh*2~7YGmSI=` diff --git a/mobile/android/base/resources/drawable-mdpi/shield.png b/mobile/android/base/resources/drawable-mdpi/shield.png index 564d4b51466bb725efe00a71fe949aa3a6e284d5..e2d7c59ea2f0a3f17dcf08c992df9ca8d3be4fdb 100644 GIT binary patch literal 640 zcmeAS@N?(olHy`uVBq!ia0vp^d_XL~!3-n?z4mbcDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C*E$;1l8sq~nt_1_}EA z|NoohIUs-Nl?3?(Gbps(*4*@uv*YK(Do>M!%ir^&PO)70;=8(?tiUlHNQ;2+ zVr#97K*k(T7sn8e>#pZt3N;zFkt7CfD5(%k8f7s`>kwzUnO%{L)S9t zwsjB1FK=3z6uqqJF;~?;MT;ttbVJlUOOizZM>V+NpOC6m{Q2qWb&;n{;@O1TaS?83{1OSH+;n@HH delta 291 zcmV+;0o?w81*!ujiBL{Q4GJ0x0000DNk~Le0000K0000K2m=5B0J>N0KL7v#jgeuI ze-!D#761SME_6~(QviAaG~xbo`H1&6#9F!2reg{8ZiXo!4coGW&;)UJF#5ty>(>^5 zNk++`XNVi8k80+u;B)3W`sR#uPAoQI{hz*xX(eDpH&b&l5L?Q2!1D9C pU}z=n`Vj!eo(|;n6-<)O`URfO5TD&LVORhF002ovPDHLkV1jY&exLvV diff --git a/mobile/android/base/resources/drawable-mdpi/warning.png b/mobile/android/base/resources/drawable-mdpi/warning.png index a8ac4535e10800712df6a5b2dca3500f3e3cc0ac..d6ea70657b9fdb22a9007703d0259193073167ce 100644 GIT binary patch literal 533 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh3?wzC-F*zCSkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP$D6~C&U#<|6F58BlQ3O zf2M1DuLJFnD+%%oW{|ozU+wp@%tD=iENl6N*BHuewy-td^=R*$kIzk-_h@gA0;*(8 z@^*KTXXO>x3*>O-ySWtuX^@YZ8OkS5Uknl~D{xE)(js8I*jno%kWuLA;uykl-L)^8 zui1cyh4;vmCF>nD12l^NCktJ6`j&iL`Q{{79oI;)Nx_a&&uXr)-umoPfc&%OQ&S)O zuWJ6yJkP$H@s^m=ovqA!ysysOd&%Mb+WVgD=XjL%7MA4QnVw>_WV+ok&$Ppzdb}eUBhwH=Gb>XQD+4oK n19K|_gEt}$(@-?z=BH$)RpQn#*Yk%KPy>UftDnm{r-UW|jXuPh delta 231 zcmbQrvX4o%Gr-TCmrII^fq{Y7)59eQNQ;0l2Q!e|75>&9NX1S}OsrpNV{8m$%asKA z1vAY5xL3#4@VDB(=3Sc~J(rVOcFo*kj>(#}!kH|E{NW~lX8~0fdAc};RNPv7-cqQ^ zfq}tsN^*Iq!^eHU{-58n#)*Zu^w2rA-@&ifMb|&)#hMHRSi>1Ln;IfsTw*yI z_wWC0AC=CEgy%2s&E0&H!9Xq8bDC-@+y50&M=xCY7h|r~X!8H;*?W6d@dR_E`fm{1 zws%8D&=F_8%y*OA&Z}O$I5XmE>DlkT%~MQ;-7cF*@7t$(^wpwrgLwp8Bblw#In zy0uIB;Y5Wxi3?(N$ybDu^pb8VNln@!J3-Abq0@o==RkseX97D91^~r@2&j0%S&(`l>OBRL1tK6Ds2xaxWWlKa3`iG9 z1gQ8-VDAaAAwUz31aut@>^=suE2#4@kQ>l*Jh0~kNDa^yh&e!$LE6s*&YCcPC(wy1 zB|(0{4EHWF@^k&UDYtU!FLw3QNB@Wg3K=bR`YpN6W}aDlGMjSupCnF^eanIBFM7H- zhE&{od+s>jAp-%|izUk$Gr!yuwo>{3KetDfr+X&j6j`D2r|R-2uhnfl7|^eDSH3o3 zW4O(yN9E^4j~dq=vzET2ow)hJekZp{%Q_YP?S2=C=lu?@rG{mi=xZ#kcy^0;wQ(OcJh9pAw2G{OLcPcm=BL8lNK#ZZ{iwox*H@F^FYwDd= he9Tn(*8com%m=RqyeOT~AqeywgQu&X%Q~loCIBxQ+ywvt diff --git a/mobile/android/base/resources/drawable-xhdpi/lock_verified.png b/mobile/android/base/resources/drawable-xhdpi/lock_verified.png index ae0a96dd083bc1f4e27b87130339b0bad99ccf6d..9fc5798e33d5ca5208629cef2d2e27f70c388c8d 100644 GIT binary patch literal 570 zcmeAS@N?(olHy`uVBq!ia0vp^5GJq@%#wj{_en89Y=y+6OFnu)EHyQ#)?Ay8<_I=0RvNk$_l{>8_SzI&nvRLGd* z?d~F1#HFAO2on9c93)s);Fu1iHNbdr!IU3B#w<@4#}JM4PbWkQ zH7f|Xs0W6`ThqSV4ZmS@ysPkCyRD1oA5@dyC5#CMs4N( z&uTM_!_R6Om0T^0UG1>`^Mo7G>l=6751iu1bMRkbX#tbXudjmPx>FLfC=m5B@E8Jc>*vxx_3vV*WF^@OQYHp2$_TZOO0rXDC}m zhWTvL0=iPQ#5JNMC9x#cD!C{XNHG{07@FuBSm+v=h8UVznVMJ`nCTjrTNxO<5pkG? dq9HdwB{QuOw}!c%KR`Axc)I$ztaD0e0swU3!rlM? delta 283 zcmdnR@}5bxGr-TCmrII^fq{Y7)59eQNNa#F2Q!e|t>6(4q@pG!#??#K_r(F(vL!)& z!3=Et_f~RU_9?0pavfF> zaR~JFG5I{FWY_=yv+rJ+^l0;2vkAMa3qEiz3Sxg#7OKUeYp>dwQpKCk*h?TThs3BTsLocql4bE~2Kl*9Y}<)+@|t7){~&f)p* zNZ;~!3)!C)J}!ZuEWekO?Ot6}SMxEgFmvV^UybhioeR75|EmZZ>|^;~yLnA!-{#6K z{~6S7X5=&-t?C9wg=&dwL`h0wNvc(HQ7VvPFfuSS(KWEpH8Kq`G_x`_u`)2zH88g_ kFnA;4FbzdRZhlH;S|x4`b3K1(0W~mqy85}Sb4q9e03n=dJ^%m! delta 522 zcmV+l0`>i#2f_s#6Z zen1pxg~u ztwUD9b(!Ua@b|rydrdH}a2C&|0(^>~e zY2{gfxTC_V+ht}t2atnoSCuL(fYGY?i;5hrMnIv$2PljmqeC$TJg9IByU0=xe`N?; z72d(U%-!%F?o`+UWKgf<^Tr_^kB^UYIU(8ek9{Ji`8|$$zP!nFsn{UREa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBC^0j@C&U#<|6F4@*wFv~ z|7WghUk`MgVM&l*Fau-x%i=7)ca3#|AG=z`zVuD|t86Ou?H}u8`JZyL)N~iQSZam) ztVrIFWVo$zufub;`f8>qpk~G-Z+90Xhf6*ufE>Lvr8*2NXlQ4^aUJQHwzF5?&Z@BjShD*a2JTj%WY zue!waz(mUZVhT&5??e;c%{OBX{M6wP*Z3-y^fBmQs!W6Sl_ckFegcbqy>_0gVleNp zVLp*r^7Yg<)}@_I2^(u0HBC>;u2l`X|NBj{{w$Gco$vo`X4l^NoN>W4*Qc9%PRFei zTXgYEvwP`bVTZ-57AL2hc8E9Vhkk5s4gYI)U+mG<4ZE()p~DACh0q zPTDE?W@V1*p5%b?gHqW)^JV&XZsk4LUivBDAX}cnzkGtv$+`8vIv>eo{JnB$=BYo{ zYgv@?55Bsy?A~6h{KiI!KO6OWthW7T=lSJ#^4ZUZJYc}6mbgZgq$HN4S|t~y0x1R~ z149#C0}EXv(-1>5D^n9I12bI%b1MUbHzE$8P(^6S%}>cptHiBguICRepaup{S3j3^ HP6E(hG6?pm zeCuAczPH8RvQ7&%+hA7q0xVUahz}OYhvQ^ui4(5!!mzqEt&yR1$Lj zTNLema)} + diff --git a/mobile/android/base/resources/values/dimens.xml b/mobile/android/base/resources/values/dimens.xml index 3be373f519cd..9a4a72fa1623 100644 --- a/mobile/android/base/resources/values/dimens.xml +++ b/mobile/android/base/resources/values/dimens.xml @@ -11,7 +11,7 @@ 48dp 12dp 48dp - 20dp + 12dp 21.33dip From ed3b4f3c5ea6fe2f0f61f10c35af8949d8d84686 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 8 Oct 2014 17:48:29 -0700 Subject: [PATCH 69/79] Bug 1071267 - Part 2: Always display site security icon on new tablet. --- .../new_tablet_site_security_level.xml | 14 +++++++++ .../new_tablet_site_security_unknown.xml | 12 ++++++++ .../layout/toolbar_display_layout.xml | 7 +++-- .../android/base/resources/values/dimens.xml | 11 ++++++- .../base/toolbar/ToolbarDisplayLayout.java | 30 +++++++++++++++---- 5 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_level.xml create mode 100644 mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_unknown.xml diff --git a/mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_level.xml b/mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_level.xml new file mode 100644 index 000000000000..bc291220b86e --- /dev/null +++ b/mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_level.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_unknown.xml b/mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_unknown.xml new file mode 100644 index 000000000000..16049c41a7f6 --- /dev/null +++ b/mobile/android/base/resources/drawable-large-v11/new_tablet_site_security_unknown.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/mobile/android/base/resources/layout/toolbar_display_layout.xml b/mobile/android/base/resources/layout/toolbar_display_layout.xml index 2db6137be5b0..90ce2b7bb2cd 100644 --- a/mobile/android/base/resources/layout/toolbar_display_layout.xml +++ b/mobile/android/base/resources/layout/toolbar_display_layout.xml @@ -13,13 +13,14 @@ android:paddingRight="4dip" android:layout_gravity="center_vertical"/> - + diff --git a/mobile/android/base/resources/values/dimens.xml b/mobile/android/base/resources/values/dimens.xml index 9a4a72fa1623..a2ce1cb8f1a9 100644 --- a/mobile/android/base/resources/values/dimens.xml +++ b/mobile/android/base/resources/values/dimens.xml @@ -11,7 +11,7 @@ 48dp 12dp 48dp - 12dp + 12dp 21.33dip @@ -22,6 +22,9 @@ -30dp 16dp -6dp + 60dp + 18dp + 21dp 60dp 56dp @@ -45,6 +48,12 @@ value.--> 32dp + + + .5dp + 1dp + -1dp + 64dp diff --git a/mobile/android/base/toolbar/ToolbarDisplayLayout.java b/mobile/android/base/toolbar/ToolbarDisplayLayout.java index da1aad2225c1..19404dcc273e 100644 --- a/mobile/android/base/toolbar/ToolbarDisplayLayout.java +++ b/mobile/android/base/toolbar/ToolbarDisplayLayout.java @@ -41,6 +41,7 @@ import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.widget.Button; import android.widget.ImageButton; +import android.widget.LinearLayout; /** * {@code ToolbarDisplayLayout} is the UI for when the toolbar is in @@ -147,10 +148,27 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout mPrivateDomainColor = new ForegroundColorSpan(res.getColor(R.color.url_bar_domaintext_private)); mFavicon = (ImageButton) findViewById(R.id.favicon); + mSiteSecurity = (ImageButton) findViewById(R.id.site_security); + if (NewTabletUI.isEnabled(context)) { - // We don't show favicons in the toolbar on new tablet. - // TODO: removeView(mFavicon); - mFavicon.setVisibility(View.GONE); + mSiteSecurity.setVisibility(View.VISIBLE); + // TODO: Rename this resource and remove this call when new tablet is default. + mSiteSecurity.setImageResource(R.drawable.new_tablet_site_security_level); + + // TODO: This can likely be set statically in resources when new tablet is default. + // Dynamically update parameters for new tablet. + final LinearLayout.LayoutParams lp = + (LinearLayout.LayoutParams) mSiteSecurity.getLayoutParams(); + lp.height = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_height); + lp.width = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_width); + mSiteSecurity.setLayoutParams(lp); + final int siteSecurityVerticalPadding = + res.getDimensionPixelSize(R.dimen.new_tablet_site_security_padding_vertical); + mSiteSecurity.setPadding(0, siteSecurityVerticalPadding, 0, siteSecurityVerticalPadding); + + // We don't show favicons in the toolbar on new tablet. Note that while we could + // null the favicon reference, we don't do so to avoid excessive null-checking. + removeView(mFavicon); } else { if (Versions.feature16Plus) { mFavicon.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); @@ -158,7 +176,6 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout mFaviconSize = Math.round(res.getDimension(R.dimen.browser_toolbar_favicon_size)); } - mSiteSecurity = (ImageButton) findViewById(R.id.site_security); mSiteSecurityVisible = (mSiteSecurity.getVisibility() == View.VISIBLE); mSiteIdentityPopup = new SiteIdentityPopup(mActivity); @@ -200,7 +217,7 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout } }); - float slideWidth = getResources().getDimension(R.dimen.browser_toolbar_lock_width); + float slideWidth = getResources().getDimension(R.dimen.browser_toolbar_site_security_width); LayoutParams siteSecParams = (LayoutParams) mSiteSecurity.getLayoutParams(); final float scale = getResources().getDisplayMetrics().density; @@ -456,7 +473,8 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout } private void setSiteSecurityVisibility(boolean visible, EnumSet flags) { - if (visible == mSiteSecurityVisible) { + // We don't hide site security on new tablets. + if (visible == mSiteSecurityVisible || NewTabletUI.isEnabled(getContext())) { return; } From e186ad154f5d0ada7b661aa22aee82c2472a1a68 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 8 Oct 2014 17:48:32 -0700 Subject: [PATCH 70/79] Bug 1071267 - Part 3: Create large tappable margin for site security. --- .../res/layout-large-v11/new_tablet_browser_toolbar.xml | 4 ++-- mobile/android/base/resources/values/dimens.xml | 5 ++++- mobile/android/base/toolbar/ToolbarDisplayLayout.java | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_browser_toolbar.xml b/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_browser_toolbar.xml index d8fca2b61ad3..ac24aa65f667 100644 --- a/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_browser_toolbar.xml +++ b/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_browser_toolbar.xml @@ -43,12 +43,12 @@ android:layout_toRightOf="@id/back" android:layout_toLeftOf="@id/menu_items"/> - + 16dp -6dp 60dp - 18dp + 34dp + 21dp + 8dp + 1dp 60dp 56dp diff --git a/mobile/android/base/toolbar/ToolbarDisplayLayout.java b/mobile/android/base/toolbar/ToolbarDisplayLayout.java index 19404dcc273e..11e6ace2e01c 100644 --- a/mobile/android/base/toolbar/ToolbarDisplayLayout.java +++ b/mobile/android/base/toolbar/ToolbarDisplayLayout.java @@ -161,10 +161,15 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout (LinearLayout.LayoutParams) mSiteSecurity.getLayoutParams(); lp.height = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_height); lp.width = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_width); + // TODO: Override a common static value when new tablet is standard. + lp.rightMargin = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_right_margin); mSiteSecurity.setLayoutParams(lp); final int siteSecurityVerticalPadding = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_padding_vertical); - mSiteSecurity.setPadding(0, siteSecurityVerticalPadding, 0, siteSecurityVerticalPadding); + final int siteSecurityHorizontalPadding = + res.getDimensionPixelSize(R.dimen.new_tablet_site_security_padding_horizontal); + mSiteSecurity.setPadding(siteSecurityHorizontalPadding, siteSecurityVerticalPadding, + siteSecurityHorizontalPadding, siteSecurityVerticalPadding); // We don't show favicons in the toolbar on new tablet. Note that while we could // null the favicon reference, we don't do so to avoid excessive null-checking. From 7543d4da50352ddc0fc35120273d82f1f7993cf0 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Wed, 8 Oct 2014 20:49:47 -0400 Subject: [PATCH 71/79] Bug 1047133 - Persist FxA OAuth token between browser sessions. r=MattN --- browser/app/profile/firefox.js | 2 + browser/components/loop/MozLoopService.jsm | 157 ++++++++++++++---- .../loop/test/mochitest/browser_fxa_login.js | 13 +- .../test/mochitest/browser_toolbarbutton.js | 16 +- .../components/loop/test/mochitest/head.js | 13 +- .../test/xpcshell/test_loopservice_busy.js | 9 +- .../xpcshell/test_loopservice_initialize.js | 5 +- .../xpcshell/test_loopservice_registration.js | 2 +- .../test/xpcshell/test_loopservice_restart.js | 111 +++++++++++++ .../test_loopservice_token_invalid.js | 7 +- .../loop/test/xpcshell/xpcshell.ini | 1 + browser/components/nsBrowserGlue.js | 5 +- 12 files changed, 272 insertions(+), 69 deletions(-) create mode 100644 browser/components/loop/test/xpcshell/test_loopservice_restart.js diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index cd1488b4d960..b4117c488612 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1624,6 +1624,8 @@ pref("loop.CSP", "default-src 'self' about: file: chrome:; img-src 'self' data: pref("loop.oauth.google.redirect_uri", "urn:ietf:wg:oauth:2.0:oob:auto"); pref("loop.oauth.google.scope", "https://www.google.com/m8/feeds"); pref("loop.rooms.enabled", false); +pref("loop.fxa_oauth.tokendata", ""); +pref("loop.fxa_oauth.profile", ""); // serverURL to be assigned by services team pref("services.push.serverURL", "wss://push.services.mozilla.com/"); diff --git a/browser/components/loop/MozLoopService.jsm b/browser/components/loop/MozLoopService.jsm index f4e40017fe37..8d97febf8221 100644 --- a/browser/components/loop/MozLoopService.jsm +++ b/browser/components/loop/MozLoopService.jsm @@ -77,19 +77,27 @@ XPCOMUtils.defineLazyGetter(this, "log", () => { return new ConsoleAPI(consoleOptions); }); +function setJSONPref(aName, aValue) { + let value = !!aValue ? JSON.stringify(aValue) : ""; + Services.prefs.setCharPref(aName, value); +} + +function getJSONPref(aName) { + let value = Services.prefs.getCharPref(aName); + return !!value ? JSON.parse(value) : null; +} + // The current deferred for the registration process. This is set if in progress // or the registration was successful. This is null if a registration attempt was // unsuccessful. let gRegisteredDeferred = null; let gPushHandler = null; let gHawkClient = null; -let gLocalizedStrings = null; +let gLocalizedStrings = null; let gInitializeTimer = null; let gFxAEnabled = true; let gFxAOAuthClientPromise = null; let gFxAOAuthClient = null; -let gFxAOAuthTokenData = null; -let gFxAOAuthProfile = null; let gErrors = new Map(); /** @@ -306,6 +314,38 @@ let MozLoopServiceInternal = { return this.expiryTimeSeconds * 1000 > Date.now(); }, + /** + * Retrieves MozLoopService Firefox Accounts OAuth token. + * + * @return {Object} OAuth token + */ + get fxAOAuthTokenData() { + return getJSONPref("loop.fxa_oauth.tokendata"); + }, + + /** + * Sets MozLoopService Firefox Accounts OAuth token. + * If the tokenData is being cleared, will also clear the + * profile since the profile is dependent on the token data. + * + * @param {Object} aTokenData OAuth token + */ + set fxAOAuthTokenData(aTokenData) { + setJSONPref("loop.fxa_oauth.tokendata", aTokenData); + if (!aTokenData) { + this.fxAOAuthProfile = null; + } + }, + + /** + * Sets MozLoopService Firefox Accounts Profile data. + * + * @param {Object} aProfileData Profile data + */ + set fxAOAuthProfile(aProfileData) { + setJSONPref("loop.fxa_oauth.profile", aProfileData); + }, + /** * Retrieves MozLoopService "do not disturb" pref value. * @@ -420,9 +460,8 @@ let MozLoopServiceInternal = { let result = gRegisteredDeferred.promise; gPushHandler = mockPushHandler || MozLoopPushHandler; - gPushHandler.initialize(this.onPushRegistered.bind(this), - this.onHandleNotification.bind(this)); + this.onHandleNotification.bind(this)); return result; }, @@ -575,12 +614,15 @@ let MozLoopServiceInternal = { if (!gRegisteredDeferred) { return; } - gRegisteredDeferred.resolve(); + gRegisteredDeferred.resolve("registered to guest status"); // No need to clear the promise here, everything was good, so we don't need // to re-register. - }, (error) => { + }, error => { log.error("Failed to register with Loop server: ", error); - gRegisteredDeferred.reject(error.errno); + // registerWithLoopServer may have already made this null. + if (gRegisteredDeferred) { + gRegisteredDeferred.reject(error); + } gRegisteredDeferred = null; }); }, @@ -616,6 +658,8 @@ let MozLoopServiceInternal = { log.error("Failed to register with the loop server. Error: ", error); this.setError("registration", error); + gRegisteredDeferred.reject(error); + gRegisteredDeferred = null; throw error; } ); @@ -1069,15 +1113,36 @@ let MozLoopServiceInternal = { }; Object.freeze(MozLoopServiceInternal); -let gInitializeTimerFunc = () => { - // Kick off the push notification service into registering after a timeout - // this ensures we're not doing too much straight after the browser's finished +let gInitializeTimerFunc = (deferredInitialization, mockPushHandler, mockWebSocket) => { + // Kick off the push notification service into registering after a timeout. + // This ensures we're not doing too much straight after the browser's finished // starting up. gInitializeTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); - gInitializeTimer.initWithCallback(() => { - MozLoopService.register(); + gInitializeTimer.initWithCallback(Task.async(function* initializationCallback() { + yield MozLoopService.register(mockPushHandler, mockWebSocket).then(Task.async(function*() { + if (!MozLoopServiceInternal.fxAOAuthTokenData) { + log.debug("MozLoopService: Initialized without an already logged-in account"); + deferredInitialization.resolve("initialized to guest status"); + return; + } + + log.debug("MozLoopService: Initializing with already logged-in account"); + let registeredPromise = + MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, + gPushHandler.pushUrl); + registeredPromise.then(() => { + deferredInitialization.resolve("initialized to logged-in status"); + }, error => { + log.debug("MozLoopService: error logging in using cached auth token"); + MozLoopServiceInternal.setError("login", error); + deferredInitialization.reject("error logging in using cached auth token"); + }); + }), error => { + log.debug("MozLoopService: Failure of initial registration", error); + deferredInitialization.reject(error); + }); gInitializeTimer = null; - }, + }), MozLoopServiceInternal.initialRegistrationDelayMilliseconds, Ci.nsITimer.TYPE_ONE_SHOT); }; @@ -1094,9 +1159,10 @@ this.MozLoopService = { /** * Initialized the loop service, and starts registration with the * push and loop servers. + * + * @return {Promise} */ - initialize: function() { - + initialize: Task.async(function*(mockPushHandler, mockWebSocket) { // Do this here, rather than immediately after definition, so that we can // stub out API functions for unit testing Object.freeze(this); @@ -1104,21 +1170,34 @@ this.MozLoopService = { // Don't do anything if loop is not enabled. if (!Services.prefs.getBoolPref("loop.enabled") || Services.prefs.getBoolPref("loop.throttled")) { - return; + return Promise.reject("loop is not enabled"); } if (Services.prefs.getPrefType("loop.fxa.enabled") == Services.prefs.PREF_BOOL) { gFxAEnabled = Services.prefs.getBoolPref("loop.fxa.enabled"); if (!gFxAEnabled) { - this.logOutFromFxA(); + yield this.logOutFromFxA(); } } - // If expiresTime is in the future then kick-off registration. - if (MozLoopServiceInternal.urlExpiryTimeIsInFuture()) { - gInitializeTimerFunc(); + // If expiresTime is not in the future and the user hasn't + // previously authenticated then skip registration. + if (!MozLoopServiceInternal.urlExpiryTimeIsInFuture() && + !MozLoopServiceInternal.fxAOAuthTokenData) { + return Promise.resolve("registration not needed"); } - }, + + let deferredInitialization = Promise.defer(); + gInitializeTimerFunc(deferredInitialization, mockPushHandler, mockWebSocket); + + return deferredInitialization.promise.catch(error => { + if (typeof(error) == "object") { + // This never gets cleared since there is no UI to recover. Only restarting will work. + MozLoopServiceInternal.setError("initialization", error); + } + throw error; + }); + }), /** * If we're operating the service in "soft start" mode, and this browser @@ -1248,7 +1327,7 @@ this.MozLoopService = { * sooner, this function is a no-op; this ensures we always have the latest * expiry time for a url. * - * This is used to deterimine whether or not we should be registering with the + * This is used to determine whether or not we should be registering with the * push server on start. * * @param {Integer} expiryTimeSeconds The seconds since epoch of the expiry time @@ -1305,8 +1384,16 @@ this.MozLoopService = { return gFxAEnabled; }, + /** + * Gets the user profile, but only if there is + * tokenData present. Without tokenData, the + * profile is meaningless. + * + * @return {Object} + */ get userProfile() { - return gFxAOAuthProfile; + return getJSONPref("loop.fxa_oauth.tokendata") && + getJSONPref("loop.fxa_oauth.profile"); }, get errors() { @@ -1435,15 +1522,15 @@ this.MozLoopService = { * @return {Promise} that resolves when the FxA login flow is complete. */ logInToFxA: function() { - log.debug("logInToFxA with gFxAOAuthTokenData:", !!gFxAOAuthTokenData); - if (gFxAOAuthTokenData) { - return Promise.resolve(gFxAOAuthTokenData); + log.debug("logInToFxA with fxAOAuthTokenData:", !!MozLoopServiceInternal.fxAOAuthTokenData); + if (MozLoopServiceInternal.fxAOAuthTokenData) { + return Promise.resolve(MozLoopServiceInternal.fxAOAuthTokenData); } return MozLoopServiceInternal.promiseFxAOAuthAuthorization().then(response => { return MozLoopServiceInternal.promiseFxAOAuthToken(response.code, response.state); }).then(tokenData => { - gFxAOAuthTokenData = tokenData; + MozLoopServiceInternal.fxAOAuthTokenData = tokenData; return tokenData; }).then(tokenData => { return gRegisteredDeferred.promise.then(Task.async(function*() { @@ -1454,7 +1541,7 @@ this.MozLoopService = { } MozLoopServiceInternal.clearError("login"); MozLoopServiceInternal.clearError("profile"); - return gFxAOAuthTokenData; + return MozLoopServiceInternal.fxAOAuthTokenData; })); }).then(tokenData => { let client = new FxAccountsProfileClient({ @@ -1462,18 +1549,18 @@ this.MozLoopService = { token: tokenData.access_token }); client.fetchProfile().then(result => { - gFxAOAuthProfile = result; + MozLoopServiceInternal.fxAOAuthProfile = result; MozLoopServiceInternal.notifyStatusChanged("login"); }, error => { log.error("Failed to retrieve profile", error); this.setError("profile", error); - gFxAOAuthProfile = null; + MozLoopServiceInternal.fxAOAuthProfile = null; MozLoopServiceInternal.notifyStatusChanged(); }); return tokenData; }).catch(error => { - gFxAOAuthTokenData = null; - gFxAOAuthProfile = null; + MozLoopServiceInternal.fxAOAuthTokenData = null; + MozLoopServiceInternal.fxAOAuthProfile = null; throw error; }).catch((error) => { MozLoopServiceInternal.setError("login", error); @@ -1498,8 +1585,8 @@ this.MozLoopService = { MozLoopServiceInternal.clearSessionToken(LOOP_SESSION_TYPE.FXA); } - gFxAOAuthTokenData = null; - gFxAOAuthProfile = null; + MozLoopServiceInternal.fxAOAuthTokenData = null; + MozLoopServiceInternal.fxAOAuthProfile = null; // Reset the client since the initial promiseFxAOAuthParameters() call is // what creates a new session. diff --git a/browser/components/loop/test/mochitest/browser_fxa_login.js b/browser/components/loop/test/mochitest/browser_fxa_login.js index c4111bb57e00..f584b239850d 100644 --- a/browser/components/loop/test/mochitest/browser_fxa_login.js +++ b/browser/components/loop/test/mochitest/browser_fxa_login.js @@ -7,11 +7,6 @@ "use strict"; -const { - gFxAOAuthTokenData, - gFxAOAuthProfile, -} = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}); - const BASE_URL = "http://mochi.test:8888/browser/browser/components/loop/test/mochitest/loop_fxa.sjs?"; function* checkFxA401() { @@ -211,6 +206,8 @@ add_task(function* registrationWithInvalidState() { }, error => { is(error.code, 400, "Check error code"); + checkFxAOAuthTokenData(null); + is(MozLoopService.userProfile, null, "Profile should be empty after invalid login"); }); }); @@ -232,6 +229,8 @@ add_task(function* registrationWith401() { }, error => { is(error.code, 401, "Check error code"); + checkFxAOAuthTokenData(null); + is(MozLoopService.userProfile, null, "Profile should be empty after invalid login"); }); yield checkFxA401(); @@ -321,7 +320,7 @@ add_task(function* loginWithParams401() { }, error => { ise(error.code, 401, "Check error code"); - ise(gFxAOAuthTokenData, null, "Check there is no saved token data"); + checkFxAOAuthTokenData(null); }); yield checkFxA401(); @@ -387,7 +386,7 @@ add_task(function* loginWithRegistration401() { }, error => { ise(error.code, 401, "Check error code"); - ise(gFxAOAuthTokenData, null, "Check there is no saved token data"); + checkFxAOAuthTokenData(null); }); yield checkFxA401(); diff --git a/browser/components/loop/test/mochitest/browser_toolbarbutton.js b/browser/components/loop/test/mochitest/browser_toolbarbutton.js index 0c249b48b7bf..a9fa912ba783 100644 --- a/browser/components/loop/test/mochitest/browser_toolbarbutton.js +++ b/browser/components/loop/test/mochitest/browser_toolbarbutton.js @@ -9,7 +9,7 @@ registerCleanupFunction(function*() { MozLoopService.doNotDisturb = false; - setInternalLoopGlobal("gFxAOAuthProfile", null); + MozLoopServiceInternal.fxAOAuthProfile = null; yield MozLoopServiceInternal.clearError("testing"); }); @@ -25,7 +25,8 @@ add_task(function* test_doNotDisturb_with_login() { Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); yield MozLoopService.doNotDisturb = true; Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "disabled", "Check button is in disabled state"); - setInternalLoopGlobal("gFxAOAuthProfile", {email: "test@example.com", uid: "abcd1234"}); + MozLoopServiceInternal.fxAOAuthTokenData = {token_type:"bearer",access_token:"1bad3e44b12f77a88fe09f016f6a37c42e40f974bc7a8b432bb0d2f0e37e1752",scope:"profile"}; + MozLoopServiceInternal.fxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"}; yield MozLoopServiceInternal.notifyStatusChanged("login"); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "active", "Check button is in active state"); yield loadLoopPanel(); @@ -34,7 +35,7 @@ add_task(function* test_doNotDisturb_with_login() { loopPanel.hidePopup(); yield MozLoopService.doNotDisturb = false; Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); - setInternalLoopGlobal("gFxAOAuthProfile", null); + MozLoopServiceInternal.fxAOAuthTokenData = null; yield MozLoopServiceInternal.notifyStatusChanged(); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); }); @@ -51,26 +52,27 @@ add_task(function* test_error_with_login() { Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); yield MozLoopServiceInternal.setError("testing", {}); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "error", "Check button is in error state"); - setInternalLoopGlobal("gFxAOAuthProfile", {email: "test@example.com", uid: "abcd1234"}); + MozLoopServiceInternal.fxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"}; MozLoopServiceInternal.notifyStatusChanged("login"); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "error", "Check button is in error state"); yield MozLoopServiceInternal.clearError("testing"); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); - setInternalLoopGlobal("gFxAOAuthProfile", null); + MozLoopServiceInternal.fxAOAuthProfile = null; MozLoopServiceInternal.notifyStatusChanged(); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); }); add_task(function* test_active() { Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); - setInternalLoopGlobal("gFxAOAuthProfile", {email: "test@example.com", uid: "abcd1234"}); + MozLoopServiceInternal.fxAOAuthTokenData = {token_type:"bearer",access_token:"1bad3e44b12f77a88fe09f016f6a37c42e40f974bc7a8b432bb0d2f0e37e1752",scope:"profile"}; + MozLoopServiceInternal.fxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"}; yield MozLoopServiceInternal.notifyStatusChanged("login"); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "active", "Check button is in active state"); yield loadLoopPanel(); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state after opening panel"); let loopPanel = document.getElementById("loop-notification-panel"); loopPanel.hidePopup(); - setInternalLoopGlobal("gFxAOAuthProfile", null); + MozLoopServiceInternal.fxAOAuthTokenData = null; MozLoopServiceInternal.notifyStatusChanged(); Assert.strictEqual(LoopUI.toolbarButton.node.getAttribute("state"), "", "Check button is in default state"); }); diff --git a/browser/components/loop/test/mochitest/head.js b/browser/components/loop/test/mochitest/head.js index 3a2bc6fc0545..7ae7f1bfaadf 100644 --- a/browser/components/loop/test/mochitest/head.js +++ b/browser/components/loop/test/mochitest/head.js @@ -120,8 +120,8 @@ function* resetFxA() { global.gHawkClient = null; global.gFxAOAuthClientPromise = null; global.gFxAOAuthClient = null; - global.gFxAOAuthTokenData = null; - global.gFxAOAuthProfile = null; + MozLoopServiceInternal.fxAOAuthProfile = null; + MozLoopServiceInternal.fxAOAuthTokenData = null; const fxASessionPref = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA); Services.prefs.clearUserPref(fxASessionPref); MozLoopService.errors.clear(); @@ -130,17 +130,16 @@ function* resetFxA() { yield notified; } -function setInternalLoopGlobal(aName, aValue) { - let global = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}); - global[aName] = aValue; +function checkFxAOAuthTokenData(aValue) { + ise(MozLoopServiceInternal.fxAOAuthTokenData, aValue, "fxAOAuthTokenData should be " + aValue); } function checkLoggedOutState() { let global = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}); ise(global.gFxAOAuthClientPromise, null, "gFxAOAuthClientPromise should be cleared"); - ise(global.gFxAOAuthProfile, null, "gFxAOAuthProfile should be cleared"); + ise(MozLoopService.userProfile, null, "fxAOAuthProfile should be cleared"); ise(global.gFxAOAuthClient, null, "gFxAOAuthClient should be cleared"); - ise(global.gFxAOAuthTokenData, null, "gFxAOAuthTokenData should be cleared"); + checkFxAOAuthTokenData(null); const fxASessionPref = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA); ise(Services.prefs.getPrefType(fxASessionPref), Services.prefs.PREF_INVALID, "FxA hawk session should be cleared anyways"); diff --git a/browser/components/loop/test/xpcshell/test_loopservice_busy.js b/browser/components/loop/test/xpcshell/test_loopservice_busy.js index 3d067991cbd8..e699b03dc3ef 100644 --- a/browser/components/loop/test/xpcshell/test_loopservice_busy.js +++ b/browser/components/loop/test/xpcshell/test_loopservice_busy.js @@ -52,9 +52,10 @@ function run_test() { setupFakeLoopServer(); - // Setup fake login (profile) state so we get FxA requests. - const serviceGlobal = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}); - serviceGlobal.gFxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"}; + // Setup fake login state so we get FxA requests. + const MozLoopServiceInternal = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}).MozLoopServiceInternal; + MozLoopServiceInternal.fxAOAuthTokenData = {token_type:"bearer",access_token:"1bad3e44b12f77a88fe09f016f6a37c42e40f974bc7a8b432bb0d2f0e37e1752",scope:"profile"}; + MozLoopServiceInternal.fxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"}; // For each notification received from the PushServer, MozLoopService will first query // for any pending calls on the FxA hawk session and then again using the guest session. @@ -102,7 +103,7 @@ function run_test() Chat.open = openChatOrig; // Revert fake login state - serviceGlobal.gFxAOAuthProfile = null; + MozLoopServiceInternal.fxAOAuthTokenData = null; // clear test pref Services.prefs.clearUserPref("loop.seenToS"); diff --git a/browser/components/loop/test/xpcshell/test_loopservice_initialize.js b/browser/components/loop/test/xpcshell/test_loopservice_initialize.js index a30f88ff5c8f..bc4b6c6c2b75 100644 --- a/browser/components/loop/test/xpcshell/test_loopservice_initialize.js +++ b/browser/components/loop/test/xpcshell/test_loopservice_initialize.js @@ -10,8 +10,9 @@ var startTimerCalled = false; add_task(function test_initialize_no_expiry() { startTimerCalled = false; - MozLoopService.initialize(); - + let initializedPromise = yield MozLoopService.initialize(); + Assert.equal(initializedPromise, "registration not needed", + "Promise should be fulfilled"); Assert.equal(startTimerCalled, false, "should not register when no expiry time is set"); }); diff --git a/browser/components/loop/test/xpcshell/test_loopservice_registration.js b/browser/components/loop/test/xpcshell/test_loopservice_registration.js index f086ab88e711..b17812d8f3b2 100644 --- a/browser/components/loop/test/xpcshell/test_loopservice_registration.js +++ b/browser/components/loop/test/xpcshell/test_loopservice_registration.js @@ -40,7 +40,7 @@ add_test(function test_register_websocket_success_loop_server_fail() { }, err => { // 404 is an expected failure indicated by the lack of route being set // up on the Loop server mock. This is added in the next test. - Assert.equal(err, 404, "Expected no errors in websocket registration"); + Assert.equal(err.errno, 404, "Expected no errors in websocket registration"); run_next_test(); }); diff --git a/browser/components/loop/test/xpcshell/test_loopservice_restart.js b/browser/components/loop/test/xpcshell/test_loopservice_restart.js new file mode 100644 index 000000000000..5efa2f9e126e --- /dev/null +++ b/browser/components/loop/test/xpcshell/test_loopservice_restart.js @@ -0,0 +1,111 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +const FAKE_FXA_TOKEN_DATA = JSON.stringify({ + "token_type": "bearer", + "access_token": "1bad3e44b12f77a88fe09f016f6a37c42e40f974bc7a8b432bb0d2f0e37e1752", + "scope": "profile" +}); +const FAKE_FXA_PROFILE = JSON.stringify({ + "email": "test@example.com", + "uid": "999999994d9f4b08a2cbfc0999999999", + "avatar": null +}); +const LOOP_FXA_TOKEN_PREF = "loop.fxa_oauth.tokendata"; +const LOOP_FXA_PROFILE_PREF = "loop.fxa_oauth.profile"; +const LOOP_URL_EXPIRY_PREF = "loop.urlsExpiryTimeSeconds"; +const LOOP_INITIAL_DELAY_PREF = "loop.initialDelay"; + +/** + * This file is to test restart+reauth. + */ + +add_task(function test_initialize_with_expired_urls_and_no_auth_token() { + // Set time to be 2 seconds in the past. + var nowSeconds = Date.now() / 1000; + Services.prefs.setIntPref(LOOP_URL_EXPIRY_PREF, nowSeconds - 2); + Services.prefs.clearUserPref(LOOP_FXA_TOKEN_PREF); + + yield MozLoopService.initialize(mockPushHandler).then((msg) => { + Assert.equal(msg, "registration not needed", "Initialize should not register when the " + + "URLs are expired and there are no auth tokens"); + }, (error) => { + Assert.ok(false, error, "should have resolved the promise that initialize returned"); + }); +}); + +add_task(function test_initialize_with_urls_and_no_auth_token() { + Services.prefs.setIntPref(LOOP_URL_EXPIRY_PREF, Date.now() / 1000 + 10); + Services.prefs.clearUserPref(LOOP_FXA_TOKEN_PREF); + + loopServer.registerPathHandler("/registration", (request, response) => { + response.setStatusLine(null, 200, "OK"); + }); + + yield MozLoopService.initialize(mockPushHandler).then((msg) => { + Assert.equal(msg, "initialized to guest status", "Initialize should register as a " + + "guest when no auth tokens but expired URLs"); + }, (error) => { + Assert.ok(false, error, "should have resolved the promise that initialize returned"); + }); +}); + +add_task(function test_initialize_with_invalid_fxa_token() { + Services.prefs.setCharPref(LOOP_FXA_PROFILE_PREF, FAKE_FXA_PROFILE); + Services.prefs.setCharPref(LOOP_FXA_TOKEN_PREF, FAKE_FXA_TOKEN_DATA); + + // Only need to implement the FxA registration because the previous + // test registered as a guest. + loopServer.registerPathHandler("/registration", (request, response) => { + response.setStatusLine(null, 401, "Unauthorized"); + response.write(JSON.stringify({ + code: 401, + errno: 110, + error: "Unauthorized", + message: "Unknown credentials", + })); + }); + + yield MozLoopService.initialize(mockPushHandler).then(() => { + Assert.ok(false, "Initializing with an invalid token should reject the promise"); + }, + (error) => { + let pushHandler = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}).gPushHandler; + Assert.equal(pushHandler.pushUrl, kEndPointUrl, "Push URL should match"); + Assert.equal(Services.prefs.getCharPref(LOOP_FXA_TOKEN_PREF), "", + "FXA pref should be cleared if token was invalid"); + Assert.equal(Services.prefs.getCharPref(LOOP_FXA_PROFILE_PREF), "", + "FXA profile pref should be cleared if token was invalid"); + }); +}); + +add_task(function test_initialize_with_fxa_token() { + Services.prefs.setCharPref(LOOP_FXA_PROFILE_PREF, FAKE_FXA_PROFILE); + Services.prefs.setCharPref(LOOP_FXA_TOKEN_PREF, FAKE_FXA_TOKEN_DATA); + loopServer.registerPathHandler("/registration", (request, response) => { + response.setStatusLine(null, 200, "OK"); + }); + + yield MozLoopService.initialize(mockPushHandler).then(() => { + Assert.equal(Services.prefs.getCharPref(LOOP_FXA_TOKEN_PREF), FAKE_FXA_TOKEN_DATA, + "FXA pref should still be set after initialization"); + Assert.equal(Services.prefs.getCharPref(LOOP_FXA_PROFILE_PREF), FAKE_FXA_PROFILE, + "FXA profile should still be set after initialization"); + }); +}); + +function run_test() { + setupFakeLoopServer(); + // Note, this is just used to speed up the test. + Services.prefs.setIntPref(LOOP_INITIAL_DELAY_PREF, 0); + mockPushHandler.pushUrl = kEndPointUrl; + + do_register_cleanup(function() { + Services.prefs.clearUserPref(LOOP_INITIAL_DELAY_PREF); + Services.prefs.clearUserPref(LOOP_FXA_TOKEN_PREF); + Services.prefs.clearUserPref(LOOP_FXA_PROFILE_PREF); + Services.prefs.clearUserPref(LOOP_URL_EXPIRY_PREF); + }); + + run_next_test(); +}; diff --git a/browser/components/loop/test/xpcshell/test_loopservice_token_invalid.js b/browser/components/loop/test/xpcshell/test_loopservice_token_invalid.js index b0a54f55669d..4b1b05267574 100644 --- a/browser/components/loop/test/xpcshell/test_loopservice_token_invalid.js +++ b/browser/components/loop/test/xpcshell/test_loopservice_token_invalid.js @@ -18,11 +18,8 @@ add_test(function test_registration_invalid_token() { response.write(JSON.stringify({ code: 401, errno: 110, - error: { - error: "Unauthorized", - message: "Unknown credentials", - statusCode: 401 - } + error: "Unauthorized", + message: "Unknown credentials", })); } else { // We didn't have an authorization header, so check the pref has been cleared. diff --git a/browser/components/loop/test/xpcshell/xpcshell.ini b/browser/components/loop/test/xpcshell/xpcshell.ini index bc55744945ed..9c2b25c53283 100644 --- a/browser/components/loop/test/xpcshell/xpcshell.ini +++ b/browser/components/loop/test/xpcshell/xpcshell.ini @@ -15,6 +15,7 @@ skip-if = toolkit == 'gonk' [test_loopservice_locales.js] [test_loopservice_notification.js] [test_loopservice_registration.js] +[test_loopservice_restart.js] [test_loopservice_token_invalid.js] [test_loopservice_token_save.js] [test_loopservice_token_send.js] diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index bf316be8d974..a26606df8050 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -743,7 +743,10 @@ BrowserGlue.prototype = { // XXX: Temporary hack to allow Loop FxA login after a restart to work. // Remove this once bug 1071247 is deployed. - Services.prefs.clearUserPref("loop.hawk-session-token.fxa"); + if (Services.prefs.getPrefType("loop.autologin-after-restart") != Ci.nsIPrefBranch.PREF_BOOL || + !Services.prefs.getBoolPref("loop.autologin-after-restart")) { + Services.prefs.clearUserPref("loop.hawk-session-token.fxa"); + } }, // All initial windows have opened. From c5325823e96cf03847683c1706a54fbafdf1b2ca Mon Sep 17 00:00:00 2001 From: Mike de Boer Date: Wed, 8 Oct 2014 17:40:38 +0200 Subject: [PATCH 72/79] Bug 1078309: use a different database for each Loop Fx Account. r=paolo --- browser/components/loop/LoopStorage.jsm | 48 +++++++++++- browser/components/loop/MozLoopService.jsm | 4 + .../components/loop/content/js/contacts.js | 73 ++++++++++++++++--- .../components/loop/content/js/contacts.jsx | 73 ++++++++++++++++--- browser/components/loop/content/js/panel.js | 4 +- browser/components/loop/content/js/panel.jsx | 4 +- .../test/mochitest/browser_LoopContacts.js | 33 +++++++++ 7 files changed, 212 insertions(+), 27 deletions(-) diff --git a/browser/components/loop/LoopStorage.jsm b/browser/components/loop/LoopStorage.jsm index f5df5ccbba84..689fd2313262 100644 --- a/browser/components/loop/LoopStorage.jsm +++ b/browser/components/loop/LoopStorage.jsm @@ -25,7 +25,9 @@ XPCOMUtils.defineLazyGetter(this, "eventEmitter", function() { this.EXPORTED_SYMBOLS = ["LoopStorage"]; -const kDatabaseName = "loop"; +const kDatabasePrefix = "loop-"; +const kDefaultDatabaseName = "default"; +let gDatabaseName = kDatabasePrefix + kDefaultDatabaseName; const kDatabaseVersion = 1; let gWaitForOpenCallbacks = new Set(); @@ -83,7 +85,7 @@ const ensureDatabaseOpen = function(onOpen) { gWaitForOpenCallbacks.clear(); }; - let openRequest = indexedDB.open(kDatabaseName, kDatabaseVersion); + let openRequest = indexedDB.open(gDatabaseName, kDatabaseVersion); openRequest.onblocked = function(event) { invokeCallbacks(new Error("Database cannot be upgraded cause in use: " + event.target.error)); @@ -92,7 +94,7 @@ const ensureDatabaseOpen = function(onOpen) { openRequest.onerror = function(event) { // Try to delete the old database so that we can start this process over // next time. - indexedDB.deleteDatabase(kDatabaseName); + indexedDB.deleteDatabase(gDatabaseName); invokeCallbacks(new Error("Error while opening database: " + event.target.errorCode)); }; @@ -109,6 +111,29 @@ const ensureDatabaseOpen = function(onOpen) { }; }; +/** + * Switch to a database with a different name by closing the current connection + * and making sure that the next connection attempt will be made using the updated + * name. + * + * @param {String} name New name of the database to switch to. + */ +const switchDatabase = function(name) { + if (name == gDatabaseName) { + // This is already the current database, so there's no need to switch. + return; + } + + gDatabaseName = name; + if (gDatabase) { + try { + gDatabase.close(); + } finally { + gDatabase = null; + } + } +}; + /** * Start a transaction on the loop database and return it. * @@ -179,6 +204,13 @@ const getStore = function(store, callback, mode) { * database is loaded in memory and consumers will be able to change its structure. */ this.LoopStorage = Object.freeze({ + /** + * @var {String} databaseName The name of the database that is currently active. + */ + get databaseName() { + return gDatabaseName; + }, + /** * Open a connection to the IndexedDB database and return the database object. * @@ -191,6 +223,16 @@ this.LoopStorage = Object.freeze({ ensureDatabaseOpen(callback); }, + /** + * Switch to a database with a different name. + * + * @param {String} name New name of the database to switch to. Defaults to + * `kDefaultDatabaseName` + */ + switchDatabase: function(name = kDefaultDatabaseName) { + switchDatabase(name); + }, + /** * Start a transaction on the loop database and return it. * If only two arguments are passed, the default mode will be assumed and the diff --git a/browser/components/loop/MozLoopService.jsm b/browser/components/loop/MozLoopService.jsm index 8d97febf8221..e940de6375f0 100644 --- a/browser/components/loop/MozLoopService.jsm +++ b/browser/components/loop/MozLoopService.jsm @@ -56,6 +56,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "HawkClient", XPCOMUtils.defineLazyModuleGetter(this, "deriveHawkCredentials", "resource://services-common/hawkrequest.js"); +XPCOMUtils.defineLazyModuleGetter(this, "LoopStorage", + "resource:///modules/loop/LoopStorage.jsm"); + XPCOMUtils.defineLazyModuleGetter(this, "MozLoopPushHandler", "resource:///modules/loop/MozLoopPushHandler.jsm"); @@ -367,6 +370,7 @@ let MozLoopServiceInternal = { notifyStatusChanged: function(aReason = null) { log.debug("notifyStatusChanged with reason:", aReason); + LoopStorage.switchDatabase(gFxAOAuthProfile ? gFxAOAuthProfile.uid : null); Services.obs.notifyObservers(null, "loop-status-changed", aReason); }, diff --git a/browser/components/loop/content/js/contacts.js b/browser/components/loop/content/js/contacts.js index 96ced18d13fa..4dba2cf07691 100644 --- a/browser/components/loop/content/js/contacts.js +++ b/browser/components/loop/content/js/contacts.js @@ -153,14 +153,14 @@ loop.contacts = (function(_, mozL10n) { document.body.removeEventListener("click", this._onBodyClick); }, - componentShouldUpdate: function(nextProps, nextState) { + shouldComponentUpdate: function(nextProps, nextState) { let currContact = this.props.contact; let nextContact = nextProps.contact; return ( currContact.name[0] !== nextContact.name[0] || currContact.blocked !== nextContact.blocked || - getPreferredEmail(currContact).value !== - getPreferredEmail(nextContact).value + getPreferredEmail(currContact).value !== getPreferredEmail(nextContact).value || + nextState.showMenu !== this.state.showMenu ); }, @@ -215,20 +215,32 @@ loop.contacts = (function(_, mozL10n) { const ContactsList = React.createClass({displayName: 'ContactsList', mixins: [React.addons.LinkedStateMixin], + /** + * Contacts collection object + */ + contacts: null, + + /** + * User profile + */ + _userProfile: null, + getInitialState: function() { return { - contacts: {}, importBusy: false, filter: "", }; }, - componentDidMount: function() { + refresh: function(callback = function() {}) { let contactsAPI = navigator.mozLoop.contacts; + this.handleContactRemoveAll(); + contactsAPI.getAll((err, contacts) => { if (err) { - throw err; + callback(err); + return; } // Add contacts already present in the DB. We do this in timed chunks to @@ -239,11 +251,32 @@ loop.contacts = (function(_, mozL10n) { }); if (contacts.length) { setTimeout(addContactsInChunks, 0); + } else { + callback(); } this.forceUpdate(); }; addContactsInChunks(contacts); + }); + }, + + componentWillMount: function() { + // Take the time to initialize class variables that are used outside + // `this.state`. + this.contacts = {}; + this._userProfile = navigator.mozLoop.userProfile; + }, + + componentDidMount: function() { + window.addEventListener("LoopStatusChanged", this._onStatusChanged); + + this.refresh(err => { + if (err) { + throw err; + } + + let contactsAPI = navigator.mozLoop.contacts; // Listen for contact changes/ updates. contactsAPI.on("add", (eventName, contact) => { @@ -261,8 +294,24 @@ loop.contacts = (function(_, mozL10n) { }); }, + componentWillUnmount: function() { + window.removeEventListener("LoopStatusChanged", this._onStatusChanged); + }, + + _onStatusChanged: function() { + let profile = navigator.mozLoop.userProfile; + let currUid = this._userProfile ? this._userProfile.uid : null; + let newUid = profile ? profile.uid : null; + if (currUid != newUid) { + // On profile change (login, logout), reload all contacts. + this._userProfile = profile; + // The following will do a forceUpdate() for us. + this.refresh(); + } + }, + handleContactAddOrUpdate: function(contact, render = true) { - let contacts = this.state.contacts; + let contacts = this.contacts; let guid = String(contact._guid); contacts[guid] = contact; if (render) { @@ -271,7 +320,7 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemove: function(contact) { - let contacts = this.state.contacts; + let contacts = this.contacts; let guid = String(contact._guid); if (!contacts[guid]) { return; @@ -281,7 +330,9 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemoveAll: function() { - this.setState({contacts: {}}); + // Do not allow any race conditions when removing all contacts. + this.contacts = {}; + this.forceUpdate(); }, handleImportButtonClick: function() { @@ -364,11 +415,11 @@ loop.contacts = (function(_, mozL10n) { handleContactAction: this.handleContactAction}) }; - let shownContacts = _.groupBy(this.state.contacts, function(contact) { + let shownContacts = _.groupBy(this.contacts, function(contact) { return contact.blocked ? "blocked" : "available"; }); - let showFilter = Object.getOwnPropertyNames(this.state.contacts).length >= + let showFilter = Object.getOwnPropertyNames(this.contacts).length >= MIN_CONTACTS_FOR_FILTERING; if (showFilter) { let filter = this.state.filter.trim().toLocaleLowerCase(); diff --git a/browser/components/loop/content/js/contacts.jsx b/browser/components/loop/content/js/contacts.jsx index 127ce19dafda..56dc27d995b9 100644 --- a/browser/components/loop/content/js/contacts.jsx +++ b/browser/components/loop/content/js/contacts.jsx @@ -153,14 +153,14 @@ loop.contacts = (function(_, mozL10n) { document.body.removeEventListener("click", this._onBodyClick); }, - componentShouldUpdate: function(nextProps, nextState) { + shouldComponentUpdate: function(nextProps, nextState) { let currContact = this.props.contact; let nextContact = nextProps.contact; return ( currContact.name[0] !== nextContact.name[0] || currContact.blocked !== nextContact.blocked || - getPreferredEmail(currContact).value !== - getPreferredEmail(nextContact).value + getPreferredEmail(currContact).value !== getPreferredEmail(nextContact).value || + nextState.showMenu !== this.state.showMenu ); }, @@ -215,20 +215,32 @@ loop.contacts = (function(_, mozL10n) { const ContactsList = React.createClass({ mixins: [React.addons.LinkedStateMixin], + /** + * Contacts collection object + */ + contacts: null, + + /** + * User profile + */ + _userProfile: null, + getInitialState: function() { return { - contacts: {}, importBusy: false, filter: "", }; }, - componentDidMount: function() { + refresh: function(callback = function() {}) { let contactsAPI = navigator.mozLoop.contacts; + this.handleContactRemoveAll(); + contactsAPI.getAll((err, contacts) => { if (err) { - throw err; + callback(err); + return; } // Add contacts already present in the DB. We do this in timed chunks to @@ -239,11 +251,32 @@ loop.contacts = (function(_, mozL10n) { }); if (contacts.length) { setTimeout(addContactsInChunks, 0); + } else { + callback(); } this.forceUpdate(); }; addContactsInChunks(contacts); + }); + }, + + componentWillMount: function() { + // Take the time to initialize class variables that are used outside + // `this.state`. + this.contacts = {}; + this._userProfile = navigator.mozLoop.userProfile; + }, + + componentDidMount: function() { + window.addEventListener("LoopStatusChanged", this._onStatusChanged); + + this.refresh(err => { + if (err) { + throw err; + } + + let contactsAPI = navigator.mozLoop.contacts; // Listen for contact changes/ updates. contactsAPI.on("add", (eventName, contact) => { @@ -261,8 +294,24 @@ loop.contacts = (function(_, mozL10n) { }); }, + componentWillUnmount: function() { + window.removeEventListener("LoopStatusChanged", this._onStatusChanged); + }, + + _onStatusChanged: function() { + let profile = navigator.mozLoop.userProfile; + let currUid = this._userProfile ? this._userProfile.uid : null; + let newUid = profile ? profile.uid : null; + if (currUid != newUid) { + // On profile change (login, logout), reload all contacts. + this._userProfile = profile; + // The following will do a forceUpdate() for us. + this.refresh(); + } + }, + handleContactAddOrUpdate: function(contact, render = true) { - let contacts = this.state.contacts; + let contacts = this.contacts; let guid = String(contact._guid); contacts[guid] = contact; if (render) { @@ -271,7 +320,7 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemove: function(contact) { - let contacts = this.state.contacts; + let contacts = this.contacts; let guid = String(contact._guid); if (!contacts[guid]) { return; @@ -281,7 +330,9 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemoveAll: function() { - this.setState({contacts: {}}); + // Do not allow any race conditions when removing all contacts. + this.contacts = {}; + this.forceUpdate(); }, handleImportButtonClick: function() { @@ -364,11 +415,11 @@ loop.contacts = (function(_, mozL10n) { handleContactAction={this.handleContactAction} /> }; - let shownContacts = _.groupBy(this.state.contacts, function(contact) { + let shownContacts = _.groupBy(this.contacts, function(contact) { return contact.blocked ? "blocked" : "available"; }); - let showFilter = Object.getOwnPropertyNames(this.state.contacts).length >= + let showFilter = Object.getOwnPropertyNames(this.contacts).length >= MIN_CONTACTS_FOR_FILTERING; if (showFilter) { let filter = this.state.filter.trim().toLocaleLowerCase(); diff --git a/browser/components/loop/content/js/panel.js b/browser/components/loop/content/js/panel.js index 23ab5b4b5bf3..e32819d7cb3e 100644 --- a/browser/components/loop/content/js/panel.js +++ b/browser/components/loop/content/js/panel.js @@ -625,7 +625,9 @@ loop.panel = (function(_, mozL10n) { _onStatusChanged: function() { var profile = navigator.mozLoop.userProfile; - if (profile != this.state.userProfile) { + var currUid = this.state.userProfile ? this.state.userProfile.uid : null; + var newUid = profile ? profile.uid : null; + if (currUid != newUid) { // On profile change (login, logout), switch back to the default tab. this.selectTab("call"); } diff --git a/browser/components/loop/content/js/panel.jsx b/browser/components/loop/content/js/panel.jsx index 3fe901b6e450..28823439c5f8 100644 --- a/browser/components/loop/content/js/panel.jsx +++ b/browser/components/loop/content/js/panel.jsx @@ -625,7 +625,9 @@ loop.panel = (function(_, mozL10n) { _onStatusChanged: function() { var profile = navigator.mozLoop.userProfile; - if (profile != this.state.userProfile) { + var currUid = this.state.userProfile ? this.state.userProfile.uid : null; + var newUid = profile ? profile.uid : null; + if (currUid != newUid) { // On profile change (login, logout), switch back to the default tab. this.selectTab("call"); } diff --git a/browser/components/loop/test/mochitest/browser_LoopContacts.js b/browser/components/loop/test/mochitest/browser_LoopContacts.js index 7e52b80aeba8..380cd0808c95 100644 --- a/browser/components/loop/test/mochitest/browser_LoopContacts.js +++ b/browser/components/loop/test/mochitest/browser_LoopContacts.js @@ -2,6 +2,11 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ const {LoopContacts} = Cu.import("resource:///modules/loop/LoopContacts.jsm", {}); +const {LoopStorage} = Cu.import("resource:///modules/loop/LoopStorage.jsm", {}); + +XPCOMUtils.defineLazyServiceGetter(this, "uuidgen", + "@mozilla.org/uuid-generator;1", + "nsIUUIDGenerator"); const kContacts = [{ id: 1, @@ -400,3 +405,31 @@ add_task(function* () { Assert.strictEqual(gExpectedRemovals.length, 0, "No contact removals should be expected anymore"); Assert.strictEqual(gExpectedUpdates.length, 0, "No contact updates should be expected anymore"); }); + +// Test switching between different databases. +add_task(function* () { + Assert.equal(LoopStorage.databaseName, "loop-default", "First active partition should be the default"); + yield promiseLoadContacts(); + + let uuid = uuidgen.generateUUID().toString().replace(/[{}]+/g, ""); + LoopStorage.switchDatabase(uuid); + Assert.equal(LoopStorage.databaseName, uuid, "The active partition should have changed"); + + yield promiseLoadContacts(); + + let contacts = yield promiseLoadContacts(); + for (let i = 0, l = contacts.length; i < l; ++i) { + compareContacts(contacts[i], kContacts[i]); + } + + LoopStorage.switchDatabase(); + Assert.equal(LoopStorage.databaseName, "loop-default", "The active partition should have changed"); + + LoopContacts.getAll(function(err, contacts) { + Assert.equal(err, null, "There shouldn't be an error"); + + for (let i = 0, l = contacts.length; i < l; ++i) { + compareContacts(contacts[i], kContacts[i]); + } + }); +}); From 34c1606e52bbb2dfbc6eb0300378050e9cc29c0f Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Wed, 8 Oct 2014 23:44:10 -0400 Subject: [PATCH 73/79] Backed out changeset 047060a5b1dc (bug 1078309) for failing browser_LoopContacts.js --- browser/components/loop/LoopStorage.jsm | 48 +----------- browser/components/loop/MozLoopService.jsm | 4 - .../components/loop/content/js/contacts.js | 73 +++---------------- .../components/loop/content/js/contacts.jsx | 73 +++---------------- browser/components/loop/content/js/panel.js | 4 +- browser/components/loop/content/js/panel.jsx | 4 +- .../test/mochitest/browser_LoopContacts.js | 33 --------- 7 files changed, 27 insertions(+), 212 deletions(-) diff --git a/browser/components/loop/LoopStorage.jsm b/browser/components/loop/LoopStorage.jsm index 689fd2313262..f5df5ccbba84 100644 --- a/browser/components/loop/LoopStorage.jsm +++ b/browser/components/loop/LoopStorage.jsm @@ -25,9 +25,7 @@ XPCOMUtils.defineLazyGetter(this, "eventEmitter", function() { this.EXPORTED_SYMBOLS = ["LoopStorage"]; -const kDatabasePrefix = "loop-"; -const kDefaultDatabaseName = "default"; -let gDatabaseName = kDatabasePrefix + kDefaultDatabaseName; +const kDatabaseName = "loop"; const kDatabaseVersion = 1; let gWaitForOpenCallbacks = new Set(); @@ -85,7 +83,7 @@ const ensureDatabaseOpen = function(onOpen) { gWaitForOpenCallbacks.clear(); }; - let openRequest = indexedDB.open(gDatabaseName, kDatabaseVersion); + let openRequest = indexedDB.open(kDatabaseName, kDatabaseVersion); openRequest.onblocked = function(event) { invokeCallbacks(new Error("Database cannot be upgraded cause in use: " + event.target.error)); @@ -94,7 +92,7 @@ const ensureDatabaseOpen = function(onOpen) { openRequest.onerror = function(event) { // Try to delete the old database so that we can start this process over // next time. - indexedDB.deleteDatabase(gDatabaseName); + indexedDB.deleteDatabase(kDatabaseName); invokeCallbacks(new Error("Error while opening database: " + event.target.errorCode)); }; @@ -111,29 +109,6 @@ const ensureDatabaseOpen = function(onOpen) { }; }; -/** - * Switch to a database with a different name by closing the current connection - * and making sure that the next connection attempt will be made using the updated - * name. - * - * @param {String} name New name of the database to switch to. - */ -const switchDatabase = function(name) { - if (name == gDatabaseName) { - // This is already the current database, so there's no need to switch. - return; - } - - gDatabaseName = name; - if (gDatabase) { - try { - gDatabase.close(); - } finally { - gDatabase = null; - } - } -}; - /** * Start a transaction on the loop database and return it. * @@ -204,13 +179,6 @@ const getStore = function(store, callback, mode) { * database is loaded in memory and consumers will be able to change its structure. */ this.LoopStorage = Object.freeze({ - /** - * @var {String} databaseName The name of the database that is currently active. - */ - get databaseName() { - return gDatabaseName; - }, - /** * Open a connection to the IndexedDB database and return the database object. * @@ -223,16 +191,6 @@ this.LoopStorage = Object.freeze({ ensureDatabaseOpen(callback); }, - /** - * Switch to a database with a different name. - * - * @param {String} name New name of the database to switch to. Defaults to - * `kDefaultDatabaseName` - */ - switchDatabase: function(name = kDefaultDatabaseName) { - switchDatabase(name); - }, - /** * Start a transaction on the loop database and return it. * If only two arguments are passed, the default mode will be assumed and the diff --git a/browser/components/loop/MozLoopService.jsm b/browser/components/loop/MozLoopService.jsm index e940de6375f0..8d97febf8221 100644 --- a/browser/components/loop/MozLoopService.jsm +++ b/browser/components/loop/MozLoopService.jsm @@ -56,9 +56,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "HawkClient", XPCOMUtils.defineLazyModuleGetter(this, "deriveHawkCredentials", "resource://services-common/hawkrequest.js"); -XPCOMUtils.defineLazyModuleGetter(this, "LoopStorage", - "resource:///modules/loop/LoopStorage.jsm"); - XPCOMUtils.defineLazyModuleGetter(this, "MozLoopPushHandler", "resource:///modules/loop/MozLoopPushHandler.jsm"); @@ -370,7 +367,6 @@ let MozLoopServiceInternal = { notifyStatusChanged: function(aReason = null) { log.debug("notifyStatusChanged with reason:", aReason); - LoopStorage.switchDatabase(gFxAOAuthProfile ? gFxAOAuthProfile.uid : null); Services.obs.notifyObservers(null, "loop-status-changed", aReason); }, diff --git a/browser/components/loop/content/js/contacts.js b/browser/components/loop/content/js/contacts.js index 4dba2cf07691..96ced18d13fa 100644 --- a/browser/components/loop/content/js/contacts.js +++ b/browser/components/loop/content/js/contacts.js @@ -153,14 +153,14 @@ loop.contacts = (function(_, mozL10n) { document.body.removeEventListener("click", this._onBodyClick); }, - shouldComponentUpdate: function(nextProps, nextState) { + componentShouldUpdate: function(nextProps, nextState) { let currContact = this.props.contact; let nextContact = nextProps.contact; return ( currContact.name[0] !== nextContact.name[0] || currContact.blocked !== nextContact.blocked || - getPreferredEmail(currContact).value !== getPreferredEmail(nextContact).value || - nextState.showMenu !== this.state.showMenu + getPreferredEmail(currContact).value !== + getPreferredEmail(nextContact).value ); }, @@ -215,32 +215,20 @@ loop.contacts = (function(_, mozL10n) { const ContactsList = React.createClass({displayName: 'ContactsList', mixins: [React.addons.LinkedStateMixin], - /** - * Contacts collection object - */ - contacts: null, - - /** - * User profile - */ - _userProfile: null, - getInitialState: function() { return { + contacts: {}, importBusy: false, filter: "", }; }, - refresh: function(callback = function() {}) { + componentDidMount: function() { let contactsAPI = navigator.mozLoop.contacts; - this.handleContactRemoveAll(); - contactsAPI.getAll((err, contacts) => { if (err) { - callback(err); - return; + throw err; } // Add contacts already present in the DB. We do this in timed chunks to @@ -251,32 +239,11 @@ loop.contacts = (function(_, mozL10n) { }); if (contacts.length) { setTimeout(addContactsInChunks, 0); - } else { - callback(); } this.forceUpdate(); }; addContactsInChunks(contacts); - }); - }, - - componentWillMount: function() { - // Take the time to initialize class variables that are used outside - // `this.state`. - this.contacts = {}; - this._userProfile = navigator.mozLoop.userProfile; - }, - - componentDidMount: function() { - window.addEventListener("LoopStatusChanged", this._onStatusChanged); - - this.refresh(err => { - if (err) { - throw err; - } - - let contactsAPI = navigator.mozLoop.contacts; // Listen for contact changes/ updates. contactsAPI.on("add", (eventName, contact) => { @@ -294,24 +261,8 @@ loop.contacts = (function(_, mozL10n) { }); }, - componentWillUnmount: function() { - window.removeEventListener("LoopStatusChanged", this._onStatusChanged); - }, - - _onStatusChanged: function() { - let profile = navigator.mozLoop.userProfile; - let currUid = this._userProfile ? this._userProfile.uid : null; - let newUid = profile ? profile.uid : null; - if (currUid != newUid) { - // On profile change (login, logout), reload all contacts. - this._userProfile = profile; - // The following will do a forceUpdate() for us. - this.refresh(); - } - }, - handleContactAddOrUpdate: function(contact, render = true) { - let contacts = this.contacts; + let contacts = this.state.contacts; let guid = String(contact._guid); contacts[guid] = contact; if (render) { @@ -320,7 +271,7 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemove: function(contact) { - let contacts = this.contacts; + let contacts = this.state.contacts; let guid = String(contact._guid); if (!contacts[guid]) { return; @@ -330,9 +281,7 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemoveAll: function() { - // Do not allow any race conditions when removing all contacts. - this.contacts = {}; - this.forceUpdate(); + this.setState({contacts: {}}); }, handleImportButtonClick: function() { @@ -415,11 +364,11 @@ loop.contacts = (function(_, mozL10n) { handleContactAction: this.handleContactAction}) }; - let shownContacts = _.groupBy(this.contacts, function(contact) { + let shownContacts = _.groupBy(this.state.contacts, function(contact) { return contact.blocked ? "blocked" : "available"; }); - let showFilter = Object.getOwnPropertyNames(this.contacts).length >= + let showFilter = Object.getOwnPropertyNames(this.state.contacts).length >= MIN_CONTACTS_FOR_FILTERING; if (showFilter) { let filter = this.state.filter.trim().toLocaleLowerCase(); diff --git a/browser/components/loop/content/js/contacts.jsx b/browser/components/loop/content/js/contacts.jsx index 56dc27d995b9..127ce19dafda 100644 --- a/browser/components/loop/content/js/contacts.jsx +++ b/browser/components/loop/content/js/contacts.jsx @@ -153,14 +153,14 @@ loop.contacts = (function(_, mozL10n) { document.body.removeEventListener("click", this._onBodyClick); }, - shouldComponentUpdate: function(nextProps, nextState) { + componentShouldUpdate: function(nextProps, nextState) { let currContact = this.props.contact; let nextContact = nextProps.contact; return ( currContact.name[0] !== nextContact.name[0] || currContact.blocked !== nextContact.blocked || - getPreferredEmail(currContact).value !== getPreferredEmail(nextContact).value || - nextState.showMenu !== this.state.showMenu + getPreferredEmail(currContact).value !== + getPreferredEmail(nextContact).value ); }, @@ -215,32 +215,20 @@ loop.contacts = (function(_, mozL10n) { const ContactsList = React.createClass({ mixins: [React.addons.LinkedStateMixin], - /** - * Contacts collection object - */ - contacts: null, - - /** - * User profile - */ - _userProfile: null, - getInitialState: function() { return { + contacts: {}, importBusy: false, filter: "", }; }, - refresh: function(callback = function() {}) { + componentDidMount: function() { let contactsAPI = navigator.mozLoop.contacts; - this.handleContactRemoveAll(); - contactsAPI.getAll((err, contacts) => { if (err) { - callback(err); - return; + throw err; } // Add contacts already present in the DB. We do this in timed chunks to @@ -251,32 +239,11 @@ loop.contacts = (function(_, mozL10n) { }); if (contacts.length) { setTimeout(addContactsInChunks, 0); - } else { - callback(); } this.forceUpdate(); }; addContactsInChunks(contacts); - }); - }, - - componentWillMount: function() { - // Take the time to initialize class variables that are used outside - // `this.state`. - this.contacts = {}; - this._userProfile = navigator.mozLoop.userProfile; - }, - - componentDidMount: function() { - window.addEventListener("LoopStatusChanged", this._onStatusChanged); - - this.refresh(err => { - if (err) { - throw err; - } - - let contactsAPI = navigator.mozLoop.contacts; // Listen for contact changes/ updates. contactsAPI.on("add", (eventName, contact) => { @@ -294,24 +261,8 @@ loop.contacts = (function(_, mozL10n) { }); }, - componentWillUnmount: function() { - window.removeEventListener("LoopStatusChanged", this._onStatusChanged); - }, - - _onStatusChanged: function() { - let profile = navigator.mozLoop.userProfile; - let currUid = this._userProfile ? this._userProfile.uid : null; - let newUid = profile ? profile.uid : null; - if (currUid != newUid) { - // On profile change (login, logout), reload all contacts. - this._userProfile = profile; - // The following will do a forceUpdate() for us. - this.refresh(); - } - }, - handleContactAddOrUpdate: function(contact, render = true) { - let contacts = this.contacts; + let contacts = this.state.contacts; let guid = String(contact._guid); contacts[guid] = contact; if (render) { @@ -320,7 +271,7 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemove: function(contact) { - let contacts = this.contacts; + let contacts = this.state.contacts; let guid = String(contact._guid); if (!contacts[guid]) { return; @@ -330,9 +281,7 @@ loop.contacts = (function(_, mozL10n) { }, handleContactRemoveAll: function() { - // Do not allow any race conditions when removing all contacts. - this.contacts = {}; - this.forceUpdate(); + this.setState({contacts: {}}); }, handleImportButtonClick: function() { @@ -415,11 +364,11 @@ loop.contacts = (function(_, mozL10n) { handleContactAction={this.handleContactAction} /> }; - let shownContacts = _.groupBy(this.contacts, function(contact) { + let shownContacts = _.groupBy(this.state.contacts, function(contact) { return contact.blocked ? "blocked" : "available"; }); - let showFilter = Object.getOwnPropertyNames(this.contacts).length >= + let showFilter = Object.getOwnPropertyNames(this.state.contacts).length >= MIN_CONTACTS_FOR_FILTERING; if (showFilter) { let filter = this.state.filter.trim().toLocaleLowerCase(); diff --git a/browser/components/loop/content/js/panel.js b/browser/components/loop/content/js/panel.js index e32819d7cb3e..23ab5b4b5bf3 100644 --- a/browser/components/loop/content/js/panel.js +++ b/browser/components/loop/content/js/panel.js @@ -625,9 +625,7 @@ loop.panel = (function(_, mozL10n) { _onStatusChanged: function() { var profile = navigator.mozLoop.userProfile; - var currUid = this.state.userProfile ? this.state.userProfile.uid : null; - var newUid = profile ? profile.uid : null; - if (currUid != newUid) { + if (profile != this.state.userProfile) { // On profile change (login, logout), switch back to the default tab. this.selectTab("call"); } diff --git a/browser/components/loop/content/js/panel.jsx b/browser/components/loop/content/js/panel.jsx index 28823439c5f8..3fe901b6e450 100644 --- a/browser/components/loop/content/js/panel.jsx +++ b/browser/components/loop/content/js/panel.jsx @@ -625,9 +625,7 @@ loop.panel = (function(_, mozL10n) { _onStatusChanged: function() { var profile = navigator.mozLoop.userProfile; - var currUid = this.state.userProfile ? this.state.userProfile.uid : null; - var newUid = profile ? profile.uid : null; - if (currUid != newUid) { + if (profile != this.state.userProfile) { // On profile change (login, logout), switch back to the default tab. this.selectTab("call"); } diff --git a/browser/components/loop/test/mochitest/browser_LoopContacts.js b/browser/components/loop/test/mochitest/browser_LoopContacts.js index 380cd0808c95..7e52b80aeba8 100644 --- a/browser/components/loop/test/mochitest/browser_LoopContacts.js +++ b/browser/components/loop/test/mochitest/browser_LoopContacts.js @@ -2,11 +2,6 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ const {LoopContacts} = Cu.import("resource:///modules/loop/LoopContacts.jsm", {}); -const {LoopStorage} = Cu.import("resource:///modules/loop/LoopStorage.jsm", {}); - -XPCOMUtils.defineLazyServiceGetter(this, "uuidgen", - "@mozilla.org/uuid-generator;1", - "nsIUUIDGenerator"); const kContacts = [{ id: 1, @@ -405,31 +400,3 @@ add_task(function* () { Assert.strictEqual(gExpectedRemovals.length, 0, "No contact removals should be expected anymore"); Assert.strictEqual(gExpectedUpdates.length, 0, "No contact updates should be expected anymore"); }); - -// Test switching between different databases. -add_task(function* () { - Assert.equal(LoopStorage.databaseName, "loop-default", "First active partition should be the default"); - yield promiseLoadContacts(); - - let uuid = uuidgen.generateUUID().toString().replace(/[{}]+/g, ""); - LoopStorage.switchDatabase(uuid); - Assert.equal(LoopStorage.databaseName, uuid, "The active partition should have changed"); - - yield promiseLoadContacts(); - - let contacts = yield promiseLoadContacts(); - for (let i = 0, l = contacts.length; i < l; ++i) { - compareContacts(contacts[i], kContacts[i]); - } - - LoopStorage.switchDatabase(); - Assert.equal(LoopStorage.databaseName, "loop-default", "The active partition should have changed"); - - LoopContacts.getAll(function(err, contacts) { - Assert.equal(err, null, "There shouldn't be an error"); - - for (let i = 0, l = contacts.length; i < l; ++i) { - compareContacts(contacts[i], kContacts[i]); - } - }); -}); From bb02e2d8cfcfce4e74e7f0da099b77930ca83520 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 8 Oct 2014 21:07:41 -0700 Subject: [PATCH 74/79] Bug 1080326 - Move Search Activity resources and stop building org.mozilla.search.R. r=rnewman Since we no longer build the Search Activity stand-alone, we don't need the complication of the extra search-only resources package. Without the stand-alone build and repository, the probability of search resources being added to the Fennec resources (or being used in both places) approaches 1, so lets protect against that. --HG-- rename : mobile/android/search/res/color/facet_button_text_color.xml => mobile/android/base/resources/color/facet_button_text_color.xml rename : mobile/android/search/res/drawable-hdpi/ic_action_settings.png => mobile/android/base/resources/drawable-hdpi/ic_action_settings.png rename : mobile/android/search/res/drawable-hdpi/ic_widget_new_tab.png => mobile/android/base/resources/drawable-hdpi/ic_widget_new_tab.png rename : mobile/android/search/res/drawable-hdpi/ic_widget_search.png => mobile/android/base/resources/drawable-hdpi/ic_widget_search.png rename : mobile/android/search/res/drawable-hdpi/network_error.png => mobile/android/base/resources/drawable-hdpi/network_error.png rename : mobile/android/search/res/drawable-hdpi/search_clear.png => mobile/android/base/resources/drawable-hdpi/search_clear.png rename : mobile/android/search/res/drawable-hdpi/search_fox.png => mobile/android/base/resources/drawable-hdpi/search_fox.png rename : mobile/android/search/res/drawable-hdpi/search_history.png => mobile/android/base/resources/drawable-hdpi/search_history.png rename : mobile/android/search/res/drawable-hdpi/search_icon_active.png => mobile/android/base/resources/drawable-hdpi/search_icon_active.png rename : mobile/android/search/res/drawable-hdpi/search_icon_inactive.png => mobile/android/base/resources/drawable-hdpi/search_icon_inactive.png rename : mobile/android/search/res/drawable-hdpi/search_launcher.png => mobile/android/base/resources/drawable-hdpi/search_launcher.png rename : mobile/android/search/res/drawable-hdpi/search_plus.png => mobile/android/base/resources/drawable-hdpi/search_plus.png rename : mobile/android/search/res/drawable-hdpi/widget_bg.9.png => mobile/android/base/resources/drawable-hdpi/widget_bg.9.png rename : mobile/android/search/res/drawable-mdpi/ic_action_settings.png => mobile/android/base/resources/drawable-mdpi/ic_action_settings.png rename : mobile/android/search/res/drawable-mdpi/ic_widget_new_tab.png => mobile/android/base/resources/drawable-mdpi/ic_widget_new_tab.png rename : mobile/android/search/res/drawable-mdpi/ic_widget_search.png => mobile/android/base/resources/drawable-mdpi/ic_widget_search.png rename : mobile/android/search/res/drawable-mdpi/network_error.png => mobile/android/base/resources/drawable-mdpi/network_error.png rename : mobile/android/search/res/drawable-mdpi/search_clear.png => mobile/android/base/resources/drawable-mdpi/search_clear.png rename : mobile/android/search/res/drawable-mdpi/search_fox.png => mobile/android/base/resources/drawable-mdpi/search_fox.png rename : mobile/android/search/res/drawable-mdpi/search_history.png => mobile/android/base/resources/drawable-mdpi/search_history.png rename : mobile/android/search/res/drawable-mdpi/search_icon_active.png => mobile/android/base/resources/drawable-mdpi/search_icon_active.png rename : mobile/android/search/res/drawable-mdpi/search_icon_inactive.png => mobile/android/base/resources/drawable-mdpi/search_icon_inactive.png rename : mobile/android/search/res/drawable-mdpi/search_launcher.png => mobile/android/base/resources/drawable-mdpi/search_launcher.png rename : mobile/android/search/res/drawable-mdpi/search_plus.png => mobile/android/base/resources/drawable-mdpi/search_plus.png rename : mobile/android/search/res/drawable-mdpi/widget_bg.9.png => mobile/android/base/resources/drawable-mdpi/widget_bg.9.png rename : mobile/android/search/res/drawable-xhdpi/ic_action_settings.png => mobile/android/base/resources/drawable-xhdpi/ic_action_settings.png rename : mobile/android/search/res/drawable-xhdpi/ic_widget_new_tab.png => mobile/android/base/resources/drawable-xhdpi/ic_widget_new_tab.png rename : mobile/android/search/res/drawable-xhdpi/ic_widget_search.png => mobile/android/base/resources/drawable-xhdpi/ic_widget_search.png rename : mobile/android/search/res/drawable-xhdpi/network_error.png => mobile/android/base/resources/drawable-xhdpi/network_error.png rename : mobile/android/search/res/drawable-xhdpi/search_clear.png => mobile/android/base/resources/drawable-xhdpi/search_clear.png rename : mobile/android/search/res/drawable-xhdpi/search_fox.png => mobile/android/base/resources/drawable-xhdpi/search_fox.png rename : mobile/android/search/res/drawable-xhdpi/search_history.png => mobile/android/base/resources/drawable-xhdpi/search_history.png rename : mobile/android/search/res/drawable-xhdpi/search_icon_active.png => mobile/android/base/resources/drawable-xhdpi/search_icon_active.png rename : mobile/android/search/res/drawable-xhdpi/search_icon_inactive.png => mobile/android/base/resources/drawable-xhdpi/search_icon_inactive.png rename : mobile/android/search/res/drawable-xhdpi/search_launcher.png => mobile/android/base/resources/drawable-xhdpi/search_launcher.png rename : mobile/android/search/res/drawable-xhdpi/search_plus.png => mobile/android/base/resources/drawable-xhdpi/search_plus.png rename : mobile/android/search/res/drawable-xhdpi/widget_bg.9.png => mobile/android/base/resources/drawable-xhdpi/widget_bg.9.png rename : mobile/android/search/res/drawable-xxhdpi/ic_action_settings.png => mobile/android/base/resources/drawable-xxhdpi/ic_action_settings.png rename : mobile/android/search/res/drawable-xxhdpi/ic_widget_new_tab.png => mobile/android/base/resources/drawable-xxhdpi/ic_widget_new_tab.png rename : mobile/android/search/res/drawable-xxhdpi/ic_widget_search.png => mobile/android/base/resources/drawable-xxhdpi/ic_widget_search.png rename : mobile/android/search/res/drawable-xxhdpi/network_error.png => mobile/android/base/resources/drawable-xxhdpi/network_error.png rename : mobile/android/search/res/drawable-xxhdpi/search_clear.png => mobile/android/base/resources/drawable-xxhdpi/search_clear.png rename : mobile/android/search/res/drawable-xxhdpi/search_fox.png => mobile/android/base/resources/drawable-xxhdpi/search_fox.png rename : mobile/android/search/res/drawable-xxhdpi/search_history.png => mobile/android/base/resources/drawable-xxhdpi/search_history.png rename : mobile/android/search/res/drawable-xxhdpi/search_icon_active.png => mobile/android/base/resources/drawable-xxhdpi/search_icon_active.png rename : mobile/android/search/res/drawable-xxhdpi/search_icon_inactive.png => mobile/android/base/resources/drawable-xxhdpi/search_icon_inactive.png rename : mobile/android/search/res/drawable-xxhdpi/search_launcher.png => mobile/android/base/resources/drawable-xxhdpi/search_launcher.png rename : mobile/android/search/res/drawable-xxhdpi/search_plus.png => mobile/android/base/resources/drawable-xxhdpi/search_plus.png rename : mobile/android/search/res/drawable-xxxhdpi/search_launcher.png => mobile/android/base/resources/drawable-xxxhdpi/search_launcher.png rename : mobile/android/search/res/drawable/edit_text_default.xml => mobile/android/base/resources/drawable/edit_text_default.xml rename : mobile/android/search/res/drawable/edit_text_focused.xml => mobile/android/base/resources/drawable/edit_text_focused.xml rename : mobile/android/search/res/drawable/facet_button_background.xml => mobile/android/base/resources/drawable/facet_button_background.xml rename : mobile/android/search/res/drawable/facet_button_background_default.xml => mobile/android/base/resources/drawable/facet_button_background_default.xml rename : mobile/android/search/res/drawable/facet_button_background_pressed.xml => mobile/android/base/resources/drawable/facet_button_background_pressed.xml rename : mobile/android/search/res/drawable/progressbar.xml => mobile/android/base/resources/drawable/progressbar.xml rename : mobile/android/search/res/drawable/search_row_background.xml => mobile/android/base/resources/drawable/search_row_background.xml rename : mobile/android/search/res/drawable/widget_button_left.xml => mobile/android/base/resources/drawable/widget_button_left.xml rename : mobile/android/search/res/drawable/widget_button_left_default.xml => mobile/android/base/resources/drawable/widget_button_left_default.xml rename : mobile/android/search/res/drawable/widget_button_left_pressed.xml => mobile/android/base/resources/drawable/widget_button_left_pressed.xml rename : mobile/android/search/res/drawable/widget_button_middle.xml => mobile/android/base/resources/drawable/widget_button_middle.xml rename : mobile/android/search/res/drawable/widget_button_middle_pressed.xml => mobile/android/base/resources/drawable/widget_button_middle_pressed.xml rename : mobile/android/search/res/drawable/widget_button_right.xml => mobile/android/base/resources/drawable/widget_button_right.xml rename : mobile/android/search/res/drawable/widget_button_right_pressed.xml => mobile/android/base/resources/drawable/widget_button_right_pressed.xml rename : mobile/android/search/res/layout/keyguard_widget.xml => mobile/android/base/resources/layout/keyguard_widget.xml rename : mobile/android/search/res/layout/search_activity_main.xml => mobile/android/base/resources/layout/search_activity_main.xml rename : mobile/android/search/res/layout/search_bar.xml => mobile/android/base/resources/layout/search_bar.xml rename : mobile/android/search/res/layout/search_empty.xml => mobile/android/base/resources/layout/search_empty.xml rename : mobile/android/search/res/layout/search_fragment_post_search.xml => mobile/android/base/resources/layout/search_fragment_post_search.xml rename : mobile/android/search/res/layout/search_fragment_pre_search.xml => mobile/android/base/resources/layout/search_fragment_pre_search.xml rename : mobile/android/search/res/layout/search_history_row.xml => mobile/android/base/resources/layout/search_history_row.xml rename : mobile/android/search/res/layout/search_sugestions.xml => mobile/android/base/resources/layout/search_sugestions.xml rename : mobile/android/search/res/layout/search_suggestions_row.xml => mobile/android/base/resources/layout/search_suggestions_row.xml rename : mobile/android/search/res/layout/search_widget.xml => mobile/android/base/resources/layout/search_widget.xml rename : mobile/android/search/res/values-v13/search_styles.xml => mobile/android/base/resources/values-v13/search_styles.xml rename : mobile/android/search/res/values-v16/search_styles.xml => mobile/android/base/resources/values-v16/search_styles.xml rename : mobile/android/search/res/values/search_attrs.xml => mobile/android/base/resources/values/search_attrs.xml rename : mobile/android/search/res/values/search_colors.xml => mobile/android/base/resources/values/search_colors.xml rename : mobile/android/search/res/values/search_dimens.xml => mobile/android/base/resources/values/search_dimens.xml rename : mobile/android/search/res/values/search_styles.xml => mobile/android/base/resources/values/search_styles.xml rename : mobile/android/search/res/xml/search_preferences.xml => mobile/android/base/resources/xml/search_preferences.xml rename : mobile/android/search/res/xml/search_widget_info.xml => mobile/android/base/resources/xml/search_widget_info.xml --- mobile/android/base/Makefile.in | 2 -- mobile/android/base/moz.build | 15 ------------ .../color/facet_button_text_color.xml | 0 .../drawable-hdpi/ic_action_settings.png | Bin .../drawable-hdpi/ic_widget_new_tab.png | Bin .../drawable-hdpi/ic_widget_search.png | Bin .../drawable-hdpi/network_error.png | Bin .../resources}/drawable-hdpi/search_clear.png | Bin .../resources}/drawable-hdpi/search_fox.png | Bin .../drawable-hdpi/search_history.png | Bin .../drawable-hdpi/search_icon_active.png | Bin .../drawable-hdpi/search_icon_inactive.png | Bin .../drawable-hdpi/search_launcher.png | Bin .../resources}/drawable-hdpi/search_plus.png | Bin .../resources}/drawable-hdpi/widget_bg.9.png | Bin .../drawable-mdpi/ic_action_settings.png | Bin .../drawable-mdpi/ic_widget_new_tab.png | Bin .../drawable-mdpi/ic_widget_search.png | Bin .../drawable-mdpi/network_error.png | Bin .../resources}/drawable-mdpi/search_clear.png | Bin .../resources}/drawable-mdpi/search_fox.png | Bin .../drawable-mdpi/search_history.png | Bin .../drawable-mdpi/search_icon_active.png | Bin .../drawable-mdpi/search_icon_inactive.png | Bin .../drawable-mdpi/search_launcher.png | Bin .../resources}/drawable-mdpi/search_plus.png | Bin .../resources}/drawable-mdpi/widget_bg.9.png | Bin .../drawable-xhdpi/ic_action_settings.png | Bin .../drawable-xhdpi/ic_widget_new_tab.png | Bin .../drawable-xhdpi/ic_widget_search.png | Bin .../drawable-xhdpi/network_error.png | Bin .../drawable-xhdpi/search_clear.png | Bin .../resources}/drawable-xhdpi/search_fox.png | Bin .../drawable-xhdpi/search_history.png | Bin .../drawable-xhdpi/search_icon_active.png | Bin .../drawable-xhdpi/search_icon_inactive.png | Bin .../drawable-xhdpi/search_launcher.png | Bin .../resources}/drawable-xhdpi/search_plus.png | Bin .../resources}/drawable-xhdpi/widget_bg.9.png | Bin .../drawable-xxhdpi/ic_action_settings.png | Bin .../drawable-xxhdpi/ic_widget_new_tab.png | Bin .../drawable-xxhdpi/ic_widget_search.png | Bin .../drawable-xxhdpi/network_error.png | Bin .../drawable-xxhdpi/search_clear.png | Bin .../resources}/drawable-xxhdpi/search_fox.png | Bin .../drawable-xxhdpi/search_history.png | Bin .../drawable-xxhdpi/search_icon_active.png | Bin .../drawable-xxhdpi/search_icon_inactive.png | Bin .../drawable-xxhdpi/search_launcher.png | Bin .../drawable-xxhdpi/search_plus.png | Bin .../drawable-xxxhdpi/search_launcher.png | Bin .../resources}/drawable/edit_text_default.xml | 0 .../resources}/drawable/edit_text_focused.xml | 0 .../drawable/facet_button_background.xml | 0 .../facet_button_background_default.xml | 0 .../facet_button_background_pressed.xml | 0 .../resources}/drawable/progressbar.xml | 0 .../drawable/search_row_background.xml | 0 .../drawable/widget_button_left.xml | 0 .../drawable/widget_button_left_default.xml | 0 .../drawable/widget_button_left_pressed.xml | 0 .../drawable/widget_button_middle.xml | 0 .../drawable/widget_button_middle_pressed.xml | 0 .../drawable/widget_button_right.xml | 0 .../drawable/widget_button_right_pressed.xml | 0 .../resources}/layout/keyguard_widget.xml | 0 .../layout/search_activity_main.xml | 0 .../resources}/layout/search_bar.xml | 0 .../resources}/layout/search_empty.xml | 0 .../layout/search_fragment_post_search.xml | 0 .../layout/search_fragment_pre_search.xml | 0 .../resources}/layout/search_history_row.xml | 0 .../resources}/layout/search_sugestions.xml | 0 .../layout/search_suggestions_row.xml | 0 .../resources}/layout/search_widget.xml | 0 .../resources}/values-v13/search_styles.xml | 0 .../resources}/values-v16/search_styles.xml | 0 .../resources}/values/search_attrs.xml | 0 .../resources}/values/search_colors.xml | 0 .../resources}/values/search_dimens.xml | 0 .../resources}/values/search_styles.xml | 0 .../resources}/xml/search_preferences.xml | 0 .../resources}/xml/search_widget_info.xml | 0 .../mozilla/search/PostSearchFragment.java | 16 ++++++------- .../org/mozilla/search/PreSearchFragment.java | 1 + .../org/mozilla/search/SearchActivity.java | 1 + .../search/SearchPreferenceActivity.java | 13 ++++++----- .../java/org/mozilla/search/SearchWidget.java | 1 + .../autocomplete/AutoCompleteAdapter.java | 12 +++++----- .../search/autocomplete/SearchBar.java | 12 +++++----- .../autocomplete/SuggestionsFragment.java | 22 +++++++++--------- .../java/org/mozilla/search/ui/FacetBar.java | 4 ++-- 92 files changed, 43 insertions(+), 56 deletions(-) rename mobile/android/{search/res => base/resources}/color/facet_button_text_color.xml (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/ic_action_settings.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/ic_widget_new_tab.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/ic_widget_search.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/network_error.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_clear.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_fox.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_history.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_icon_active.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_icon_inactive.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_launcher.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/search_plus.png (100%) rename mobile/android/{search/res => base/resources}/drawable-hdpi/widget_bg.9.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/ic_action_settings.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/ic_widget_new_tab.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/ic_widget_search.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/network_error.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_clear.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_fox.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_history.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_icon_active.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_icon_inactive.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_launcher.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/search_plus.png (100%) rename mobile/android/{search/res => base/resources}/drawable-mdpi/widget_bg.9.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/ic_action_settings.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/ic_widget_new_tab.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/ic_widget_search.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/network_error.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_clear.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_fox.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_history.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_icon_active.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_icon_inactive.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_launcher.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/search_plus.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xhdpi/widget_bg.9.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/ic_action_settings.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/ic_widget_new_tab.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/ic_widget_search.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/network_error.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_clear.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_fox.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_history.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_icon_active.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_icon_inactive.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_launcher.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxhdpi/search_plus.png (100%) rename mobile/android/{search/res => base/resources}/drawable-xxxhdpi/search_launcher.png (100%) rename mobile/android/{search/res => base/resources}/drawable/edit_text_default.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/edit_text_focused.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/facet_button_background.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/facet_button_background_default.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/facet_button_background_pressed.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/progressbar.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/search_row_background.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_left.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_left_default.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_left_pressed.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_middle.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_middle_pressed.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_right.xml (100%) rename mobile/android/{search/res => base/resources}/drawable/widget_button_right_pressed.xml (100%) rename mobile/android/{search/res => base/resources}/layout/keyguard_widget.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_activity_main.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_bar.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_empty.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_fragment_post_search.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_fragment_pre_search.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_history_row.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_sugestions.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_suggestions_row.xml (100%) rename mobile/android/{search/res => base/resources}/layout/search_widget.xml (100%) rename mobile/android/{search/res => base/resources}/values-v13/search_styles.xml (100%) rename mobile/android/{search/res => base/resources}/values-v16/search_styles.xml (100%) rename mobile/android/{search/res => base/resources}/values/search_attrs.xml (100%) rename mobile/android/{search/res => base/resources}/values/search_colors.xml (100%) rename mobile/android/{search/res => base/resources}/values/search_dimens.xml (100%) rename mobile/android/{search/res => base/resources}/values/search_styles.xml (100%) rename mobile/android/{search/res => base/resources}/xml/search_preferences.xml (100%) rename mobile/android/{search/res => base/resources}/xml/search_widget_info.xml (100%) diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index c096e44c2b64..cdeb7dcc2662 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -92,9 +92,7 @@ ALL_JARS += webrtc.jar endif ifdef MOZ_ANDROID_SEARCH_ACTIVITY -extra_packages += org.mozilla.search ALL_JARS += search-activity.jar -generated/org/mozilla/search/R.java: .aapt.deps ; endif ifdef MOZ_ANDROID_MLS_STUMBLER diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index 2077d9475da1..36dbb387254c 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -659,9 +659,6 @@ if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']: search_source_dir = SRCDIR + '/../search' include('../search/search_activity_sources.mozbuild') - ANDROID_RES_DIRS += [search_source_dir + '/res'] - resjar.generated_sources += ['org/mozilla/search/R.java'] - search_activity = add_java_jar('search-activity') search_activity.sources += [search_source_dir + '/' + f for f in search_activity_sources] search_activity.javac_flags += ['-Xlint:all'] @@ -831,17 +828,5 @@ if CONFIG['MOZ_ANDROID_MLS_STUMBLER']: DEFINES['MOZ_STUMBLER_API_KEY'] = CONFIG['MOZ_MOZILLA_API_KEY'] if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']: - searchres = add_android_eclipse_library_project('FennecResourcesSearch') - # Eclipse generates org.mozilla.search.R for this project, which is - # referenced by the search/**/*.java code. - searchres.package_name = 'org.mozilla.search' - searchres.res = SRCDIR + '/../search/res' - - searchres.included_projects += ['../' + static.name, '../' + generated.name, '../' + branding.name] - searchres.referenced_projects += ['../' + static.name, '../' + generated.name, '../' + branding.name] - - resources.included_projects += ['../' + searchres.name] - resources.referenced_projects += ['../' + searchres.name] - # The Search Activity code is built as part of Fennec, so we follow suit in Eclipse. main.add_classpathentry('search', TOPSRCDIR + '/mobile/android/search/java', dstdir='search') diff --git a/mobile/android/search/res/color/facet_button_text_color.xml b/mobile/android/base/resources/color/facet_button_text_color.xml similarity index 100% rename from mobile/android/search/res/color/facet_button_text_color.xml rename to mobile/android/base/resources/color/facet_button_text_color.xml diff --git a/mobile/android/search/res/drawable-hdpi/ic_action_settings.png b/mobile/android/base/resources/drawable-hdpi/ic_action_settings.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/ic_action_settings.png rename to mobile/android/base/resources/drawable-hdpi/ic_action_settings.png diff --git a/mobile/android/search/res/drawable-hdpi/ic_widget_new_tab.png b/mobile/android/base/resources/drawable-hdpi/ic_widget_new_tab.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/ic_widget_new_tab.png rename to mobile/android/base/resources/drawable-hdpi/ic_widget_new_tab.png diff --git a/mobile/android/search/res/drawable-hdpi/ic_widget_search.png b/mobile/android/base/resources/drawable-hdpi/ic_widget_search.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/ic_widget_search.png rename to mobile/android/base/resources/drawable-hdpi/ic_widget_search.png diff --git a/mobile/android/search/res/drawable-hdpi/network_error.png b/mobile/android/base/resources/drawable-hdpi/network_error.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/network_error.png rename to mobile/android/base/resources/drawable-hdpi/network_error.png diff --git a/mobile/android/search/res/drawable-hdpi/search_clear.png b/mobile/android/base/resources/drawable-hdpi/search_clear.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_clear.png rename to mobile/android/base/resources/drawable-hdpi/search_clear.png diff --git a/mobile/android/search/res/drawable-hdpi/search_fox.png b/mobile/android/base/resources/drawable-hdpi/search_fox.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_fox.png rename to mobile/android/base/resources/drawable-hdpi/search_fox.png diff --git a/mobile/android/search/res/drawable-hdpi/search_history.png b/mobile/android/base/resources/drawable-hdpi/search_history.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_history.png rename to mobile/android/base/resources/drawable-hdpi/search_history.png diff --git a/mobile/android/search/res/drawable-hdpi/search_icon_active.png b/mobile/android/base/resources/drawable-hdpi/search_icon_active.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_icon_active.png rename to mobile/android/base/resources/drawable-hdpi/search_icon_active.png diff --git a/mobile/android/search/res/drawable-hdpi/search_icon_inactive.png b/mobile/android/base/resources/drawable-hdpi/search_icon_inactive.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_icon_inactive.png rename to mobile/android/base/resources/drawable-hdpi/search_icon_inactive.png diff --git a/mobile/android/search/res/drawable-hdpi/search_launcher.png b/mobile/android/base/resources/drawable-hdpi/search_launcher.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_launcher.png rename to mobile/android/base/resources/drawable-hdpi/search_launcher.png diff --git a/mobile/android/search/res/drawable-hdpi/search_plus.png b/mobile/android/base/resources/drawable-hdpi/search_plus.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/search_plus.png rename to mobile/android/base/resources/drawable-hdpi/search_plus.png diff --git a/mobile/android/search/res/drawable-hdpi/widget_bg.9.png b/mobile/android/base/resources/drawable-hdpi/widget_bg.9.png similarity index 100% rename from mobile/android/search/res/drawable-hdpi/widget_bg.9.png rename to mobile/android/base/resources/drawable-hdpi/widget_bg.9.png diff --git a/mobile/android/search/res/drawable-mdpi/ic_action_settings.png b/mobile/android/base/resources/drawable-mdpi/ic_action_settings.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/ic_action_settings.png rename to mobile/android/base/resources/drawable-mdpi/ic_action_settings.png diff --git a/mobile/android/search/res/drawable-mdpi/ic_widget_new_tab.png b/mobile/android/base/resources/drawable-mdpi/ic_widget_new_tab.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/ic_widget_new_tab.png rename to mobile/android/base/resources/drawable-mdpi/ic_widget_new_tab.png diff --git a/mobile/android/search/res/drawable-mdpi/ic_widget_search.png b/mobile/android/base/resources/drawable-mdpi/ic_widget_search.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/ic_widget_search.png rename to mobile/android/base/resources/drawable-mdpi/ic_widget_search.png diff --git a/mobile/android/search/res/drawable-mdpi/network_error.png b/mobile/android/base/resources/drawable-mdpi/network_error.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/network_error.png rename to mobile/android/base/resources/drawable-mdpi/network_error.png diff --git a/mobile/android/search/res/drawable-mdpi/search_clear.png b/mobile/android/base/resources/drawable-mdpi/search_clear.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_clear.png rename to mobile/android/base/resources/drawable-mdpi/search_clear.png diff --git a/mobile/android/search/res/drawable-mdpi/search_fox.png b/mobile/android/base/resources/drawable-mdpi/search_fox.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_fox.png rename to mobile/android/base/resources/drawable-mdpi/search_fox.png diff --git a/mobile/android/search/res/drawable-mdpi/search_history.png b/mobile/android/base/resources/drawable-mdpi/search_history.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_history.png rename to mobile/android/base/resources/drawable-mdpi/search_history.png diff --git a/mobile/android/search/res/drawable-mdpi/search_icon_active.png b/mobile/android/base/resources/drawable-mdpi/search_icon_active.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_icon_active.png rename to mobile/android/base/resources/drawable-mdpi/search_icon_active.png diff --git a/mobile/android/search/res/drawable-mdpi/search_icon_inactive.png b/mobile/android/base/resources/drawable-mdpi/search_icon_inactive.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_icon_inactive.png rename to mobile/android/base/resources/drawable-mdpi/search_icon_inactive.png diff --git a/mobile/android/search/res/drawable-mdpi/search_launcher.png b/mobile/android/base/resources/drawable-mdpi/search_launcher.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_launcher.png rename to mobile/android/base/resources/drawable-mdpi/search_launcher.png diff --git a/mobile/android/search/res/drawable-mdpi/search_plus.png b/mobile/android/base/resources/drawable-mdpi/search_plus.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/search_plus.png rename to mobile/android/base/resources/drawable-mdpi/search_plus.png diff --git a/mobile/android/search/res/drawable-mdpi/widget_bg.9.png b/mobile/android/base/resources/drawable-mdpi/widget_bg.9.png similarity index 100% rename from mobile/android/search/res/drawable-mdpi/widget_bg.9.png rename to mobile/android/base/resources/drawable-mdpi/widget_bg.9.png diff --git a/mobile/android/search/res/drawable-xhdpi/ic_action_settings.png b/mobile/android/base/resources/drawable-xhdpi/ic_action_settings.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/ic_action_settings.png rename to mobile/android/base/resources/drawable-xhdpi/ic_action_settings.png diff --git a/mobile/android/search/res/drawable-xhdpi/ic_widget_new_tab.png b/mobile/android/base/resources/drawable-xhdpi/ic_widget_new_tab.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/ic_widget_new_tab.png rename to mobile/android/base/resources/drawable-xhdpi/ic_widget_new_tab.png diff --git a/mobile/android/search/res/drawable-xhdpi/ic_widget_search.png b/mobile/android/base/resources/drawable-xhdpi/ic_widget_search.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/ic_widget_search.png rename to mobile/android/base/resources/drawable-xhdpi/ic_widget_search.png diff --git a/mobile/android/search/res/drawable-xhdpi/network_error.png b/mobile/android/base/resources/drawable-xhdpi/network_error.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/network_error.png rename to mobile/android/base/resources/drawable-xhdpi/network_error.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_clear.png b/mobile/android/base/resources/drawable-xhdpi/search_clear.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_clear.png rename to mobile/android/base/resources/drawable-xhdpi/search_clear.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_fox.png b/mobile/android/base/resources/drawable-xhdpi/search_fox.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_fox.png rename to mobile/android/base/resources/drawable-xhdpi/search_fox.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_history.png b/mobile/android/base/resources/drawable-xhdpi/search_history.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_history.png rename to mobile/android/base/resources/drawable-xhdpi/search_history.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_icon_active.png b/mobile/android/base/resources/drawable-xhdpi/search_icon_active.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_icon_active.png rename to mobile/android/base/resources/drawable-xhdpi/search_icon_active.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_icon_inactive.png b/mobile/android/base/resources/drawable-xhdpi/search_icon_inactive.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_icon_inactive.png rename to mobile/android/base/resources/drawable-xhdpi/search_icon_inactive.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_launcher.png b/mobile/android/base/resources/drawable-xhdpi/search_launcher.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_launcher.png rename to mobile/android/base/resources/drawable-xhdpi/search_launcher.png diff --git a/mobile/android/search/res/drawable-xhdpi/search_plus.png b/mobile/android/base/resources/drawable-xhdpi/search_plus.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/search_plus.png rename to mobile/android/base/resources/drawable-xhdpi/search_plus.png diff --git a/mobile/android/search/res/drawable-xhdpi/widget_bg.9.png b/mobile/android/base/resources/drawable-xhdpi/widget_bg.9.png similarity index 100% rename from mobile/android/search/res/drawable-xhdpi/widget_bg.9.png rename to mobile/android/base/resources/drawable-xhdpi/widget_bg.9.png diff --git a/mobile/android/search/res/drawable-xxhdpi/ic_action_settings.png b/mobile/android/base/resources/drawable-xxhdpi/ic_action_settings.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/ic_action_settings.png rename to mobile/android/base/resources/drawable-xxhdpi/ic_action_settings.png diff --git a/mobile/android/search/res/drawable-xxhdpi/ic_widget_new_tab.png b/mobile/android/base/resources/drawable-xxhdpi/ic_widget_new_tab.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/ic_widget_new_tab.png rename to mobile/android/base/resources/drawable-xxhdpi/ic_widget_new_tab.png diff --git a/mobile/android/search/res/drawable-xxhdpi/ic_widget_search.png b/mobile/android/base/resources/drawable-xxhdpi/ic_widget_search.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/ic_widget_search.png rename to mobile/android/base/resources/drawable-xxhdpi/ic_widget_search.png diff --git a/mobile/android/search/res/drawable-xxhdpi/network_error.png b/mobile/android/base/resources/drawable-xxhdpi/network_error.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/network_error.png rename to mobile/android/base/resources/drawable-xxhdpi/network_error.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_clear.png b/mobile/android/base/resources/drawable-xxhdpi/search_clear.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_clear.png rename to mobile/android/base/resources/drawable-xxhdpi/search_clear.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_fox.png b/mobile/android/base/resources/drawable-xxhdpi/search_fox.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_fox.png rename to mobile/android/base/resources/drawable-xxhdpi/search_fox.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_history.png b/mobile/android/base/resources/drawable-xxhdpi/search_history.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_history.png rename to mobile/android/base/resources/drawable-xxhdpi/search_history.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_icon_active.png b/mobile/android/base/resources/drawable-xxhdpi/search_icon_active.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_icon_active.png rename to mobile/android/base/resources/drawable-xxhdpi/search_icon_active.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_icon_inactive.png b/mobile/android/base/resources/drawable-xxhdpi/search_icon_inactive.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_icon_inactive.png rename to mobile/android/base/resources/drawable-xxhdpi/search_icon_inactive.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_launcher.png b/mobile/android/base/resources/drawable-xxhdpi/search_launcher.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_launcher.png rename to mobile/android/base/resources/drawable-xxhdpi/search_launcher.png diff --git a/mobile/android/search/res/drawable-xxhdpi/search_plus.png b/mobile/android/base/resources/drawable-xxhdpi/search_plus.png similarity index 100% rename from mobile/android/search/res/drawable-xxhdpi/search_plus.png rename to mobile/android/base/resources/drawable-xxhdpi/search_plus.png diff --git a/mobile/android/search/res/drawable-xxxhdpi/search_launcher.png b/mobile/android/base/resources/drawable-xxxhdpi/search_launcher.png similarity index 100% rename from mobile/android/search/res/drawable-xxxhdpi/search_launcher.png rename to mobile/android/base/resources/drawable-xxxhdpi/search_launcher.png diff --git a/mobile/android/search/res/drawable/edit_text_default.xml b/mobile/android/base/resources/drawable/edit_text_default.xml similarity index 100% rename from mobile/android/search/res/drawable/edit_text_default.xml rename to mobile/android/base/resources/drawable/edit_text_default.xml diff --git a/mobile/android/search/res/drawable/edit_text_focused.xml b/mobile/android/base/resources/drawable/edit_text_focused.xml similarity index 100% rename from mobile/android/search/res/drawable/edit_text_focused.xml rename to mobile/android/base/resources/drawable/edit_text_focused.xml diff --git a/mobile/android/search/res/drawable/facet_button_background.xml b/mobile/android/base/resources/drawable/facet_button_background.xml similarity index 100% rename from mobile/android/search/res/drawable/facet_button_background.xml rename to mobile/android/base/resources/drawable/facet_button_background.xml diff --git a/mobile/android/search/res/drawable/facet_button_background_default.xml b/mobile/android/base/resources/drawable/facet_button_background_default.xml similarity index 100% rename from mobile/android/search/res/drawable/facet_button_background_default.xml rename to mobile/android/base/resources/drawable/facet_button_background_default.xml diff --git a/mobile/android/search/res/drawable/facet_button_background_pressed.xml b/mobile/android/base/resources/drawable/facet_button_background_pressed.xml similarity index 100% rename from mobile/android/search/res/drawable/facet_button_background_pressed.xml rename to mobile/android/base/resources/drawable/facet_button_background_pressed.xml diff --git a/mobile/android/search/res/drawable/progressbar.xml b/mobile/android/base/resources/drawable/progressbar.xml similarity index 100% rename from mobile/android/search/res/drawable/progressbar.xml rename to mobile/android/base/resources/drawable/progressbar.xml diff --git a/mobile/android/search/res/drawable/search_row_background.xml b/mobile/android/base/resources/drawable/search_row_background.xml similarity index 100% rename from mobile/android/search/res/drawable/search_row_background.xml rename to mobile/android/base/resources/drawable/search_row_background.xml diff --git a/mobile/android/search/res/drawable/widget_button_left.xml b/mobile/android/base/resources/drawable/widget_button_left.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_left.xml rename to mobile/android/base/resources/drawable/widget_button_left.xml diff --git a/mobile/android/search/res/drawable/widget_button_left_default.xml b/mobile/android/base/resources/drawable/widget_button_left_default.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_left_default.xml rename to mobile/android/base/resources/drawable/widget_button_left_default.xml diff --git a/mobile/android/search/res/drawable/widget_button_left_pressed.xml b/mobile/android/base/resources/drawable/widget_button_left_pressed.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_left_pressed.xml rename to mobile/android/base/resources/drawable/widget_button_left_pressed.xml diff --git a/mobile/android/search/res/drawable/widget_button_middle.xml b/mobile/android/base/resources/drawable/widget_button_middle.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_middle.xml rename to mobile/android/base/resources/drawable/widget_button_middle.xml diff --git a/mobile/android/search/res/drawable/widget_button_middle_pressed.xml b/mobile/android/base/resources/drawable/widget_button_middle_pressed.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_middle_pressed.xml rename to mobile/android/base/resources/drawable/widget_button_middle_pressed.xml diff --git a/mobile/android/search/res/drawable/widget_button_right.xml b/mobile/android/base/resources/drawable/widget_button_right.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_right.xml rename to mobile/android/base/resources/drawable/widget_button_right.xml diff --git a/mobile/android/search/res/drawable/widget_button_right_pressed.xml b/mobile/android/base/resources/drawable/widget_button_right_pressed.xml similarity index 100% rename from mobile/android/search/res/drawable/widget_button_right_pressed.xml rename to mobile/android/base/resources/drawable/widget_button_right_pressed.xml diff --git a/mobile/android/search/res/layout/keyguard_widget.xml b/mobile/android/base/resources/layout/keyguard_widget.xml similarity index 100% rename from mobile/android/search/res/layout/keyguard_widget.xml rename to mobile/android/base/resources/layout/keyguard_widget.xml diff --git a/mobile/android/search/res/layout/search_activity_main.xml b/mobile/android/base/resources/layout/search_activity_main.xml similarity index 100% rename from mobile/android/search/res/layout/search_activity_main.xml rename to mobile/android/base/resources/layout/search_activity_main.xml diff --git a/mobile/android/search/res/layout/search_bar.xml b/mobile/android/base/resources/layout/search_bar.xml similarity index 100% rename from mobile/android/search/res/layout/search_bar.xml rename to mobile/android/base/resources/layout/search_bar.xml diff --git a/mobile/android/search/res/layout/search_empty.xml b/mobile/android/base/resources/layout/search_empty.xml similarity index 100% rename from mobile/android/search/res/layout/search_empty.xml rename to mobile/android/base/resources/layout/search_empty.xml diff --git a/mobile/android/search/res/layout/search_fragment_post_search.xml b/mobile/android/base/resources/layout/search_fragment_post_search.xml similarity index 100% rename from mobile/android/search/res/layout/search_fragment_post_search.xml rename to mobile/android/base/resources/layout/search_fragment_post_search.xml diff --git a/mobile/android/search/res/layout/search_fragment_pre_search.xml b/mobile/android/base/resources/layout/search_fragment_pre_search.xml similarity index 100% rename from mobile/android/search/res/layout/search_fragment_pre_search.xml rename to mobile/android/base/resources/layout/search_fragment_pre_search.xml diff --git a/mobile/android/search/res/layout/search_history_row.xml b/mobile/android/base/resources/layout/search_history_row.xml similarity index 100% rename from mobile/android/search/res/layout/search_history_row.xml rename to mobile/android/base/resources/layout/search_history_row.xml diff --git a/mobile/android/search/res/layout/search_sugestions.xml b/mobile/android/base/resources/layout/search_sugestions.xml similarity index 100% rename from mobile/android/search/res/layout/search_sugestions.xml rename to mobile/android/base/resources/layout/search_sugestions.xml diff --git a/mobile/android/search/res/layout/search_suggestions_row.xml b/mobile/android/base/resources/layout/search_suggestions_row.xml similarity index 100% rename from mobile/android/search/res/layout/search_suggestions_row.xml rename to mobile/android/base/resources/layout/search_suggestions_row.xml diff --git a/mobile/android/search/res/layout/search_widget.xml b/mobile/android/base/resources/layout/search_widget.xml similarity index 100% rename from mobile/android/search/res/layout/search_widget.xml rename to mobile/android/base/resources/layout/search_widget.xml diff --git a/mobile/android/search/res/values-v13/search_styles.xml b/mobile/android/base/resources/values-v13/search_styles.xml similarity index 100% rename from mobile/android/search/res/values-v13/search_styles.xml rename to mobile/android/base/resources/values-v13/search_styles.xml diff --git a/mobile/android/search/res/values-v16/search_styles.xml b/mobile/android/base/resources/values-v16/search_styles.xml similarity index 100% rename from mobile/android/search/res/values-v16/search_styles.xml rename to mobile/android/base/resources/values-v16/search_styles.xml diff --git a/mobile/android/search/res/values/search_attrs.xml b/mobile/android/base/resources/values/search_attrs.xml similarity index 100% rename from mobile/android/search/res/values/search_attrs.xml rename to mobile/android/base/resources/values/search_attrs.xml diff --git a/mobile/android/search/res/values/search_colors.xml b/mobile/android/base/resources/values/search_colors.xml similarity index 100% rename from mobile/android/search/res/values/search_colors.xml rename to mobile/android/base/resources/values/search_colors.xml diff --git a/mobile/android/search/res/values/search_dimens.xml b/mobile/android/base/resources/values/search_dimens.xml similarity index 100% rename from mobile/android/search/res/values/search_dimens.xml rename to mobile/android/base/resources/values/search_dimens.xml diff --git a/mobile/android/search/res/values/search_styles.xml b/mobile/android/base/resources/values/search_styles.xml similarity index 100% rename from mobile/android/search/res/values/search_styles.xml rename to mobile/android/base/resources/values/search_styles.xml diff --git a/mobile/android/search/res/xml/search_preferences.xml b/mobile/android/base/resources/xml/search_preferences.xml similarity index 100% rename from mobile/android/search/res/xml/search_preferences.xml rename to mobile/android/base/resources/xml/search_preferences.xml diff --git a/mobile/android/search/res/xml/search_widget_info.xml b/mobile/android/base/resources/xml/search_widget_info.xml similarity index 100% rename from mobile/android/search/res/xml/search_widget_info.xml rename to mobile/android/base/resources/xml/search_widget_info.xml diff --git a/mobile/android/search/java/org/mozilla/search/PostSearchFragment.java b/mobile/android/search/java/org/mozilla/search/PostSearchFragment.java index 7ca511dccfe2..c092cea41d7c 100644 --- a/mobile/android/search/java/org/mozilla/search/PostSearchFragment.java +++ b/mobile/android/search/java/org/mozilla/search/PostSearchFragment.java @@ -4,9 +4,16 @@ package org.mozilla.search; +import java.net.URISyntaxException; + +import org.mozilla.gecko.AppConstants; +import org.mozilla.gecko.R; +import org.mozilla.gecko.Telemetry; +import org.mozilla.gecko.TelemetryContract; +import org.mozilla.search.providers.SearchEngine; + import android.content.Intent; import android.graphics.Bitmap; -import android.net.Uri; import android.os.Bundle; import android.provider.Settings; import android.support.v4.app.Fragment; @@ -23,13 +30,6 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; -import org.mozilla.gecko.AppConstants; -import org.mozilla.gecko.Telemetry; -import org.mozilla.gecko.TelemetryContract; -import org.mozilla.search.providers.SearchEngine; - -import java.net.URISyntaxException; - public class PostSearchFragment extends Fragment { private static final String LOG_TAG = "PostSearchFragment"; diff --git a/mobile/android/search/java/org/mozilla/search/PreSearchFragment.java b/mobile/android/search/java/org/mozilla/search/PreSearchFragment.java index 15d0283c38d8..d913cd46d3ce 100644 --- a/mobile/android/search/java/org/mozilla/search/PreSearchFragment.java +++ b/mobile/android/search/java/org/mozilla/search/PreSearchFragment.java @@ -26,6 +26,7 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; +import org.mozilla.gecko.R; import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.db.BrowserContract; diff --git a/mobile/android/search/java/org/mozilla/search/SearchActivity.java b/mobile/android/search/java/org/mozilla/search/SearchActivity.java index 197ebfd99b26..a577b3cd5408 100644 --- a/mobile/android/search/java/org/mozilla/search/SearchActivity.java +++ b/mobile/android/search/java/org/mozilla/search/SearchActivity.java @@ -5,6 +5,7 @@ package org.mozilla.search; import org.mozilla.gecko.LocaleAware; +import org.mozilla.gecko.R; import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.db.BrowserContract.SearchHistory; diff --git a/mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java b/mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java index f1a0b833c6bb..7e7b3806fff6 100644 --- a/mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java +++ b/mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java @@ -4,6 +4,13 @@ package org.mozilla.search; +import org.mozilla.gecko.GeckoSharedPrefs; +import org.mozilla.gecko.LocaleAware; +import org.mozilla.gecko.R; +import org.mozilla.gecko.Telemetry; +import org.mozilla.gecko.TelemetryContract; +import org.mozilla.gecko.db.BrowserContract; + import android.app.AlertDialog; import android.content.DialogInterface; import android.os.AsyncTask; @@ -14,12 +21,6 @@ import android.preference.PreferenceActivity; import android.util.Log; import android.widget.Toast; -import org.mozilla.gecko.GeckoSharedPrefs; -import org.mozilla.gecko.LocaleAware; -import org.mozilla.gecko.Telemetry; -import org.mozilla.gecko.TelemetryContract; -import org.mozilla.gecko.db.BrowserContract; - /** * This activity allows users to modify the settings for the search activity. * diff --git a/mobile/android/search/java/org/mozilla/search/SearchWidget.java b/mobile/android/search/java/org/mozilla/search/SearchWidget.java index 8d237ccd3541..f3f2fd61fbac 100644 --- a/mobile/android/search/java/org/mozilla/search/SearchWidget.java +++ b/mobile/android/search/java/org/mozilla/search/SearchWidget.java @@ -7,6 +7,7 @@ package org.mozilla.search; import org.mozilla.gecko.AboutPages; import org.mozilla.gecko.AppConstants; +import org.mozilla.gecko.R; import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; diff --git a/mobile/android/search/java/org/mozilla/search/autocomplete/AutoCompleteAdapter.java b/mobile/android/search/java/org/mozilla/search/autocomplete/AutoCompleteAdapter.java index b802ca1d5135..5a0cc8fb65ad 100644 --- a/mobile/android/search/java/org/mozilla/search/autocomplete/AutoCompleteAdapter.java +++ b/mobile/android/search/java/org/mozilla/search/autocomplete/AutoCompleteAdapter.java @@ -4,6 +4,12 @@ package org.mozilla.search.autocomplete; +import java.util.List; + +import org.mozilla.gecko.R; +import org.mozilla.search.AcceptsSearchQuery; +import org.mozilla.search.autocomplete.SuggestionsFragment.Suggestion; + import android.content.Context; import android.view.LayoutInflater; import android.view.View; @@ -11,12 +17,6 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; -import org.mozilla.search.AcceptsSearchQuery; -import org.mozilla.search.R; -import org.mozilla.search.autocomplete.SuggestionsFragment.Suggestion; - -import java.util.List; - /** * The adapter that is used to populate the autocomplete rows. */ diff --git a/mobile/android/search/java/org/mozilla/search/autocomplete/SearchBar.java b/mobile/android/search/java/org/mozilla/search/autocomplete/SearchBar.java index a699c1581630..3262fe24c17d 100644 --- a/mobile/android/search/java/org/mozilla/search/autocomplete/SearchBar.java +++ b/mobile/android/search/java/org/mozilla/search/autocomplete/SearchBar.java @@ -4,6 +4,12 @@ package org.mozilla.search.autocomplete; +import org.mozilla.gecko.R; +import org.mozilla.gecko.Telemetry; +import org.mozilla.gecko.TelemetryContract; +import org.mozilla.gecko.gfx.BitmapUtils; +import org.mozilla.search.providers.SearchEngine; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; @@ -26,12 +32,6 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; -import org.mozilla.gecko.Telemetry; -import org.mozilla.gecko.TelemetryContract; -import org.mozilla.gecko.gfx.BitmapUtils; -import org.mozilla.search.R; -import org.mozilla.search.providers.SearchEngine; - public class SearchBar extends FrameLayout { private final EditText editText; diff --git a/mobile/android/search/java/org/mozilla/search/autocomplete/SuggestionsFragment.java b/mobile/android/search/java/org/mozilla/search/autocomplete/SuggestionsFragment.java index e8924b9d6cb2..7706fc31eea1 100644 --- a/mobile/android/search/java/org/mozilla/search/autocomplete/SuggestionsFragment.java +++ b/mobile/android/search/java/org/mozilla/search/autocomplete/SuggestionsFragment.java @@ -4,6 +4,17 @@ package org.mozilla.search.autocomplete; +import java.util.ArrayList; +import java.util.List; + +import org.mozilla.gecko.R; +import org.mozilla.gecko.SuggestClient; +import org.mozilla.gecko.Telemetry; +import org.mozilla.gecko.TelemetryContract; +import org.mozilla.search.AcceptsSearchQuery; +import org.mozilla.search.AcceptsSearchQuery.SuggestionAnimation; +import org.mozilla.search.providers.SearchEngine; + import android.app.Activity; import android.content.Context; import android.graphics.Rect; @@ -21,17 +32,6 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListView; -import org.mozilla.gecko.SuggestClient; -import org.mozilla.gecko.Telemetry; -import org.mozilla.gecko.TelemetryContract; -import org.mozilla.search.AcceptsSearchQuery; -import org.mozilla.search.AcceptsSearchQuery.SuggestionAnimation; -import org.mozilla.search.R; -import org.mozilla.search.providers.SearchEngine; - -import java.util.ArrayList; -import java.util.List; - /** * A fragment to show search suggestions. */ diff --git a/mobile/android/search/java/org/mozilla/search/ui/FacetBar.java b/mobile/android/search/java/org/mozilla/search/ui/FacetBar.java index 8947fce6bdda..7fcf3dc9bbb5 100644 --- a/mobile/android/search/java/org/mozilla/search/ui/FacetBar.java +++ b/mobile/android/search/java/org/mozilla/search/ui/FacetBar.java @@ -4,6 +4,8 @@ package org.mozilla.search.ui; +import org.mozilla.gecko.R; + import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -12,8 +14,6 @@ import android.util.AttributeSet; import android.widget.RadioButton; import android.widget.RadioGroup; -import org.mozilla.search.R; - public class FacetBar extends RadioGroup { // Ensure facets have equal width and match the bar's height. Supplying these From f446256d83dd3434c99b32a09ae1090107af97b4 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 08:55:47 -0700 Subject: [PATCH 75/79] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ce7bf759bbf4 Author: Kevin Grandon Desc: Merge pull request #24639 from KevinGrandon/bug_1076454_browser_chrome_failing_test Bug 1076454 - Intermittent failing test, TEST-UNEXPECTED-FAIL | /builds/slave/test/gaia/apps/system/test/marionette/browser_chrome_share_web_result_test.js | Browser Chrome - Share Web Result share web result via e-mail ======== https://hg.mozilla.org/integration/gaia-central/rev/a85c1578bc52 Author: Kevin Grandon Desc: Bug 1076454 - Intermittent failing test, TEST-UNEXPECTED-FAIL | /builds/slave/test/gaia/apps/system/test/marionette/browser_chrome_share_web_result_test.js | Browser Chrome - Share Web Result share web result via e-mail r=daleharvey ======== https://hg.mozilla.org/integration/gaia-central/rev/9845c6c67982 Author: Kevin Grandon Desc: Merge pull request #24970 from KevinGrandon/bug_1080344_keyboard_unit_test_sizing Bug 1080344 - [Keyboard] Take into account bounding client rect to handle difference in test-runner resolutions ======== https://hg.mozilla.org/integration/gaia-central/rev/35c774f095d7 Author: Kevin Grandon Desc: Bug 1080344 - [Keyboard] Take into account bounding client rect to handle difference in test-runner resolutions r=rudyl --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index b989de78b09e..37df89ca8b9d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e58f3b4297d4a8b416eab4050e8cdc132a171d5f", + "revision": "ce7bf759bbf4ecdfa46b64cdccc16ccf7531178d", "repo_path": "/integration/gaia-central" } From 1e08595d6622067bb7e2f55b08ff89b022f562b4 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 9 Oct 2014 09:02:00 -0700 Subject: [PATCH 76/79] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 7d99397aa78c..16752aea2c0e 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index e910c13c9169..c30fe8bc217c 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index dbf63f97801f..965e8e7fd07a 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 8815559a8d60..0c24e6ce3a19 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index e910c13c9169..c30fe8bc217c 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 09e135fb2452..4cf15f83f222 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 8cfe20f80cb4..8e134e1fb6e5 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index fec0cc41e1d8..d2cecd289238 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 1e78dc7043c0..e1af685dd406 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 2dfedfb14f2b..46262c0c1354 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index ae051c932300..61d5800fb7cd 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 556bae10fced1077f15f9930c416ecc01736c034 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 9 Oct 2014 12:13:35 -0400 Subject: [PATCH 77/79] Backed out changesets 3ad7043d2116, 774f695d8c0a, c7d7762d5e27, and 87cd44cd57b7 (bug 1058397) for non-unified bustage. --- .../gonk/MobileConnectionService.js | 26 ++-- dom/system/gonk/RadioInterfaceLayer.js | 12 +- dom/system/gonk/ril_worker.js | 50 +------ dom/telephony/Telephony.cpp | 6 +- dom/telephony/Telephony.h | 4 +- dom/telephony/TelephonyCallback.cpp | 119 +++++++++++++++- dom/telephony/TelephonyCallback.h | 59 ++++++-- dom/telephony/TelephonyDialCallback.cpp | 133 ------------------ dom/telephony/TelephonyDialCallback.h | 84 ----------- dom/telephony/USSDSession.cpp | 96 ------------- dom/telephony/USSDSession.h | 61 -------- dom/telephony/gonk/TelephonyService.js | 96 ++----------- dom/telephony/gonk/TelephonyService.manifest | 3 - dom/telephony/ipc/PTelephony.ipdl | 7 - dom/telephony/ipc/PTelephonyRequest.ipdl | 13 +- dom/telephony/ipc/TelephonyChild.cpp | 35 ++--- dom/telephony/ipc/TelephonyChild.h | 5 +- dom/telephony/ipc/TelephonyIPCService.cpp | 11 +- dom/telephony/ipc/TelephonyParent.cpp | 35 +---- dom/telephony/ipc/TelephonyParent.h | 6 +- dom/telephony/moz.build | 4 - dom/telephony/nsIGonkTelephonyService.idl | 7 +- dom/telephony/nsITelephonyService.idl | 36 ++--- dom/webidl/USSDReceivedEvent.webidl | 10 +- dom/webidl/USSDSession.webidl | 14 -- dom/webidl/moz.build | 1 - 26 files changed, 248 insertions(+), 685 deletions(-) delete mode 100644 dom/telephony/TelephonyDialCallback.cpp delete mode 100644 dom/telephony/TelephonyDialCallback.h delete mode 100644 dom/telephony/USSDSession.cpp delete mode 100644 dom/telephony/USSDSession.h delete mode 100644 dom/webidl/USSDSession.webidl diff --git a/dom/mobileconnection/gonk/MobileConnectionService.js b/dom/mobileconnection/gonk/MobileConnectionService.js index 5d4febc65e8d..65205597bd97 100644 --- a/dom/mobileconnection/gonk/MobileConnectionService.js +++ b/dom/mobileconnection/gonk/MobileConnectionService.js @@ -25,8 +25,8 @@ const MOBILENETWORKINFO_CID = Components.ID("{a6c8416c-09b4-46d1-bf29-6520d677d085}"); const MOBILECELLINFO_CID = Components.ID("{0635d9ab-997e-4cdf-84e7-c1883752dff3}"); -const TELEPHONYDIALCALLBACK_CID = - Components.ID("{c2af1a5d-3649-44ef-a1ff-18e9ac1dec51}"); +const TELEPHONYCALLBACK_CID = + Components.ID("{6e1af17e-37f3-11e4-aed3-60a44c237d2b}"); const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown"; const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed"; @@ -141,14 +141,14 @@ MMIResult.prototype = { }; /** - * Wrap a MobileConnectionCallback to a TelephonyDialCallback. + * Wrap a MobileConnectionCallback to a TelephonyCallback. */ -function TelephonyDialCallback(aCallback) { +function TelephonyCallback(aCallback) { this.callback = aCallback; } -TelephonyDialCallback.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyDialCallback]), - classID: TELEPHONYDIALCALLBACK_CID, +TelephonyCallback.prototype = { + QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyCallback]), + classID: TELEPHONYCALLBACK_CID, notifyDialMMI: function(mmiServiceCode) { this.serviceCode = mmiServiceCode; @@ -725,8 +725,8 @@ MobileConnectionProvider.prototype = { }, sendMMI: function(aMmi, aCallback) { - let callback = new TelephonyDialCallback(aCallback); - gGonkTelephonyService.dialMMI(this._clientId, aMmi, callback); + let telephonyCallback = new TelephonyCallback(aCallback); + gGonkTelephonyService.dialMMI(this._clientId, aMmi, telephonyCallback); }, cancelMMI: function(aCallback) { @@ -1056,6 +1056,14 @@ MobileConnectionService.prototype = { this.getItemByServiceId(aClientId) .deliverListenerEvent("notifyUssdReceived", [aMessage, aSessionEnded]); + + let info = { + message: aMessage, + sessionEnded: aSessionEnded, + serviceId: aClientId + }; + + gSystemMessenger.broadcastMessage("ussd-received", info); }, notifyDataError: function(aClientId, aMessage) { diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index e119d42f7048..d3fb3cbce5b8 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -1976,18 +1976,13 @@ RadioInterface.prototype = { gTelephonyService.notifyConferenceCallStateChanged(message.state); break; case "cdmaCallWaiting": - gTelephonyService.notifyCdmaCallWaiting(this.clientId, - message.waitingCall); + gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.waitingCall); break; case "suppSvcNotification": gTelephonyService.notifySupplementaryService(this.clientId, message.callIndex, message.notification); break; - case "ussdreceived": - gTelephonyService.notifyUssdReceived(this.clientId, message.message, - message.sessionEnded); - break; case "datacallerror": connHandler.handleDataCallError(message); break; @@ -2041,6 +2036,11 @@ RadioInterface.prototype = { gRadioEnabledController.notifyRadioStateChanged(this.clientId, message.radioState); break; + case "ussdreceived": + gMobileConnectionService.notifyUssdReceived(this.clientId, + message.message, + message.sessionEnded); + break; case "cardstatechange": this.rilContext.cardState = message.cardState; gRadioEnabledController.receiveCardState(this.clientId); diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index e90d2c4d5e9c..1b5294f10b35 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -2641,48 +2641,22 @@ RilObject.prototype = { } options.ussd = mmi.fullMMI; - - if (options.startNewSession && this._ussdSession) { - if (DEBUG) this.context.debug("Cancel existing ussd session."); - this.cachedUSSDRequest = options; - this.cancelUSSD({}); - return; - } - this.sendUSSD(options); }, - /** - * Cache the request for send out a new ussd when there is an existing - * session. We should do cancelUSSD first. - */ - cachedUSSDRequest : null, - /** * Send USSD. * * @param ussd * String containing the USSD code. - * @param checkSession - * True if an existing session should be there. + * */ - sendUSSD: function(options) { - if (options.checkSession && !this._ussdSession) { - options.success = false; - options.errorMsg = GECKO_ERROR_GENERIC_FAILURE; - this.sendChromeMessage(options); - return; - } - - this.sendRilRequestSendUSSD(options); - }, - - sendRilRequestSendUSSD: function(options) { - let Buf = this.context.Buf; - Buf.newParcel(REQUEST_SEND_USSD, options); - Buf.writeString(options.ussd); - Buf.sendParcel(); - }, + sendUSSD: function(options) { + let Buf = this.context.Buf; + Buf.newParcel(REQUEST_SEND_USSD, options); + Buf.writeString(options.ussd); + Buf.sendParcel(); + }, /** * Cancel pending USSD. @@ -5707,19 +5681,9 @@ RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, if (DEBUG) { this.context.debug("REQUEST_CANCEL_USSD" + JSON.stringify(options)); } - options.success = (options.rilRequestError === 0); this._ussdSession = !options.success; options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError]; - - // The cancelUSSD is triggered by ril_worker itself. - if (this.cachedUSSDRequest) { - if (DEBUG) this.context.debug("Send out the cached ussd request"); - this.sendUSSD(this.cachedUSSDRequest); - this.cachedUSSDRequest = null; - return; - } - this.sendChromeMessage(options); }; RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) { diff --git a/dom/telephony/Telephony.cpp b/dom/telephony/Telephony.cpp index c27900996733..4c97f88f9fd6 100644 --- a/dom/telephony/Telephony.cpp +++ b/dom/telephony/Telephony.cpp @@ -26,7 +26,7 @@ #include "TelephonyCall.h" #include "TelephonyCallGroup.h" #include "TelephonyCallId.h" -#include "TelephonyDialCallback.h" +#include "TelephonyCallback.h" // Service instantiation #include "ipc/TelephonyIPCService.h" @@ -235,8 +235,8 @@ Telephony::DialInternal(uint32_t aServiceId, const nsAString& aNumber, return promise.forget(); } - nsCOMPtr callback = - new TelephonyDialCallback(GetOwner(), this, promise, aServiceId); + nsCOMPtr callback = + new TelephonyCallback(GetOwner(), this, promise, aServiceId); nsresult rv = mService->Dial(aServiceId, aNumber, aEmergency, callback); if (NS_FAILED(rv)) { diff --git a/dom/telephony/Telephony.h b/dom/telephony/Telephony.h index f99b0a04b7cf..e20756eb9c0f 100644 --- a/dom/telephony/Telephony.h +++ b/dom/telephony/Telephony.h @@ -23,7 +23,7 @@ namespace mozilla { namespace dom { namespace telephony { -class TelephonyDialCallback; +class TelephonyCallback; } // namespace telephony @@ -43,7 +43,7 @@ class Telephony MOZ_FINAL : public DOMEventTargetHelper, class EnumerationAck; friend class EnumerationAck; - friend class telephony::TelephonyDialCallback; + friend class telephony::TelephonyCallback; nsCOMPtr mService; nsRefPtr mListener; diff --git a/dom/telephony/TelephonyCallback.cpp b/dom/telephony/TelephonyCallback.cpp index 0590aece6bb4..4f7d77c149c0 100644 --- a/dom/telephony/TelephonyCallback.cpp +++ b/dom/telephony/TelephonyCallback.cpp @@ -4,31 +4,136 @@ #include "TelephonyCallback.h" -#include "mozilla/dom/Promise.h" -#include "nsJSUtils.h" +#include "mozilla/dom/DOMMMIError.h" +#include "nsServiceManagerUtils.h" using namespace mozilla::dom; using namespace mozilla::dom::telephony; NS_IMPL_ISUPPORTS(TelephonyCallback, nsITelephonyCallback) -TelephonyCallback::TelephonyCallback(Promise* aPromise) - : mPromise(aPromise) +TelephonyCallback::TelephonyCallback(nsPIDOMWindow* aWindow, + Telephony* aTelephony, + Promise* aPromise, + uint32_t aServiceId) + : mWindow(aWindow), mTelephony(aTelephony), mPromise(aPromise), + mServiceId(aServiceId) { + MOZ_ASSERT(mTelephony); +} + +nsresult +TelephonyCallback::NotifyDialMMISuccess(const nsAString& aStatusMessage) +{ + AutoJSAPI jsapi; + if (!NS_WARN_IF(jsapi.Init(mWindow))) { + return NS_ERROR_FAILURE; + } + + JSContext* cx = jsapi.cx(); + + MozMMIResult result; + + result.mServiceCode.Assign(mServiceCode); + result.mStatusMessage.Assign(aStatusMessage); + + return NotifyDialMMISuccess(cx, result); +} + +nsresult +TelephonyCallback::NotifyDialMMISuccess(JSContext* aCx, + const nsAString& aStatusMessage, + JS::Handle aInfo) +{ + RootedDictionary result(aCx); + + result.mServiceCode.Assign(mServiceCode); + result.mStatusMessage.Assign(aStatusMessage); + result.mAdditionalInformation.Construct().SetAsObject() = &aInfo.toObject(); + + return NotifyDialMMISuccess(aCx, result); +} + +nsresult +TelephonyCallback::NotifyDialMMISuccess(JSContext* aCx, + const MozMMIResult& aResult) +{ + JS::Rooted jsResult(aCx); + + if (!ToJSValue(aCx, aResult, &jsResult)) { + JS_ClearPendingException(aCx); + return NS_ERROR_TYPE_ERR; + } + + return NotifyDialMMISuccess(jsResult); } // nsITelephonyCallback NS_IMETHODIMP -TelephonyCallback::NotifySuccess() +TelephonyCallback::NotifyDialMMI(const nsAString& aServiceCode) { - mPromise->MaybeResolve(JS::UndefinedHandleValue); + mMMIRequest = new DOMRequest(mWindow); + mServiceCode.Assign(aServiceCode); + + mPromise->MaybeResolve(mMMIRequest); return NS_OK; } NS_IMETHODIMP -TelephonyCallback::NotifyError(const nsAString& aError) +TelephonyCallback::NotifyDialError(const nsAString& aError) { mPromise->MaybeRejectBrokenly(aError); return NS_OK; } + +NS_IMETHODIMP +TelephonyCallback::NotifyDialCallSuccess(uint32_t aCallIndex, + const nsAString& aNumber) +{ + nsRefPtr id = mTelephony->CreateCallId(aNumber); + nsRefPtr call = + mTelephony->CreateCall(id, mServiceId, aCallIndex, + nsITelephonyService::CALL_STATE_DIALING); + + mPromise->MaybeResolve(call); + return NS_OK; +} + +NS_IMETHODIMP +TelephonyCallback::NotifyDialMMISuccess(JS::Handle aResult) +{ + nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); + + return rs->FireSuccessAsync(mMMIRequest, aResult); +} + +NS_IMETHODIMP +TelephonyCallback::NotifyDialMMIError(const nsAString& aError) +{ + Nullable info; + + nsRefPtr error = + new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); + + nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); + + return rs->FireDetailedError(mMMIRequest, error); +} + +NS_IMETHODIMP +TelephonyCallback::NotifyDialMMIErrorWithInfo(const nsAString& aError, + uint16_t aInfo) +{ + Nullable info(aInfo); + + nsRefPtr error = + new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); + + nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); + + return rs->FireDetailedError(mMMIRequest, error); +} diff --git a/dom/telephony/TelephonyCallback.h b/dom/telephony/TelephonyCallback.h index a184e4b7af82..cbcc851ab2fb 100644 --- a/dom/telephony/TelephonyCallback.h +++ b/dom/telephony/TelephonyCallback.h @@ -5,30 +5,73 @@ #ifndef mozilla_dom_TelephonyCallback_h #define mozilla_dom_TelephonyCallback_h +#include "Telephony.h" +#include "mozilla/dom/DOMRequest.h" +#include "mozilla/dom/MozMobileConnectionBinding.h" +#include "mozilla/dom/Promise.h" +#include "mozilla/dom/ToJSValue.h" #include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "nsITelephonyService.h" +#include "nsJSUtils.h" +#include "nsString.h" + +class nsPIDOMWindow; namespace mozilla { namespace dom { - -class Promise; - namespace telephony { -class TelephonyCallback : public nsITelephonyCallback +class TelephonyCallback MOZ_FINAL : public nsITelephonyCallback { public: NS_DECL_ISUPPORTS NS_DECL_NSITELEPHONYCALLBACK - TelephonyCallback(Promise* aPromise); + TelephonyCallback(nsPIDOMWindow* aWindow, Telephony* aTelephony, + Promise* aPromise, uint32_t aServiceId); -protected: - virtual ~TelephonyCallback() {} + nsresult + NotifyDialMMISuccess(const nsAString& aStatusMessage); -protected: + template + nsresult + NotifyDialMMISuccess(const nsAString& aStatusMessage, const T& aInfo) + { + AutoJSAPI jsapi; + if (!NS_WARN_IF(jsapi.Init(mWindow))) { + return NS_ERROR_FAILURE; + } + + JSContext* cx = jsapi.cx(); + JS::Rooted info(cx); + + if (!ToJSValue(cx, aInfo, &info)) { + JS_ClearPendingException(cx); + return NS_ERROR_TYPE_ERR; + } + + return NotifyDialMMISuccess(cx, aStatusMessage, info); + } + +private: + ~TelephonyCallback() {} + + nsresult + NotifyDialMMISuccess(JSContext* aCx, const nsAString& aStatusMessage, + JS::Handle aInfo); + + nsresult + NotifyDialMMISuccess(JSContext* aCx, const MozMMIResult& aResult); + + + nsCOMPtr mWindow; + nsRefPtr mTelephony; nsRefPtr mPromise; + uint32_t mServiceId; + + nsRefPtr mMMIRequest; + nsString mServiceCode; }; } // namespace telephony diff --git a/dom/telephony/TelephonyDialCallback.cpp b/dom/telephony/TelephonyDialCallback.cpp deleted file mode 100644 index f73e3b1ef49d..000000000000 --- a/dom/telephony/TelephonyDialCallback.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "TelephonyDialCallback.h" - -#include "mozilla/dom/DOMMMIError.h" -#include "nsServiceManagerUtils.h" - -using namespace mozilla::dom; -using namespace mozilla::dom::telephony; - -NS_IMPL_ISUPPORTS_INHERITED(TelephonyDialCallback, TelephonyCallback, - nsITelephonyDialCallback) - -TelephonyDialCallback::TelephonyDialCallback(nsPIDOMWindow* aWindow, - Telephony* aTelephony, - Promise* aPromise, - uint32_t aServiceId) - : TelephonyCallback(aPromise), mWindow(aWindow), mTelephony(aTelephony), - mServiceId(aServiceId) -{ - MOZ_ASSERT(mTelephony); -} - -nsresult -TelephonyDialCallback::NotifyDialMMISuccess(const nsAString& aStatusMessage) -{ - AutoJSAPI jsapi; - if (!NS_WARN_IF(jsapi.Init(mWindow))) { - return NS_ERROR_FAILURE; - } - - JSContext* cx = jsapi.cx(); - - MozMMIResult result; - - result.mServiceCode.Assign(mServiceCode); - result.mStatusMessage.Assign(aStatusMessage); - - return NotifyDialMMISuccess(cx, result); -} - -nsresult -TelephonyDialCallback::NotifyDialMMISuccess(JSContext* aCx, - const nsAString& aStatusMessage, - JS::Handle aInfo) -{ - RootedDictionary result(aCx); - - result.mServiceCode.Assign(mServiceCode); - result.mStatusMessage.Assign(aStatusMessage); - result.mAdditionalInformation.Construct().SetAsObject() = &aInfo.toObject(); - - return NotifyDialMMISuccess(aCx, result); -} - -nsresult -TelephonyDialCallback::NotifyDialMMISuccess(JSContext* aCx, - const MozMMIResult& aResult) -{ - JS::Rooted jsResult(aCx); - - if (!ToJSValue(aCx, aResult, &jsResult)) { - JS_ClearPendingException(aCx); - return NS_ERROR_TYPE_ERR; - } - - return NotifyDialMMISuccess(jsResult); -} - -// nsITelephonyDialCallback - -NS_IMETHODIMP -TelephonyDialCallback::NotifyDialMMI(const nsAString& aServiceCode) -{ - mMMIRequest = new DOMRequest(mWindow); - mServiceCode.Assign(aServiceCode); - - mPromise->MaybeResolve(mMMIRequest); - return NS_OK; -} - -NS_IMETHODIMP -TelephonyDialCallback::NotifyDialCallSuccess(uint32_t aCallIndex, - const nsAString& aNumber) -{ - nsRefPtr id = mTelephony->CreateCallId(aNumber); - nsRefPtr call = - mTelephony->CreateCall(id, mServiceId, aCallIndex, - nsITelephonyService::CALL_STATE_DIALING); - - mPromise->MaybeResolve(call); - return NS_OK; -} - -NS_IMETHODIMP -TelephonyDialCallback::NotifyDialMMISuccess(JS::Handle aResult) -{ - nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); - - return rs->FireSuccessAsync(mMMIRequest, aResult); -} - -NS_IMETHODIMP -TelephonyDialCallback::NotifyDialMMIError(const nsAString& aError) -{ - Nullable info; - - nsRefPtr error = - new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); - - nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); - - return rs->FireDetailedError(mMMIRequest, error); -} - -NS_IMETHODIMP -TelephonyDialCallback::NotifyDialMMIErrorWithInfo(const nsAString& aError, - uint16_t aInfo) -{ - Nullable info(aInfo); - - nsRefPtr error = - new DOMMMIError(mWindow, aError, EmptyString(), mServiceCode, info); - - nsCOMPtr rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE); - - return rs->FireDetailedError(mMMIRequest, error); -} diff --git a/dom/telephony/TelephonyDialCallback.h b/dom/telephony/TelephonyDialCallback.h deleted file mode 100644 index 6e47a007bc09..000000000000 --- a/dom/telephony/TelephonyDialCallback.h +++ /dev/null @@ -1,84 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_dom_TelephonyDialCallback_h -#define mozilla_dom_TelephonyDialCallback_h - -#include "Telephony.h" -#include "mozilla/dom/DOMRequest.h" -#include "mozilla/dom/MozMobileConnectionBinding.h" -#include "mozilla/dom/Promise.h" -#include "mozilla/dom/ToJSValue.h" -#include "mozilla/dom/telephony/TelephonyCallback.h" -#include "nsAutoPtr.h" -#include "nsCOMPtr.h" -#include "nsITelephonyService.h" -#include "nsJSUtils.h" -#include "nsString.h" - -class nsPIDOMWindow; - -namespace mozilla { -namespace dom { -namespace telephony { - -class TelephonyDialCallback MOZ_FINAL : public TelephonyCallback, - public nsITelephonyDialCallback -{ -public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSITELEPHONYDIALCALLBACK - - TelephonyDialCallback(nsPIDOMWindow* aWindow, Telephony* aTelephony, - Promise* aPromise, uint32_t aServiceId); - - NS_FORWARD_NSITELEPHONYCALLBACK(TelephonyCallback::) - - nsresult - NotifyDialMMISuccess(const nsAString& aStatusMessage); - - template - nsresult - NotifyDialMMISuccess(const nsAString& aStatusMessage, const T& aInfo) - { - AutoJSAPI jsapi; - if (!NS_WARN_IF(jsapi.Init(mWindow))) { - return NS_ERROR_FAILURE; - } - - JSContext* cx = jsapi.cx(); - JS::Rooted info(cx); - - if (!ToJSValue(cx, aInfo, &info)) { - JS_ClearPendingException(cx); - return NS_ERROR_TYPE_ERR; - } - - return NotifyDialMMISuccess(cx, aStatusMessage, info); - } - -private: - ~TelephonyDialCallback() {} - - nsresult - NotifyDialMMISuccess(JSContext* aCx, const nsAString& aStatusMessage, - JS::Handle aInfo); - - nsresult - NotifyDialMMISuccess(JSContext* aCx, const MozMMIResult& aResult); - - - nsCOMPtr mWindow; - nsRefPtr mTelephony; - uint32_t mServiceId; - - nsRefPtr mMMIRequest; - nsString mServiceCode; -}; - -} // namespace telephony -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_TelephonyDialCallback_h diff --git a/dom/telephony/USSDSession.cpp b/dom/telephony/USSDSession.cpp deleted file mode 100644 index 4680e782034a..000000000000 --- a/dom/telephony/USSDSession.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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 "mozilla/dom/USSDSession.h" - -#include "mozilla/dom/USSDSessionBinding.h" -#include "mozilla/dom/telephony/TelephonyCallback.h" -#include "nsIGlobalObject.h" -#include "nsServiceManagerUtils.h" - -using namespace mozilla::dom; -using namespace mozilla::dom::telephony; - -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(USSDSession, mWindow) -NS_IMPL_CYCLE_COLLECTING_ADDREF(USSDSession) -NS_IMPL_CYCLE_COLLECTING_RELEASE(USSDSession) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(USSDSession) - NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -USSDSession::USSDSession(nsPIDOMWindow* aWindow, nsITelephonyService* aService, - uint32_t aServiceId) - : mWindow(aWindow), mService(aService), mServiceId(aServiceId) -{ -} - -USSDSession::~USSDSession() -{ -} - -nsPIDOMWindow* -USSDSession::GetParentObject() const -{ - return mWindow; -} - -JSObject* -USSDSession::WrapObject(JSContext* aCx) -{ - return USSDSessionBinding::Wrap(aCx, this); -} - -// WebIDL - -already_AddRefed -USSDSession::Constructor(const GlobalObject& aGlobal, uint32_t aServiceId, - ErrorResult& aRv) -{ - nsCOMPtr window = do_QueryInterface(aGlobal.GetAsSupports()); - if (!window) { - aRv.Throw(NS_ERROR_UNEXPECTED); - return nullptr; - } - - nsCOMPtr ril = - do_GetService(TELEPHONY_SERVICE_CONTRACTID); - if (!ril) { - aRv.Throw(NS_ERROR_UNEXPECTED); - return nullptr; - } - - nsRefPtr session = new USSDSession(window, ril, aServiceId); - return session.forget(); -} - -already_AddRefed -USSDSession::Send(const nsAString& aUssd, ErrorResult& aRv) -{ - if (!mService) { - aRv.Throw(NS_ERROR_FAILURE); - return nullptr; - } - - nsCOMPtr global = do_QueryInterface(mWindow); - if (!global) { - return nullptr; - } - - nsRefPtr promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - nsCOMPtr callback = new TelephonyCallback(promise); - - nsresult rv = mService->SendUSSD(mServiceId, aUssd, callback); - if (NS_FAILED(rv)) { - promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR); - } - - return promise.forget(); -} diff --git a/dom/telephony/USSDSession.h b/dom/telephony/USSDSession.h deleted file mode 100644 index a681a1fe91b7..000000000000 --- a/dom/telephony/USSDSession.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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_USSDSession_h -#define mozilla_dom_USSDSession_h - -#include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" -#include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/Promise.h" -#include "nsAutoPtr.h" -#include "nsCOMPtr.h" -#include "nsCycleCollectionParticipant.h" -#include "nsITelephonyService.h" -#include "nsPIDOMWindow.h" -#include "nsWrapperCache.h" - -struct JSContext; - -namespace mozilla { -namespace dom { - -class USSDSession MOZ_FINAL : public nsISupports, - public nsWrapperCache -{ -public: - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(USSDSession) - - USSDSession(nsPIDOMWindow* aWindow, nsITelephonyService* aService, - uint32_t aServiceId); - - nsPIDOMWindow* - GetParentObject() const; - - virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; - - // WebIDL - static already_AddRefed - Constructor(const GlobalObject& aGlobal, uint32_t aServiceId, - ErrorResult& aRv); - - already_AddRefed - Send(const nsAString& aUssd, ErrorResult& aRv); - -private: - ~USSDSession(); - - nsCOMPtr mWindow; - nsCOMPtr mService; - uint32_t mServiceId; -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_USSDSession_h diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index 3d870d94a4b7..94b33dc3f524 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -564,7 +564,7 @@ TelephonyService.prototype = { // Note: isPlainPhoneNumber also accepts USSD and SS numbers if (!gPhoneNumberUtils.isPlainPhoneNumber(aNumber)) { if (DEBUG) debug("Error: Number '" + aNumber + "' is not viable. Drop."); - aCallback.notifyError(DIAL_ERROR_BAD_NUMBER); + aCallback.notifyDialError(DIAL_ERROR_BAD_NUMBER); return; } @@ -581,11 +581,11 @@ TelephonyService.prototype = { } else { // Reject MMI code from dialEmergency api. if (aIsDialEmergency) { - aCallback.notifyError(DIAL_ERROR_BAD_NUMBER); + aCallback.notifyDialError(DIAL_ERROR_BAD_NUMBER); return; } - this._dialMMI(aClientId, mmi, aCallback, true); + this._dialMMI(aClientId, mmi, aCallback); } }, @@ -597,14 +597,14 @@ TelephonyService.prototype = { _dialCall: function(aClientId, aOptions, aCallback) { if (this._isDialing) { if (DEBUG) debug("Error: Already has a dialing call."); - aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR); + aCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR); return; } // We can only have at most two calls on the same line (client). if (this._numCallsOnLine(aClientId) >= 2) { if (DEBUG) debug("Error: Already has more than 2 calls on line."); - aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR); + aCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR); return; } @@ -612,7 +612,7 @@ TelephonyService.prototype = { // any new call on other SIM. if (this._hasCallsOnOtherClient(aClientId)) { if (DEBUG) debug("Error: Already has a call on other sim."); - aCallback.notifyError(DIAL_ERROR_OTHER_CONNECTION_IN_USE); + aCallback.notifyDialError(DIAL_ERROR_OTHER_CONNECTION_IN_USE); return; } @@ -622,7 +622,7 @@ TelephonyService.prototype = { aClientId = gRadioInterfaceLayer.getClientIdForEmergencyCall() ; if (aClientId === -1) { if (DEBUG) debug("Error: No client is avaialble for emergency call."); - aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR); + aCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR); return; } } @@ -655,7 +655,7 @@ TelephonyService.prototype = { this._isDialing = false; if (!response.success) { - aCallback.notifyError(response.errorMsg); + aCallback.notifyDialError(response.errorMsg); return; } @@ -673,24 +673,16 @@ TelephonyService.prototype = { }, /** - * @param aClientId - * Client id. * @param aMmi * Parsed MMI structure. - * @param aCallback - * A nsITelephonyDialCallback object. - * @param aStartNewSession - * True to start a new session for ussd request. */ - _dialMMI: function(aClientId, aMmi, aCallback, aStartNewSession) { + _dialMMI: function(aClientId, aMmi, aCallback) { let mmiServiceCode = aMmi ? this._serviceCodeToKeyString(aMmi.serviceCode) : RIL.MMI_KS_SC_USSD; aCallback.notifyDialMMI(mmiServiceCode); - this._sendToRilWorker(aClientId, "sendMMI", - { mmi: aMmi, - startNewSession: aStartNewSession }, response => { + this._sendToRilWorker(aClientId, "sendMMI", { mmi: aMmi }, response => { if (DEBUG) debug("MMI response: " + JSON.stringify(response)); if (!response.success) { @@ -1056,18 +1048,6 @@ TelephonyService.prototype = { this._sendToRilWorker(aClientId, "resumeConference"); }, - sendUSSD: function(aClientId, aUssd, aCallback) { - this._sendToRilWorker(aClientId, "sendUSSD", - { ussd: aUssd, checkSession: true }, - response => { - if (!response.success) { - aCallback.notifyError(response.errorMsg); - } else { - aCallback.notifySuccess(); - } - }); - }, - get microphoneMuted() { return gAudioManager.microphoneMuted; }, @@ -1286,27 +1266,9 @@ TelephonyService.prototype = { this._notifyAllListeners("conferenceCallStateChanged", [aState]); }, - notifyUssdReceived: function(aClientId, aMessage, aSessionEnded) { - if (DEBUG) { - debug("notifyUssdReceived for " + aClientId + ": " + - aMessage + " (sessionEnded : " + aSessionEnded + ")"); - } - - let info = { - serviceId: aClientId, - message: aMessage, - sessionEnded: aSessionEnded - }; - - gSystemMessenger.broadcastMessage("ussd-received", info); - - gGonkMobileConnectionService.notifyUssdReceived(aClientId, aMessage, - aSessionEnded); - }, - dialMMI: function(aClientId, aMmiString, aCallback) { let mmi = this._parseMMI(aMmiString, this._hasCalls(aClientId)); - this._dialMMI(aClientId, mmi, aCallback, false); + this._dialMMI(aClientId, mmi, aCallback); }, /** @@ -1333,38 +1295,4 @@ TelephonyService.prototype = { } }; -/** - * This implements nsISystemMessagesWrapper.wrapMessage(), which provides a - * plugable way to wrap a "ussd-received" type system message. - * - * Please see SystemMessageManager.js to know how it customizes the wrapper. - */ -function USSDReceivedWrapper() { - if (DEBUG) debug("USSDReceivedWrapper()"); -} -USSDReceivedWrapper.prototype = { - // nsISystemMessagesWrapper implementation. - wrapMessage: function(aMessage, aWindow) { - if (DEBUG) debug("wrapMessage: " + JSON.stringify(aMessage)); - - let session = aMessage.sessionEnded ? null : - new aWindow.USSDSession(aMessage.serviceId); - - let event = new aWindow.USSDReceivedEvent("ussdreceived", { - serviceId: aMessage.serviceId, - message: aMessage.message, - sessionEnded: aMessage.sessionEnded, - session: session - }); - - return event; - }, - - classDescription: "USSDReceivedWrapper", - classID: Components.ID("{d03684ed-ede4-4210-8206-f4f32772d9f5}"), - contractID: "@mozilla.org/dom/system-messages/wrapper/ussd-received;1", - QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessagesWrapper]) -}; - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelephonyService, - USSDReceivedWrapper]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelephonyService]); diff --git a/dom/telephony/gonk/TelephonyService.manifest b/dom/telephony/gonk/TelephonyService.manifest index 28c8d8633f07..fae2b0641dcc 100644 --- a/dom/telephony/gonk/TelephonyService.manifest +++ b/dom/telephony/gonk/TelephonyService.manifest @@ -1,5 +1,2 @@ component {67d26434-d063-4d28-9f48-5b3189788155} TelephonyService.js contract @mozilla.org/telephony/gonktelephonyservice;1 {67d26434-d063-4d28-9f48-5b3189788155} - -component {d03684ed-ede4-4210-8206-f4f32772d9f5} TelephonyService.js -contract @mozilla.org/dom/system-messages/wrapper/ussd-received;1 {d03684ed-ede4-4210-8206-f4f32772d9f5} diff --git a/dom/telephony/ipc/PTelephony.ipdl b/dom/telephony/ipc/PTelephony.ipdl index 229525b58946..22713254526e 100644 --- a/dom/telephony/ipc/PTelephony.ipdl +++ b/dom/telephony/ipc/PTelephony.ipdl @@ -24,17 +24,10 @@ struct DialRequest bool isEmergency; }; -struct USSDRequest -{ - uint32_t clientId; - nsString ussd; -}; - union IPCTelephonyRequest { EnumerateCallsRequest; DialRequest; - USSDRequest; }; sync protocol PTelephony { diff --git a/dom/telephony/ipc/PTelephonyRequest.ipdl b/dom/telephony/ipc/PTelephonyRequest.ipdl index 997e4d2dddaf..312c97eba712 100644 --- a/dom/telephony/ipc/PTelephonyRequest.ipdl +++ b/dom/telephony/ipc/PTelephonyRequest.ipdl @@ -16,12 +16,7 @@ struct EnumerateCallsResponse // empty. }; -struct SuccessResponse -{ - // empty. -}; - -struct ErrorResponse +struct DialResponseError { nsString name; }; @@ -47,12 +42,8 @@ struct DialResponseMMIError union IPCTelephonyResponse { EnumerateCallsResponse; - - // General. - SuccessResponse; - ErrorResponse; - // dial + DialResponseError; DialResponseCallSuccess; DialResponseMMISuccess; DialResponseMMIError; diff --git a/dom/telephony/ipc/TelephonyChild.cpp b/dom/telephony/ipc/TelephonyChild.cpp index f9bd0aada99c..a8529a59625f 100644 --- a/dom/telephony/ipc/TelephonyChild.cpp +++ b/dom/telephony/ipc/TelephonyChild.cpp @@ -5,7 +5,7 @@ #include "TelephonyChild.h" -#include "mozilla/dom/telephony/TelephonyDialCallback.h" +#include "mozilla/dom/telephony/TelephonyCallback.h" #include "TelephonyIPCService.h" USING_TELEPHONY_NAMESPACE @@ -147,10 +147,8 @@ TelephonyRequestChild::Recv__delete__(const IPCTelephonyResponse& aResponse) case IPCTelephonyResponse::TEnumerateCallsResponse: mListener->EnumerateCallStateComplete(); break; - case IPCTelephonyResponse::TSuccessResponse: - return DoResponse(aResponse.get_SuccessResponse()); - case IPCTelephonyResponse::TErrorResponse: - return DoResponse(aResponse.get_ErrorResponse()); + case IPCTelephonyResponse::TDialResponseError: + return DoResponse(aResponse.get_DialResponseError()); case IPCTelephonyResponse::TDialResponseCallSuccess: return DoResponse(aResponse.get_DialResponseCallSuccess()); case IPCTelephonyResponse::TDialResponseMMISuccess: @@ -189,24 +187,16 @@ bool TelephonyRequestChild::RecvNotifyDialMMI(const nsString& aServiceCode) { MOZ_ASSERT(mCallback); - nsCOMPtr callback = do_QueryInterface(mCallback); - callback->NotifyDialMMI(aServiceCode); + + mCallback->NotifyDialMMI(aServiceCode); return true; } bool -TelephonyRequestChild::DoResponse(const SuccessResponse& aResponse) +TelephonyRequestChild::DoResponse(const DialResponseError& aResponse) { MOZ_ASSERT(mCallback); - mCallback->NotifySuccess(); - return true; -} - -bool -TelephonyRequestChild::DoResponse(const ErrorResponse& aResponse) -{ - MOZ_ASSERT(mCallback); - mCallback->NotifyError(aResponse.name()); + mCallback->NotifyDialError(aResponse.name()); return true; } @@ -214,8 +204,7 @@ bool TelephonyRequestChild::DoResponse(const DialResponseCallSuccess& aResponse) { MOZ_ASSERT(mCallback); - nsCOMPtr callback = do_QueryInterface(mCallback); - callback->NotifyDialCallSuccess(aResponse.callIndex(), aResponse.number()); + mCallback->NotifyDialCallSuccess(aResponse.callIndex(), aResponse.number()); return true; } @@ -226,8 +215,7 @@ TelephonyRequestChild::DoResponse(const DialResponseMMISuccess& aResponse) // FIXME: Need to overload NotifyDialMMISuccess in the IDL. mCallback is not // necessarily an instance of TelephonyCallback. - nsCOMPtr dialCallback = do_QueryInterface(mCallback); - nsRefPtr callback = static_cast(dialCallback.get()); + nsRefPtr callback = static_cast(mCallback.get()); nsAutoString statusMessage(aResponse.statusMessage()); AdditionalInformation info(aResponse.additionalInformation()); @@ -254,17 +242,16 @@ bool TelephonyRequestChild::DoResponse(const DialResponseMMIError& aResponse) { MOZ_ASSERT(mCallback); - nsCOMPtr callback = do_QueryInterface(mCallback); nsAutoString name(aResponse.name()); AdditionalInformation info(aResponse.additionalInformation()); switch (info.type()) { case AdditionalInformation::Tvoid_t: - callback->NotifyDialMMIError(name); + mCallback->NotifyDialMMIError(name); break; case AdditionalInformation::Tuint16_t: - callback->NotifyDialMMIErrorWithInfo(name, info.get_uint16_t()); + mCallback->NotifyDialMMIErrorWithInfo(name, info.get_uint16_t()); break; default: MOZ_CRASH("Received invalid type!"); diff --git a/dom/telephony/ipc/TelephonyChild.h b/dom/telephony/ipc/TelephonyChild.h index eaee17ff30f7..49ec3887d463 100644 --- a/dom/telephony/ipc/TelephonyChild.h +++ b/dom/telephony/ipc/TelephonyChild.h @@ -84,10 +84,7 @@ protected: private: bool - DoResponse(const SuccessResponse& aResponse); - - bool - DoResponse(const ErrorResponse& aResponse); + DoResponse(const DialResponseError& aResponse); bool DoResponse(const DialResponseCallSuccess& aResponse); diff --git a/dom/telephony/ipc/TelephonyIPCService.cpp b/dom/telephony/ipc/TelephonyIPCService.cpp index 1d31ae5c7433..abebc253418e 100644 --- a/dom/telephony/ipc/TelephonyIPCService.cpp +++ b/dom/telephony/ipc/TelephonyIPCService.cpp @@ -162,8 +162,7 @@ TelephonyIPCService::EnumerateCalls(nsITelephonyListener *aListener) NS_IMETHODIMP TelephonyIPCService::Dial(uint32_t aClientId, const nsAString& aNumber, - bool aIsEmergency, - nsITelephonyDialCallback *aCallback) + bool aIsEmergency, nsITelephonyCallback *aCallback) { return SendRequest(nullptr, aCallback, DialRequest(aClientId, nsString(aNumber), aIsEmergency)); @@ -301,14 +300,6 @@ TelephonyIPCService::StopTone(uint32_t aClientId) return NS_OK; } -NS_IMETHODIMP -TelephonyIPCService::SendUSSD(uint32_t aClientId, const nsAString& aUssd, - nsITelephonyCallback *aCallback) -{ - return SendRequest(nullptr, aCallback, - USSDRequest(aClientId, nsString(aUssd))); -} - NS_IMETHODIMP TelephonyIPCService::GetMicrophoneMuted(bool* aMuted) { diff --git a/dom/telephony/ipc/TelephonyParent.cpp b/dom/telephony/ipc/TelephonyParent.cpp index 4cb5fe4714a6..864d55ffe45e 100644 --- a/dom/telephony/ipc/TelephonyParent.cpp +++ b/dom/telephony/ipc/TelephonyParent.cpp @@ -43,8 +43,6 @@ TelephonyParent::RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActo return actor->DoRequest(aRequest.get_EnumerateCallsRequest()); case IPCTelephonyRequest::TDialRequest: return actor->DoRequest(aRequest.get_DialRequest()); - case IPCTelephonyRequest::TUSSDRequest: - return actor->DoRequest(aRequest.get_USSDRequest()); default: MOZ_CRASH("Unknown type!"); } @@ -387,8 +385,7 @@ TelephonyParent::SupplementaryServiceNotification(uint32_t aClientId, NS_IMPL_ISUPPORTS(TelephonyRequestParent, nsITelephonyListener, - nsITelephonyCallback, - nsITelephonyDialCallback) + nsITelephonyCallback) TelephonyRequestParent::TelephonyRequestParent() : mActorDestroyed(false) @@ -429,23 +426,9 @@ TelephonyRequestParent::DoRequest(const DialRequest& aRequest) do_GetService(TELEPHONY_SERVICE_CONTRACTID); if (service) { service->Dial(aRequest.clientId(), aRequest.number(), - aRequest.isEmergency(), this); + aRequest.isEmergency(), this); } else { - return NS_SUCCEEDED(NotifyError(NS_LITERAL_STRING("InvalidStateError"))); - } - - return true; -} - -bool -TelephonyRequestParent::DoRequest(const USSDRequest& aRequest) -{ - nsCOMPtr service = - do_GetService(TELEPHONY_SERVICE_CONTRACTID); - if (service) { - service->SendUSSD(aRequest.clientId(), aRequest.ussd(), this); - } else { - return NS_SUCCEEDED(NotifyError(NS_LITERAL_STRING("InvalidStateError"))); + return NS_SUCCEEDED(NotifyDialError(NS_LITERAL_STRING("InvalidStateError"))); } return true; @@ -549,7 +532,7 @@ TelephonyRequestParent::SupplementaryServiceNotification(uint32_t aClientId, MOZ_CRASH("Not a TelephonyParent!"); } -// nsITelephonyDialCallback +// nsITelephonyCallback NS_IMETHODIMP TelephonyRequestParent::NotifyDialMMI(const nsAString& aServiceCode) @@ -560,15 +543,9 @@ TelephonyRequestParent::NotifyDialMMI(const nsAString& aServiceCode) } NS_IMETHODIMP -TelephonyRequestParent::NotifySuccess() +TelephonyRequestParent::NotifyDialError(const nsAString& aError) { - return SendResponse(SuccessResponse()); -} - -NS_IMETHODIMP -TelephonyRequestParent::NotifyError(const nsAString& aError) -{ - return SendResponse(ErrorResponse(nsAutoString(aError))); + return SendResponse(DialResponseError(nsAutoString(aError))); } NS_IMETHODIMP diff --git a/dom/telephony/ipc/TelephonyParent.h b/dom/telephony/ipc/TelephonyParent.h index e88710e092d1..5989a6b45796 100644 --- a/dom/telephony/ipc/TelephonyParent.h +++ b/dom/telephony/ipc/TelephonyParent.h @@ -98,7 +98,7 @@ private: class TelephonyRequestParent : public PTelephonyRequestParent , public nsITelephonyListener - , public nsITelephonyDialCallback + , public nsITelephonyCallback { friend class TelephonyParent; @@ -106,7 +106,6 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSITELEPHONYLISTENER NS_DECL_NSITELEPHONYCALLBACK - NS_DECL_NSITELEPHONYDIALCALLBACK protected: TelephonyRequestParent(); @@ -126,9 +125,6 @@ private: bool DoRequest(const DialRequest& aRequest); - - bool - DoRequest(const USSDRequest& aRequest); }; END_TELEPHONY_NAMESPACE diff --git a/dom/telephony/moz.build b/dom/telephony/moz.build index a8fdfc99cc40..232b98dc9b37 100644 --- a/dom/telephony/moz.build +++ b/dom/telephony/moz.build @@ -16,7 +16,6 @@ EXPORTS.mozilla.dom += [ 'TelephonyCall.h', 'TelephonyCallGroup.h', 'TelephonyCallId.h', - 'USSDSession.h' ] EXPORTS.mozilla.dom.telephony += [ @@ -24,7 +23,6 @@ EXPORTS.mozilla.dom.telephony += [ 'ipc/TelephonyParent.h', 'TelephonyCallback.h', 'TelephonyCommon.h', - 'TelephonyDialCallback.h', ] UNIFIED_SOURCES += [ @@ -37,8 +35,6 @@ UNIFIED_SOURCES += [ 'TelephonyCallback.cpp', 'TelephonyCallGroup.cpp', 'TelephonyCallId.cpp', - 'TelephonyDialCallback.cpp', - 'USSDSession.cpp', ] IPDL_SOURCES += [ diff --git a/dom/telephony/nsIGonkTelephonyService.idl b/dom/telephony/nsIGonkTelephonyService.idl index f8ff7172f49c..5b6f0facc8b6 100644 --- a/dom/telephony/nsIGonkTelephonyService.idl +++ b/dom/telephony/nsIGonkTelephonyService.idl @@ -10,7 +10,7 @@ "@mozilla.org/telephony/gonktelephonyservice;1" %} -[scriptable, uuid(79eec3c3-2dfc-4bbf-b106-af5457651ae0)] +[scriptable, uuid(8790e2cc-2c68-4ce9-90dc-f68e1b6e4886)] interface nsIGonkTelephonyService : nsITelephonyService { void notifyCallDisconnected(in unsigned long clientId, in jsval call); @@ -27,9 +27,6 @@ interface nsIGonkTelephonyService : nsITelephonyService void notifyConferenceCallStateChanged(in short state); - void notifyUssdReceived(in unsigned long clientId, in DOMString message, - in boolean sessionEnded); - void dialMMI(in unsigned long clientId, in AString mmiString, - in nsITelephonyDialCallback callback); + in nsITelephonyCallback callback); }; diff --git a/dom/telephony/nsITelephonyService.idl b/dom/telephony/nsITelephonyService.idl index 56872631ebd4..4d764567482e 100644 --- a/dom/telephony/nsITelephonyService.idl +++ b/dom/telephony/nsITelephonyService.idl @@ -177,20 +177,10 @@ interface nsITelephonyListener : nsISupports }; /** - * A callback interface for handling asynchronous response. + * A callback interface for handling asynchronous response of Telephony.dial(). */ -[scriptable, uuid(cffc3f9d-2c88-4a14-8ebc-f216caf0cc1d)] +[scriptable, uuid(67533db3-cd38-475c-a774-8d0bbf9169fb)] interface nsITelephonyCallback : nsISupports -{ - void notifySuccess(); - void notifyError(in AString error); -}; - -/** - * A callback interface for handling asynchronous response for telephony.dial. - */ -[scriptable, uuid(4481212f-72e9-4aef-97e1-5397af782113)] -interface nsITelephonyDialCallback : nsITelephonyCallback { /** * Called when a dial request is treated as an MMI code and it is about to @@ -201,6 +191,14 @@ interface nsITelephonyDialCallback : nsITelephonyCallback */ void notifyDialMMI(in AString serviceCode); + /** + * Called when a dial request fails. + * + * @param error + * Error from RIL. + */ + void notifyDialError(in AString error); + /** * Called when a dial request is treated as a call setup and the result * succeeds. @@ -240,7 +238,7 @@ interface nsITelephonyDialCallback : nsITelephonyCallback * XPCOM component (in the content process) that provides the telephony * information. */ -[scriptable, uuid(79188caa-046a-48e1-b9c5-2e891504dc7a)] +[scriptable, uuid(4ff3ecb7-b024-4752-9dd6-c3623c6e6b8a)] interface nsITelephonyService : nsISupports { const unsigned short CALL_STATE_UNKNOWN = 0; @@ -283,7 +281,7 @@ interface nsITelephonyService : nsISupports * Functionality for making and managing phone calls. */ void dial(in unsigned long clientId, in DOMString number, - in boolean isEmergency, in nsITelephonyDialCallback callback); + in boolean isEmergency, in nsITelephonyCallback callback); void hangUp(in unsigned long clientId, in unsigned long callIndex); void startTone(in unsigned long clientId, in DOMString dtmfChar); @@ -299,16 +297,6 @@ interface nsITelephonyService : nsISupports void holdConference(in unsigned long clientId); void resumeConference(in unsigned long clientId); - /** - * Send an USSD on existing session. It results in error if the session is - * not existed. - * - * If successful, callback.notifySuccess() will be called. - * Otherwise, callback.notifyError() will be called. - */ - void sendUSSD(in unsigned long clientId, in DOMString ussd, - in nsITelephonyCallback callback); - attribute bool microphoneMuted; attribute bool speakerEnabled; }; diff --git a/dom/webidl/USSDReceivedEvent.webidl b/dom/webidl/USSDReceivedEvent.webidl index 627beb3712d4..45be49491afa 100644 --- a/dom/webidl/USSDReceivedEvent.webidl +++ b/dom/webidl/USSDReceivedEvent.webidl @@ -4,22 +4,16 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="dom.telephony.enabled", - CheckPermissions="telephony mobileconnection", - AvailableIn="CertifiedApps", +[Pref="dom.mobileconnection.enabled", Constructor(DOMString type, optional USSDReceivedEventInit eventInitDict)] interface USSDReceivedEvent : Event { - readonly attribute unsigned long serviceId; readonly attribute DOMString? message; - readonly attribute USSDSession? session; // null if session is ended. - readonly attribute boolean sessionEnded; // deprecated. Bug 1070831 + readonly attribute boolean sessionEnded; }; dictionary USSDReceivedEventInit : EventInit { - unsigned long serviceId = 0; DOMString? message = null; - USSDSession? session = null; boolean sessionEnded = false; }; diff --git a/dom/webidl/USSDSession.webidl b/dom/webidl/USSDSession.webidl deleted file mode 100644 index 88062f9f831f..000000000000 --- a/dom/webidl/USSDSession.webidl +++ /dev/null @@ -1,14 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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="dom.telephony.enabled", - CheckPermissions="telephony", - AvailableIn="CertifiedApps", - Constructor(unsigned long serviceId)] -interface USSDSession { - [Throws] - Promise send(DOMString ussd); -}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index b7b6124eda5e..2fe400636b0d 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -501,7 +501,6 @@ WEBIDL_FILES = [ 'URLSearchParams.webidl', 'URLUtils.webidl', 'URLUtilsReadOnly.webidl', - 'USSDSession.webidl', 'ValidityState.webidl', 'VideoPlaybackQuality.webidl', 'VideoStreamTrack.webidl', From 46d55d6995c06540ee9886a5134a2d0b56db0a8e Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 9 Oct 2014 13:16:32 -0400 Subject: [PATCH 78/79] Backed out changeset 0f7fe4800ace (bug 1027631) for non-unified bustage. CLOSED TREE --- b2g/chrome/content/shell.js | 8 ---- .../BrowserElementChildPreload.js | 11 ----- dom/browser-element/BrowserElementParent.jsm | 9 +--- layout/base/TouchCaret.cpp | 42 +------------------ layout/base/TouchCaret.h | 7 ---- 5 files changed, 2 insertions(+), 75 deletions(-) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index ae5b7479d834..1fa01820bdc6 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -333,7 +333,6 @@ var shell = { this.contentBrowser.addEventListener('mozbrowserloadstart', this, true); this.contentBrowser.addEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.addEventListener('mozbrowserscrollviewchange', this, true); - this.contentBrowser.addEventListener('mozbrowsertouchcarettap', this, true); CustomEventManager.init(); WebappsHelper.init(); @@ -362,7 +361,6 @@ var shell = { this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true); this.contentBrowser.removeEventListener('mozbrowserselectionchange', this, true); this.contentBrowser.removeEventListener('mozbrowserscrollviewchange', this, true); - this.contentBrowser.removeEventListener('mozbrowsertouchcarettap', this, true); ppmm.removeMessageListener("content-handler", this); UserAgentOverrides.uninit(); @@ -510,12 +508,6 @@ var shell = { detail: evt.detail, }); break; - case 'mozbrowsertouchcarettap': - this.sendChromeEvent({ - type: 'touchcarettap', - detail: evt.detail, - }); - break; case 'mozbrowserselectionchange': // The mozbrowserselectionchange event, may have crossed the chrome-content boundary. // This event always dispatch to shell.js. But the offset we got from this event is diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 9b1ee279b9ff..9d9dc207890d 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -226,12 +226,6 @@ BrowserElementChild.prototype = { /* useCapture = */ false, /* wantsUntrusted = */ false); - addEventListener('touchcarettap', - this._touchCaretTapHandler.bind(this), - /* useCapture = */ false, - /* wantsUntrusted = */ false); - - // This listens to unload events from our message manager, but /not/ from // the |content| window. That's because the window's unload event doesn't // bubble, and we're not using a capturing listener. If we'd used @@ -637,11 +631,6 @@ BrowserElementChild.prototype = { sendAsyncMsg('metachange', meta); }, - _touchCaretTapHandler: function(e) { - e.stopPropagation(); - sendAsyncMsg('touchcarettap'); - }, - _ScrollViewChangeHandler: function(e) { e.stopPropagation(); let detail = { diff --git a/dom/browser-element/BrowserElementParent.jsm b/dom/browser-element/BrowserElementParent.jsm index 588536c21144..066c59a040a8 100644 --- a/dom/browser-element/BrowserElementParent.jsm +++ b/dom/browser-element/BrowserElementParent.jsm @@ -258,8 +258,7 @@ BrowserElementParent.prototype = { "visibilitychange": this._childVisibilityChange, "got-set-input-method-active": this._gotDOMRequestResult, "selectionchange": this._handleSelectionChange, - "scrollviewchange": this._handleScrollViewChange, - "touchcarettap": this._handleTouchCaretTap + "scrollviewchange": this._handleScrollViewChange }; let mmSecuritySensitiveCalls = { @@ -506,12 +505,6 @@ BrowserElementParent.prototype = { this._frameElement.dispatchEvent(evt); }, - _handleTouchCaretTap: function(data) { - let evt = this._createEvent("touchcarettap", data.json, - /* cancelable = */ false); - this._frameElement.dispatchEvent(evt); - }, - _createEvent: function(evtName, detail, cancelable) { // This will have to change if we ever want to send a CustomEvent with null // detail. For now, it's OK. diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index acc79de2a8d6..98822a8895c9 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -30,7 +30,6 @@ #include "nsView.h" #include "nsDOMTokenList.h" #include "nsCaret.h" -#include "mozilla/dom/CustomEvent.h" using namespace mozilla; @@ -59,8 +58,7 @@ TouchCaret::TouchCaret(nsIPresShell* aPresShell) : mState(TOUCHCARET_NONE), mActiveTouchId(-1), mCaretCenterToDownPointOffsetY(0), - mVisible(false), - mIsValidTap(false) + mVisible(false) { TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell); MOZ_ASSERT(NS_IsMainThread()); @@ -603,7 +601,6 @@ TouchCaret::HandleMouseMoveEvent(WidgetMouseEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); - mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -641,7 +638,6 @@ TouchCaret::HandleTouchMoveEvent(WidgetTouchEvent* aEvent) movePoint = contentBoundary.ClampPoint(movePoint); MoveCaret(movePoint); - mIsValidTap = false; status = nsEventStatus_eConsumeNoDefault; } break; @@ -852,35 +848,6 @@ TouchCaret::HandleTouchDownEvent(WidgetTouchEvent* aEvent) return status; } -void -TouchCaret::DispatchTapEvent() -{ - nsCOMPtr presShell = do_QueryReferent(mPresShell); - if (!presShell) { - return; - } - - nsCOMPtr doc = presShell->GetDocument(); - if (!doc) { - return; - } - - ErrorResult res; - nsRefPtr domEvent = - doc->CreateEvent(NS_LITERAL_STRING("CustomEvent"), res); - if (res.Failed()) { - return; - } - - CustomEvent* customEvent = static_cast(domEvent.get()); - customEvent->InitCustomEvent(NS_LITERAL_STRING("touchcarettap"), - true, false, nullptr); - customEvent->SetTrusted(true); - customEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true; - bool ret; - doc->DispatchEvent(domEvent, &ret); -} - void TouchCaret::SetState(TouchCaretState aState) { @@ -912,12 +879,5 @@ TouchCaret::SetState(TouchCaretState aState) if (mState == TOUCHCARET_NONE) { mActiveTouchId = -1; mCaretCenterToDownPointOffsetY = 0; - if (mIsValidTap) { - DispatchTapEvent(); - mIsValidTap = false; - } - } else if (mState == TOUCHCARET_TOUCHDRAG_ACTIVE || - mState == TOUCHCARET_MOUSEDRAG_ACTIVE) { - mIsValidTap = true; } } diff --git a/layout/base/TouchCaret.h b/layout/base/TouchCaret.h index 32bf995d6f8e..ab3d4ef94e39 100644 --- a/layout/base/TouchCaret.h +++ b/layout/base/TouchCaret.h @@ -209,11 +209,6 @@ private: */ void SetState(TouchCaretState aState); - /** - * Dispatch touch caret tap event to chrome. - */ - void DispatchTapEvent(); - /** * Current state we're dealing with. */ @@ -254,8 +249,6 @@ private: // Touch caret visibility bool mVisible; - // Use for detecting single tap on touch caret. - bool mIsValidTap; // Touch caret timer nsCOMPtr mTouchCaretExpirationTimer; From 4bb9cac09b222a97c99e3be93419936d1e693d08 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Thu, 9 Oct 2014 16:24:35 -0700 Subject: [PATCH 79/79] Backed out changeset cde9ebf247be (bug 1076314) so it doesn't ship in a Nightly on friday or over the weekend CLOSED TREE a=me --- browser/base/content/popup-notifications.inc | 6 --- browser/components/nsBrowserGlue.js | 45 +++----------------- testing/profiles/prefs_general.js | 2 +- 3 files changed, 8 insertions(+), 45 deletions(-) diff --git a/browser/base/content/popup-notifications.inc b/browser/base/content/popup-notifications.inc index dd7b2e020012..4e79bdb3e2dc 100644 --- a/browser/base/content/popup-notifications.inc +++ b/browser/base/content/popup-notifications.inc @@ -59,9 +59,3 @@