FileDocCategorySizeDatePackage
FileChooserParamsAdapter.javaAPI DocAndroid 5.1 API2605Thu Mar 12 22:22:56 GMT 2015com.android.webview.chromium

FileChooserParamsAdapter

public class FileChooserParamsAdapter extends android.webkit.WebChromeClient.FileChooserParams

Fields Summary
private AwContentsClient.FileChooserParams
mParams
Constructors Summary
FileChooserParamsAdapter(AwContentsClient.FileChooserParams params, android.content.Context context)

        mParams = params;
    
Methods Summary
public android.content.IntentcreateIntent()

        // TODO: Move this code to Aw. Once code is moved
        // and merged to M37 get rid of this.
        String mimeType = "*/*";
        if (mParams.acceptTypes != null && !mParams.acceptTypes.trim().isEmpty())
            mimeType = mParams.acceptTypes.split(";")[0];

        Intent i = new Intent(Intent.ACTION_GET_CONTENT);
        i.addCategory(Intent.CATEGORY_OPENABLE);
        i.setType(mimeType);
        return i;
    
public java.lang.String[]getAcceptTypes()

        if (mParams.acceptTypes == null)
            return new String[0];
        return mParams.acceptTypes.split(";");
    
public java.lang.StringgetFilenameHint()

        return mParams.defaultFilename;
    
public intgetMode()

        return mParams.mode;
    
public java.lang.CharSequencegetTitle()

        return mParams.title;
    
public booleanisCaptureEnabled()

        return mParams.capture;
    
public static android.net.Uri[]parseFileChooserResult(int resultCode, android.content.Intent intent)

        if (resultCode == Activity.RESULT_CANCELED) {
            return null;
        }
        Uri result = intent == null || resultCode != Activity.RESULT_OK ? null
                : intent.getData();

        Uri[] uris = null;
        if (result != null) {
            uris = new Uri[1];
            uris[0] = result;
        }
        return uris;