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

Unified Diff: ui/shell_dialogs/select_file_dialog_android.cc

Issue 14758008: Update the HTML Media Capture implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix attempt. Created 7 years, 5 months 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
« no previous file with comments | « ui/android/java/src/org/chromium/ui/SelectFileDialog.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/shell_dialogs/select_file_dialog_android.cc
diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/select_file_dialog_android.cc
index b4dc7e8dc6945c931bc86367635b7e605349111e..e2c29d6887664d35b5be71f25a1d5cae5f334b7d 100644
--- a/ui/shell_dialogs/select_file_dialog_android.cc
+++ b/ui/shell_dialogs/select_file_dialog_android.cc
@@ -62,28 +62,22 @@ void SelectFileDialogImpl::SelectFileImpl(
void* params) {
JNIEnv* env = base::android::AttachCurrentThread();
- ScopedJavaLocalRef<jstring> capture_value;
- std::vector<base::string16> accept_types;
+ // The first element in the pair is a list of accepted types, the second
+ // indicates whether the device's capture capabilities should be used.
+ typedef std::pair<std::vector<base::string16>, bool> AcceptTypes;
+ AcceptTypes accept_types = std::make_pair(std::vector<base::string16>(),
+ false);
+
if (params) {
- accept_types = *(reinterpret_cast<std::vector<base::string16>*>(params));
-
- // The last string in params is expected to be the string
- // with capture value.
- capture_value = base::android::ConvertUTF16ToJavaString(env,
- StringToLowerASCII(accept_types.back()));
- base::android::CheckException(env);
- accept_types.pop_back();
- } else {
- capture_value = base::android::ConvertUTF8ToJavaString(env, "filesystem");
+ accept_types = *(reinterpret_cast<AcceptTypes*>(params));
}
- // The rest params elements are expected to be accept_types.
ScopedJavaLocalRef<jobjectArray> accept_types_java =
- base::android::ToJavaArrayOfStrings(env, accept_types);
+ base::android::ToJavaArrayOfStrings(env, accept_types.first);
Java_SelectFileDialog_selectFile(env, java_object_.obj(),
accept_types_java.obj(),
- capture_value.obj(),
+ accept_types.second,
owning_window->GetJavaObject().obj());
is_running_ = true;
}
« no previous file with comments | « ui/android/java/src/org/chromium/ui/SelectFileDialog.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698