Closed Bug 874689 Opened 11 years ago Closed 11 years ago

Make FilePicker use Async prompt service

Categories

(Firefox for Android Graveyard :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 24

People

(Reporter: wesj, Assigned: wesj)

References

Details

Attachments

(2 files)

      No description provided.
Attached patch Patch 1/2Splinter Review
Not sure if you'll love or hate this, but I moved the file picker to js to make it a bit easier to do this through message passing. I think I copied this fairly faithfully.
Attachment #752436 - Flags: review?(blassey.bugs)
Attached patch Patch 2/2Splinter Review
This hooks up the message listeners in Java. I didn't realize that the filePicker actually had an async api before this, but this moves all the dependency on whether we're async or not into js (by spinning an event loop in FilePicker.js), and out of the Native implementation parts.

I've left a few bits around. The file picker is invoked via. the bridge (and not xpcom for some reason?) here:

http://mxr.mozilla.org/mozilla-central/source/content/media/webrtc/MediaEngineDefault.cpp#188

so we can't quite kill it all yet.
Attachment #752440 - Flags: review?(blassey.bugs)
Comment on attachment 752436 [details] [diff] [review]
Patch 1/2

Review of attachment 752436 [details] [diff] [review]:
-----------------------------------------------------------------

Finkle would be a better reviewer for this patch than me
Attachment #752436 - Flags: review?(blassey.bugs) → review?(mark.finkle)
Comment on attachment 752440 [details] [diff] [review]
Patch 2/2

Review of attachment 752440 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/ActivityHandlerHelper.java
@@ +184,5 @@
>  
> +    private interface IntentHandler {
> +        public void gotIntent(Intent intent);
> +    }
> +    

ws

@@ +206,5 @@
> +            public void onPromptFinished(String promptServiceResult) {
> +                int itemId = -1;
> +                try {
> +                    itemId = new JSONObject(promptServiceResult).getInt("button");
> +        

ws
Attachment #752440 - Flags: review?(blassey.bugs) → review+
Attachment #752436 - Flags: review?(mark.finkle) → review+
Grrr. Left my unbitrotting in the try commit. Folded everything into one:

https://hg.mozilla.org/integration/mozilla-inbound/rev/1e8d7a30499d
nsFilePicker.cpp and nsFilePicker.h were accidentally un-deleted during some merging between branches. Re-deleted.
https://hg.mozilla.org/integration/mozilla-inbound/rev/00119553c9d8
https://hg.mozilla.org/mozilla-central/rev/1e8d7a30499d
https://hg.mozilla.org/mozilla-central/rev/00119553c9d8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 24
Assignee: nobody → wjohnston
Depends on: 879482
Depends on: 878415
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: