Closed Bug 598269 Opened 9 years ago Closed 9 years ago

Rewrite sharing front end to use the sharing service

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(fennec2.0b2+)

VERIFIED FIXED
Tracking Status
fennec 2.0b2+ ---

People

(Reporter: moz_poro, Assigned: moz_poro)

References

()

Details

Attachments

(1 file)

Rewrite sharing front end to use platform specific sharing services.

Specification at http://etherpad.mozilla.com:9000/sharing-interface
tracking-fennec: --- → ?
Proposed behavior:

* If getSharingApps returns multiple apps (expected on Android), then Fennec will ask the user to choose an app.

* If getSharingApps returns one app (expected on MeeGo), then Fennec will immediately launch that app.  The default sharing app on MeeGo will display its own chooser UI.

* If getSharingApps returns zero results (expected on Maemo 5 and on desktop platforms), then Fennec will fall back to a list of hard-coded in-browser sharing services (currently Email, Facebook, Twitter, and Google).
(In reply to comment #1)
> Proposed behavior:
> 
> * If getSharingApps returns multiple apps (expected on Android), then Fennec
> will ask the user to choose an app.
> 
> * If getSharingApps returns one app (expected on MeeGo), then Fennec will
> immediately launch that app.  The default sharing app on MeeGo will display its
> own chooser UI.
> 
> * If getSharingApps returns zero results (expected on Maemo 5 and on desktop
> platforms), then Fennec will fall back to a list of hard-coded in-browser
> sharing services (currently Email, Facebook, Twitter, and Google).

getSharingApps will not be implemented in the first phase of this project. Only shareWithDefault will be implemented right away (for beta 2 at least).

See bug 598268

If getSharingApps fails, say on the N900, the original design was to fallback to email and sms only.

See bug 596632
Attached patch PatchSplinter Review
Patch for fennec which uses the proposed implementation in bug 598268.

Basically, adds to SharingUI a method for calling shareWithDefault of nsIExternalSharingAppService. If it fails, falls back to the current sharing user interface implementation.
Attachment #477463 - Flags: review?(mark.finkle)
tracking-fennec: ? → 2.0b2+
Comment on attachment 477463 [details] [diff] [review]
Patch

This is a good patch. The only reason I don't want to r+ it yet is that we need to settle on the backend service.

The Android patch and the Meego patch are slightly different in how the service would be accessed.

Cc["@mozilla.org/uriloader/external-protocol-service;1"]       .getService(Ci.nsIExternalSharingAppService);

 versus

Cc["@mozilla.org/uriloader/external-sharing-app-service;1"]       .getService(Ci.nsIExternalSharingAppService);

I'll check the status of the Android patch. I think I might like the "external-sharing-app-service;1" approach a little more.

Nice work though!
Once the backend method is settled, I can provide a modified patch (well, the service name is changed plus any additional fixes needed). I now have a work-in-progress version of the MeeGo backend which works with the Android patch.
Comment on attachment 477463 [details] [diff] [review]
Patch

>diff -r ea70f3df7037 chrome/content/browser-ui.js

>+  showSharingUI: function showSharingUI(aURL, aTitle, aType) {
>+    let sharingSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
>+                         .getService(Ci.nsIExternalSharingAppService);

The final contract is:

"@mozilla.org/uriloader/external-sharing-app-service;1"

I can change that when I land the patch
Attachment #477463 - Flags: review?(mark.finkle) → review+
pushed:
http://hg.mozilla.org/mobile-browser/rev/7b738fe45c1a
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 601275
Verified fixed on:
Mozilla/5.0 (Android;Linux armv7l;rv:9.0a1)Gecko/20110913
Firefox/9.0a1 Fennec/9.0a1
Device: Samsung Galaxy S
OS: Android 2.2
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.