| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "ui/base/dialogs/select_file_dialog.h" | 5 #include "ui/base/dialogs/select_file_dialog.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/base/dialogs/selected_file_info.h" | 11 #include "ui/base/dialogs/selected_file_info.h" |
| 12 #include "ui/base/dialogs/select_file_dialog_factory.h" | 12 #include "ui/base/dialogs/select_file_dialog_factory.h" |
| 13 #include "ui/base/dialogs/select_file_policy.h" | 13 #include "ui/base/dialogs/select_file_policy.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/base/linux_ui.h" | 15 #include "ui/base/linux_ui.h" |
| 16 | 16 |
| 17 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
| 18 #include "ui/base/dialogs/select_file_dialog_win.h" | 18 #include "ui/base/dialogs/select_file_dialog_win.h" |
| 19 #elif defined(OS_MACOSX) | 19 #elif defined(OS_MACOSX) |
| 20 #include "ui/base/dialogs/select_file_dialog_mac.h" | 20 #include "ui/base/dialogs/select_file_dialog_mac.h" |
| 21 #elif defined(TOOLKIT_GTK) | 21 #elif defined(TOOLKIT_GTK) |
| 22 #include "ui/base/dialogs/gtk/select_file_dialog_impl.h" | 22 #include "ui/base/dialogs/gtk/select_file_dialog_impl.h" |
| 23 #elif defined(OS_ANDROID) |
| 24 #include "ui/base/dialogs/select_file_dialog_android.h" |
| 23 #endif | 25 #endif |
| 24 | 26 |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 // Optional dialog factory. Leaked. | 29 // Optional dialog factory. Leaked. |
| 28 ui::SelectFileDialogFactory* dialog_factory_ = NULL; | 30 ui::SelectFileDialogFactory* dialog_factory_ = NULL; |
| 29 | 31 |
| 30 } // namespace | 32 } // namespace |
| 31 | 33 |
| 32 namespace ui { | 34 namespace ui { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #endif | 79 #endif |
| 78 | 80 |
| 79 #if defined(OS_WIN) && !defined(USE_AURA) | 81 #if defined(OS_WIN) && !defined(USE_AURA) |
| 80 // TODO(port): The windows people need this to work in aura, too. | 82 // TODO(port): The windows people need this to work in aura, too. |
| 81 return CreateWinSelectFileDialog(listener, policy); | 83 return CreateWinSelectFileDialog(listener, policy); |
| 82 #elif defined(OS_MACOSX) && !defined(USE_AURA) | 84 #elif defined(OS_MACOSX) && !defined(USE_AURA) |
| 83 return CreateMacSelectFileDialog(listener, policy); | 85 return CreateMacSelectFileDialog(listener, policy); |
| 84 #elif defined(TOOLKIT_GTK) | 86 #elif defined(TOOLKIT_GTK) |
| 85 return CreateLinuxSelectFileDialog(listener, policy); | 87 return CreateLinuxSelectFileDialog(listener, policy); |
| 86 #elif defined(OS_ANDROID) | 88 #elif defined(OS_ANDROID) |
| 87 // see crbug.com/116131 to track implemenation of SelectFileDialog | 89 return CreateAndroidSelectFileDialog(listener, policy); |
| 88 NOTIMPLEMENTED(); | |
| 89 #endif | 90 #endif |
| 90 | 91 |
| 91 return NULL; | 92 return NULL; |
| 92 } | 93 } |
| 93 | 94 |
| 94 void SelectFileDialog::SelectFile(Type type, | 95 void SelectFileDialog::SelectFile(Type type, |
| 95 const string16& title, | 96 const string16& title, |
| 96 const FilePath& default_path, | 97 const FilePath& default_path, |
| 97 const FileTypeInfo* file_types, | 98 const FileTypeInfo* file_types, |
| 98 int file_type_index, | 99 int file_type_index, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 132 } |
| 132 | 133 |
| 133 SelectFileDialog::~SelectFileDialog() {} | 134 SelectFileDialog::~SelectFileDialog() {} |
| 134 | 135 |
| 135 void SelectFileDialog::CancelFileSelection(void* params) { | 136 void SelectFileDialog::CancelFileSelection(void* params) { |
| 136 if (listener_) | 137 if (listener_) |
| 137 listener_->FileSelectionCanceled(params); | 138 listener_->FileSelectionCanceled(params); |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace ui | 141 } // namespace ui |
| OLD | NEW |