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

Side by Side Diff: ui/shell_dialogs/select_file_dialog_android.h

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed ted's comments and added dismiss listener Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_ 5 #ifndef UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_
6 #define UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_ 6 #define UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "ui/shell_dialogs/select_file_dialog.h" 12 #include "ui/shell_dialogs/select_file_dialog.h"
13 13
14 using base::android::ScopedJavaLocalRef;
15
14 namespace ui { 16 namespace ui {
15 17
16 class SelectFileDialogImpl : public SelectFileDialog { 18 class SelectFileDialogImpl : public SelectFileDialog {
17 public: 19 public:
18 static SelectFileDialogImpl* Create(Listener* listener, 20 static SelectFileDialogImpl* Create(Listener* listener,
19 SelectFilePolicy* policy); 21 SelectFilePolicy* policy);
20 22
21 void OnFileSelected(JNIEnv* env, 23 void OnFileSelected(JNIEnv* env,
22 jobject java_object, 24 jobject java_object,
23 jstring filepath, 25 jstring filepath,
24 jstring display_name); 26 jstring display_name);
25 27
26 void OnMultipleFilesSelected(JNIEnv* env, 28 void OnMultipleFilesSelected(JNIEnv* env,
27 jobject java_object, 29 jobject java_object,
28 jobjectArray filepaths, 30 jobjectArray filepaths,
29 jobjectArray display_names); 31 jobjectArray display_names);
30 32
31 void OnFileNotSelected(JNIEnv* env, jobject java_object); 33 void OnFileNotSelected(JNIEnv* env, jobject java_object);
34 ScopedJavaLocalRef<jstring> GetUniqueFilePath(JNIEnv* env,
qinmin 2014/09/20 05:06:58 this doesn't needs to be a member function?
Changwan Ryu 2014/09/22 14:02:38 Hmm.. This is accessed by Java. Is there any way I
qinmin 2014/10/02 17:02:48 In java side, if you declare you native call witho
35 jobject java_object,
36 jstring path);
32 37
33 // From SelectFileDialog 38 // From SelectFileDialog
34 virtual bool IsRunning(gfx::NativeWindow) const OVERRIDE; 39 virtual bool IsRunning(gfx::NativeWindow) const OVERRIDE;
35 virtual void ListenerDestroyed() OVERRIDE; 40 virtual void ListenerDestroyed() OVERRIDE;
36 41
37 // Called when it is time to display the file picker. 42 // Called when it is time to display the file picker.
38 // params is expected to be a vector<string16> with accept_types first and 43 // params is expected to be a vector<string16> with accept_types first and
39 // the capture value as the last element of the vector. 44 // the capture value as the last element of the vector.
40 virtual void SelectFileImpl( 45 virtual void SelectFileImpl(
41 SelectFileDialog::Type type, 46 SelectFileDialog::Type type,
(...skipping 21 matching lines...) Expand all
63 }; 68 };
64 69
65 SelectFileDialog* CreateAndroidSelectFileDialog( 70 SelectFileDialog* CreateAndroidSelectFileDialog(
66 SelectFileDialog::Listener* listener, 71 SelectFileDialog::Listener* listener,
67 SelectFilePolicy* policy); 72 SelectFilePolicy* policy);
68 73
69 } // namespace ui 74 } // namespace ui
70 75
71 #endif // UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_ 76 #endif // UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_
72 77
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698