Closed Bug 1046423 Opened 10 years ago Closed 10 years ago

"Mirror Tab" option is in menu even when there isn't a device to mirror to

Categories

(Firefox for Android Graveyard :: Screencasting, defect)

x86
macOS
defect
Not set
normal

Tracking

(firefox34 verified)

VERIFIED FIXED
Firefox 34
Tracking Status
firefox34 --- verified

People

(Reporter: blassey, Assigned: blassey)

References

Details

Attachments

(1 file)

      No description provided.
Attachment #8465049 - Flags: review?(mark.finkle)
Comment on attachment 8465049 [details] [diff] [review]
mirror_menu_added.patch

>diff --git a/mobile/android/chrome/content/CastingApps.js b/mobile/android/chrome/content/CastingApps.js

>+  serviceAdded: function(aService) {
>+    Cu.reportError("target registered");

Remove the debugging

>+      this.menuItem = NativeWindow.menu.add(
>+        Strings.browser.GetStringFromName("casting.mirrorTab"),
>+        "drawable://casting",
>+        function() {
>+          function callbackFunc(aService) {
>+            let app = SimpleServiceDiscovery.findAppForService(aService);
>+            if (app)
>+              app.mirror(function() {
>+            });
>+          }
>+

Let's add this menu to the Tools menu and use the new syntax. Note that we drop the icon since it's not used in the main menu:

      this.menuItem = NativeWindow.menu.add({
        name: Strings.browser.GetStringFromName("casting.mirrorTab"),
        callback: function() {
          function callbackFunc(aService) {
            let app = SimpleServiceDiscovery.findAppForService(aService);
            if (app)
              app.mirror(function() {
            });
          }

          function filterFunc(aService) {
            return aService.mirror == true;
          }
          this.prompt(callbackFunc, filterFunc);
        }.bind(this),
        parent: parent: aWindow.NativeWindow.menu.toolsMenuID
      });

Untested, but should work.

>+          function filterFunc(aService) {
>+            Cu.reportError("testing: " + aService);

remove the debugging

>+  serviceLost: function(aService) {
>+    Cu.reportError("target unregistered");

Remove the debugging

r+ but verify my code works
Attachment #8465049 - Flags: review?(mark.finkle) → review+
Blocks: 1048335
this landed http://hg.mozilla.org/mozilla-central/rev/c0538dd5463d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee: nobody → blassey.bugs
Target Milestone: --- → Firefox 34
Verified as fixed in build 34.0a1 (2014-08-19);
Device: Motorola Razr (Android 4.1.2).
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: