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

Unified Diff: ui/shell_dialogs/select_file_dialog_android.cc

Issue 150283002: Figure out the display name for a content uri. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: 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 40e15553e3ef51394abf019bcd9292be6f7d15fa..290d5091ef6dd0eb55a18be06bb38e029fe939c8 100644
--- a/ui/shell_dialogs/select_file_dialog_android.cc
+++ b/ui/shell_dialogs/select_file_dialog_android.cc
@@ -14,6 +14,7 @@
#include "base/strings/utf_string_conversions.h"
#include "jni/SelectFileDialog_jni.h"
#include "ui/base/android/window_android.h"
+#include "ui/shell_dialogs/selected_file_info.h"
namespace ui {
@@ -25,10 +26,19 @@ SelectFileDialogImpl* SelectFileDialogImpl::Create(Listener* listener,
void SelectFileDialogImpl::OnFileSelected(JNIEnv* env,
jobject java_object,
- jstring filepath) {
+ jstring filepath,
+ jstring display_name) {
if (listener_) {
std::string path = base::android::ConvertJavaStringToUTF8(env, filepath);
- listener_->FileSelected(base::FilePath(path), 0, NULL);
+ std::string file_name =
+ base::android::ConvertJavaStringToUTF8(env, display_name);
+ base::FilePath file_path = base::FilePath(path);
+ ui::SelectedFileInfo file_info;
+ file_info.file_path = file_path;
+ file_info.local_path = file_path;
+ if (!file_name.empty())
+ file_info.display_name = file_name;
+ listener_->FileSelectedWithExtraInfo(file_info, 0, NULL);
}
is_running_ = false;

Powered by Google App Engine
This is Rietveld 408576698