summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authormfomitchev <mfomitchev@chromium.org>2015-10-29 08:59:48 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-29 16:00:43 +0000
commitcddfeaa40018e47e8d0e1b2851cf117aee06ecca (patch)
tree381381c6b8e41cb1a9d556d027d8e5959663204f /ui
parent7fdb5337eef8f19a61f8c1e1fabdcfbebcb85e68 (diff)
downloadchromium_src-cddfeaa40018e47e8d0e1b2851cf117aee06ecca.zip
chromium_src-cddfeaa40018e47e8d0e1b2851cf117aee06ecca.tar.gz
chromium_src-cddfeaa40018e47e8d0e1b2851cf117aee06ecca.tar.bz2
Aura on Android: Stub implementation of SelectFileDialog.
BUG=507792 Review URL: https://codereview.chromium.org/1409793002 Cr-Commit-Position: refs/heads/master@{#356857}
Diffstat (limited to 'ui')
-rw-r--r--ui/shell_dialogs/BUILD.gn19
-rw-r--r--ui/shell_dialogs/select_file_dialog_auraandroid.cc56
-rw-r--r--ui/shell_dialogs/select_file_dialog_auraandroid.h48
3 files changed, 118 insertions, 5 deletions
diff --git a/ui/shell_dialogs/BUILD.gn b/ui/shell_dialogs/BUILD.gn
index 88764d1..9696e98 100644
--- a/ui/shell_dialogs/BUILD.gn
+++ b/ui/shell_dialogs/BUILD.gn
@@ -10,8 +10,6 @@ if (is_android) {
component("shell_dialogs") {
sources = [
- "android/shell_dialogs_jni_registrar.cc",
- "android/shell_dialogs_jni_registrar.h",
"base_shell_dialog.cc",
"base_shell_dialog.h",
"base_shell_dialog_win.cc",
@@ -20,8 +18,6 @@ component("shell_dialogs") {
"linux_shell_dialog.h",
"select_file_dialog.cc",
"select_file_dialog.h",
- "select_file_dialog_android.cc",
- "select_file_dialog_android.h",
"select_file_dialog_factory.cc",
"select_file_dialog_factory.h",
"select_file_dialog_mac.h",
@@ -52,7 +48,13 @@ component("shell_dialogs") {
deps += [ "//ui/aura" ]
}
- if (is_android) {
+ if (is_android && !use_aura) {
+ sources += [
+ "android/shell_dialogs_jni_registrar.cc",
+ "android/shell_dialogs_jni_registrar.h",
+ "select_file_dialog_android.cc",
+ "select_file_dialog_android.h",
+ ]
deps += [
"//ui/android",
"//ui/android:ui_java",
@@ -62,6 +64,13 @@ component("shell_dialogs") {
libs = [ "jnigraphics" ]
}
+ if (is_android && use_aura) {
+ sources += [
+ "select_file_dialog_auraandroid.cc",
+ "select_file_dialog_auraandroid.h",
+ ]
+ }
+
if (is_win) {
deps += [ "//win8:metro_viewer" ]
}
diff --git a/ui/shell_dialogs/select_file_dialog_auraandroid.cc b/ui/shell_dialogs/select_file_dialog_auraandroid.cc
new file mode 100644
index 0000000..185f47e
--- /dev/null
+++ b/ui/shell_dialogs/select_file_dialog_auraandroid.cc
@@ -0,0 +1,56 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "select_file_dialog_auraandroid.h"
+
+#include "base/logging.h"
+
+namespace ui {
+
+// static
+SelectFileDialogImpl* SelectFileDialogImpl::Create(Listener* listener,
+ SelectFilePolicy* policy) {
+ return new SelectFileDialogImpl(listener, policy);
+}
+
+bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow) const {
+ return listener_;
+}
+
+void SelectFileDialogImpl::ListenerDestroyed() {
+ listener_ = NULL;
+}
+
+void SelectFileDialogImpl::SelectFileImpl(
+ SelectFileDialog::Type type,
+ const base::string16& title,
+ const base::FilePath& default_path,
+ const SelectFileDialog::FileTypeInfo* file_types,
+ int file_type_index,
+ const std::string& default_extension,
+ gfx::NativeWindow owning_window,
+ void* params) {
+ NOTIMPLEMENTED();
+}
+
+SelectFileDialogImpl::~SelectFileDialogImpl() {
+}
+
+SelectFileDialogImpl::SelectFileDialogImpl(Listener* listener,
+ SelectFilePolicy* policy)
+ : SelectFileDialog(listener, policy) {
+}
+
+bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+SelectFileDialog* CreateAndroidSelectFileDialog(
+ SelectFileDialog::Listener* listener,
+ SelectFilePolicy* policy) {
+ return SelectFileDialogImpl::Create(listener, policy);
+}
+
+} // namespace ui
diff --git a/ui/shell_dialogs/select_file_dialog_auraandroid.h b/ui/shell_dialogs/select_file_dialog_auraandroid.h
new file mode 100644
index 0000000..5b7a163
--- /dev/null
+++ b/ui/shell_dialogs/select_file_dialog_auraandroid.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_
+#define UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_
+
+#include "base/macros.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
+
+namespace ui {
+
+class SelectFileDialogImpl : public SelectFileDialog {
+ public:
+ static SelectFileDialogImpl* Create(Listener* listener,
+ SelectFilePolicy* policy);
+
+ // From SelectFileDialog
+ bool IsRunning(gfx::NativeWindow) const override;
+ void ListenerDestroyed() override;
+ void SelectFileImpl(SelectFileDialog::Type type,
+ const base::string16& title,
+ const base::FilePath& default_path,
+ const SelectFileDialog::FileTypeInfo* file_types,
+ int file_type_index,
+ const std::string& default_extension,
+ gfx::NativeWindow owning_window,
+ void* params) override;
+
+ protected:
+ ~SelectFileDialogImpl() override;
+
+ private:
+ SelectFileDialogImpl(Listener* listener, SelectFilePolicy* policy);
+
+ bool HasMultipleFileTypeChoicesImpl() override;
+
+ DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl);
+};
+
+SelectFileDialog* CreateAndroidSelectFileDialog(
+ SelectFileDialog::Listener* listener,
+ SelectFilePolicy* policy);
+
+} // namespace ui
+
+#endif // UI_SHELL_DIALOGS_ANDROID_SELECT_FILE_DIALOG_ANDROID_H_
+