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

Side by Side Diff: ui/base/dialogs/select_file_dialog.cc

Issue 10829021: Use current gtk dialogs in linux_aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: derat nits Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc ('k') | ui/base/linux_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16
16 #if defined(OS_WIN) 17 #if defined(OS_WIN)
17 #include "ui/base/dialogs/select_file_dialog_win.h" 18 #include "ui/base/dialogs/select_file_dialog_win.h"
18 #elif defined(OS_MACOSX) 19 #elif defined(OS_MACOSX)
19 #include "ui/base/dialogs/select_file_dialog_mac.h" 20 #include "ui/base/dialogs/select_file_dialog_mac.h"
20 #elif defined(TOOLKIT_GTK) 21 #elif defined(TOOLKIT_GTK)
21 #include "ui/base/dialogs/gtk/select_file_dialog_impl.h" 22 #include "ui/base/dialogs/gtk/select_file_dialog_impl.h"
22 #endif 23 #endif
23 24
24 namespace { 25 namespace {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 61
61 // static 62 // static
62 SelectFileDialog* SelectFileDialog::Create(Listener* listener, 63 SelectFileDialog* SelectFileDialog::Create(Listener* listener,
63 ui::SelectFilePolicy* policy) { 64 ui::SelectFilePolicy* policy) {
64 if (dialog_factory_) { 65 if (dialog_factory_) {
65 SelectFileDialog* dialog = dialog_factory_->Create(listener, policy); 66 SelectFileDialog* dialog = dialog_factory_->Create(listener, policy);
66 if (dialog) 67 if (dialog)
67 return dialog; 68 return dialog;
68 } 69 }
69 70
70 // TODO(erg): Proxy to LinuxUI here. 71 #if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
72 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance();
73 if (linux_ui)
74 return linux_ui->CreateSelectFileDialog(listener, policy);
75 #endif
71 76
72 // TODO(erg): Add other OSs one by one here.
73 #if defined(OS_WIN) && !defined(USE_AURA) 77 #if defined(OS_WIN) && !defined(USE_AURA)
74 // TODO(port): The windows people need this to work in aura, too. 78 // TODO(port): The windows people need this to work in aura, too.
75 return CreateWinSelectFileDialog(listener, policy); 79 return CreateWinSelectFileDialog(listener, policy);
76 #elif defined(OS_MACOSX) && !defined(USE_AURA) 80 #elif defined(OS_MACOSX) && !defined(USE_AURA)
77 return CreateMacSelectFileDialog(listener, policy); 81 return CreateMacSelectFileDialog(listener, policy);
78 #elif defined(TOOLKIT_GTK) 82 #elif defined(TOOLKIT_GTK)
79 return CreateLinuxSelectFileDialog(listener, policy); 83 return CreateLinuxSelectFileDialog(listener, policy);
80 #elif defined(OS_ANDROID) 84 #elif defined(OS_ANDROID)
81 // see crbug.com/116131 to track implemenation of SelectFileDialog 85 // see crbug.com/116131 to track implemenation of SelectFileDialog
82 NOTIMPLEMENTED(); 86 NOTIMPLEMENTED();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 129 }
126 130
127 SelectFileDialog::~SelectFileDialog() {} 131 SelectFileDialog::~SelectFileDialog() {}
128 132
129 void SelectFileDialog::CancelFileSelection(void* params) { 133 void SelectFileDialog::CancelFileSelection(void* params) {
130 if (listener_) 134 if (listener_)
131 listener_->FileSelectionCanceled(params); 135 listener_->FileSelectionCanceled(params);
132 } 136 }
133 137
134 } // namespace ui 138 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc ('k') | ui/base/linux_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698