Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: ui/android/java/src/org/chromium/ui/SelectFileDialog.java

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/base/file_stream_context.cc ('K') | « net/base/file_stream_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/java/src/org/chromium/ui/SelectFileDialog.java
diff --git a/ui/android/java/src/org/chromium/ui/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/SelectFileDialog.java
index 91533b52cf0f1a9a8a3b4bac233cd60cbbf86966..f05d188392256bd8a9d9551f9f827e4675c1f645 100644
--- a/ui/android/java/src/org/chromium/ui/SelectFileDialog.java
+++ b/ui/android/java/src/org/chromium/ui/SelectFileDialog.java
@@ -160,21 +160,10 @@ class SelectFileDialog implements WindowAndroid.IntentCallback{
// We get back a content:// URI from the system if the user picked a file from the
// gallery. The ContentView has functionality that will convert that content:// URI to
// a file path on disk that Chromium understands.
- Cursor c = contentResolver.query(results.getData(),
- new String[] { MediaStore.MediaColumns.DATA }, null, null, null);
- if (c != null) {
- if (c.getCount() == 1) {
- c.moveToFirst();
- String path = c.getString(0);
- if (path != null) {
- // Not all providers support the MediaStore.DATA column. For example,
- // Gallery3D (com.android.gallery3d.provider) does not support it for
- // Picasa Web Album images.
- nativeOnFileSelected(mNativeSelectFileDialog, path);
- success = true;
- }
- }
- c.close();
+ if (results.getScheme() != null
+ && results.getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
+ nativeOnFileSelected(mNativeSelectFileDialog, results.getData().toString());
+ success = true;
}
}
if (!success) {
« net/base/file_stream_context.cc ('K') | « net/base/file_stream_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698