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

Unified Diff: android_webview/native/aw_web_contents_delegate.cc

Issue 450003002: Pass display names for uploaded content URI files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 4 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
Index: android_webview/native/aw_web_contents_delegate.cc
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc
index ee51dc50f9f44e812b3ca4c83225bb03b355594d..7572c39c4107d879087109c2bad7399de7299901 100644
--- a/android_webview/native/aw_web_contents_delegate.cc
+++ b/android_webview/native/aw_web_contents_delegate.cc
@@ -230,16 +230,19 @@ bool AwWebContentsDelegate::IsFullscreenForTabOrPending(
static void FilesSelectedInChooser(
JNIEnv* env, jclass clazz,
jint process_id, jint render_id, jint mode_flags,
- jobjectArray file_paths) {
+ jobjectArray file_paths, jobjectArray display_names) {
content::RenderViewHost* rvh = content::RenderViewHost::FromID(process_id,
render_id);
if (!rvh)
return;
std::vector<std::string> file_path_str;
+ std::vector<std::string> display_name_str;
// Note file_paths maybe NULL, but this will just yield a zero-length vector.
base::android::AppendJavaStringArrayToStringVector(env, file_paths,
&file_path_str);
+ base::android::AppendJavaStringArrayToStringVector(env, display_names,
+ &display_name_str);
std::vector<ui::SelectedFileInfo> files;
files.reserve(file_path_str.size());
for (size_t i = 0; i < file_path_str.size(); ++i) {
@@ -247,7 +250,10 @@ static void FilesSelectedInChooser(
if (!url.is_valid())
continue;
base::FilePath path(url.SchemeIsFile() ? url.path() : file_path_str[i]);
- files.push_back(ui::SelectedFileInfo(path, base::FilePath()));
+ ui::SelectedFileInfo file_info(path, base::FilePath());
+ if (!display_name_str[i].empty())
+ file_info.display_name = display_name_str[i];
+ files.push_back(file_info);
}
FileChooserParams::Mode mode;
if (mode_flags & kFileChooserModeOpenFolder) {

Powered by Google App Engine
This is Rietveld 408576698