Closed Bug 971957 Opened 10 years ago Closed 10 years ago

nsIFilePicker should set title of picker dialogs

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 32

People

(Reporter: wesj, Assigned: wesj)

Details

Attachments

(1 file)

The nsIFilePicker lets you pass in a title when you create the picker. We currently just ignore it.
Attached patch PatchSplinter Review
I did this as part of another patch and wanted to put it up. I'm not sure we want it in this form though. Currently we show something like "Choose File" or "Choose or record a sound". This seems to always just show "Upload file".

We could overwrite the title strings for Android, but we'd also probably need to update the C++ to allow setting different strings for image/* pickers vs */* ones, etc. At that point, our current solution doesn't look quite as bad to me.
Attachment #8375101 - Flags: review?(mark.finkle)
Comment on attachment 8375101 [details] [diff] [review]
Patch

>diff --git a/mobile/android/base/ActivityHandlerHelper.java b/mobile/android/base/ActivityHandlerHelper.java

>-    private void getFilePickerIntentAsync(final Context context, String aMimeType, final IntentHandler handler) {
>+    private void getFilePickerIntentAsync(final Context context, String title, String aMimeType, final IntentHandler handler) {

You might as well aMimeType -> mimeType while you are here

>-    public void showFilePickerAsync(final Activity parentActivity, String aMimeType, final FileResultHandler handler) {
>-        getFilePickerIntentAsync(parentActivity, aMimeType, new IntentHandler() {
>+    public void showFilePickerAsync(final Activity parentActivity, String title, String aMimeType, final FileResultHandler handler) {
>+        getFilePickerIntentAsync(parentActivity, title, aMimeType, new IntentHandler() {

Same about aMimeType

I see a few other uses of getFilePickerTitle in this file. Should we be worried about those uses?

r+ but audit those other uses
Attachment #8375101 - Flags: review?(mark.finkle) → review+
Yeah, this is built on top of some other patches (bug 946344 and 971939). I don't plan to land it until at least 946344 is done.
https://hg.mozilla.org/mozilla-central/rev/22cf82b12e16
Assignee: nobody → wjohnston
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
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: