OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_BASE_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_ | |
6 #define UI_BASE_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "base/file_path.h" | |
12 #include "ui/base/dialogs/select_file_dialog.h" | |
13 | |
14 namespace ui { | |
15 | |
16 class SelectFileDialogImpl : public ui::SelectFileDialog { | |
17 public: | |
18 static SelectFileDialogImpl* Create(Listener* listener, | |
19 ui::SelectFilePolicy* policy); | |
20 | |
21 void OnFileSelected(JNIEnv*, jobject, jstring filepath); | |
22 void OnFileNotSelected(JNIEnv*, jobject); | |
23 | |
24 // From SelectFileDialog | |
25 virtual bool IsRunning(gfx::NativeWindow) const OVERRIDE; | |
26 virtual void ListenerDestroyed() OVERRIDE; | |
27 | |
28 // Called when it is time to display the file picker. | |
29 // params is expected to be a Vector<string16> with accept_types first and | |
30 // the capture value as the last element of the vector. | |
31 virtual void SelectFileImpl( | |
32 ui::SelectFileDialog::Type, | |
33 const string16& title, | |
34 const FilePath& default_path, | |
35 const ui::SelectFileDialog::FileTypeInfo* file_types, | |
36 int file_type_index, | |
37 const std::string& default_extension, | |
38 gfx::NativeWindow owning_window, | |
39 void* params) OVERRIDE; | |
40 | |
41 protected: | |
42 virtual ~SelectFileDialogImpl(); | |
43 | |
44 private: | |
45 explicit SelectFileDialogImpl(Listener* listener, | |
46 ui::SelectFilePolicy* policy); | |
47 | |
48 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; | |
49 | |
50 base::android::ScopedJavaGlobalRef<jobject> java_object_; | |
51 | |
52 bool is_running_; | |
53 }; | |
54 | |
55 | |
56 SelectFileDialog* CreateAndroidSelectFileDialog( | |
57 SelectFileDialog::Listener* listener, | |
58 SelectFilePolicy* policy); | |
59 | |
60 bool RegisterSelectFileDialog(JNIEnv*); | |
Yaron
2012/09/12 19:14:45
Nit: make this a static member of the above class
aurimas (slooooooooow)
2012/09/13 15:37:15
Done.
| |
61 | |
62 } // namespace ui | |
63 | |
64 #endif // UI_BASE_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_ | |
OLD | NEW |