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

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: Make gtk window transient to aura window 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
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 // TODO(erg): Proxy to LinuxUI here.
Daniel Erat 2012/07/27 17:21:56 nit: remove TODO?
72 #if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
73 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance();
74 if (linux_ui)
75 return linux_ui->CreateSelectFileDialog(listener, policy);
76 #endif
71 77
72 // TODO(erg): Add other OSs one by one here. 78 // TODO(erg): Add other OSs one by one here.
73 #if defined(OS_WIN) && !defined(USE_AURA) 79 #if defined(OS_WIN) && !defined(USE_AURA)
74 // TODO(port): The windows people need this to work in aura, too. 80 // TODO(port): The windows people need this to work in aura, too.
75 return CreateWinSelectFileDialog(listener, policy); 81 return CreateWinSelectFileDialog(listener, policy);
76 #elif defined(OS_MACOSX) && !defined(USE_AURA) 82 #elif defined(OS_MACOSX) && !defined(USE_AURA)
77 return CreateMacSelectFileDialog(listener, policy); 83 return CreateMacSelectFileDialog(listener, policy);
78 #elif defined(TOOLKIT_GTK) 84 #elif defined(TOOLKIT_GTK)
79 return CreateLinuxSelectFileDialog(listener, policy); 85 return CreateLinuxSelectFileDialog(listener, policy);
80 #elif defined(OS_ANDROID) 86 #elif defined(OS_ANDROID)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 131 }
126 132
127 SelectFileDialog::~SelectFileDialog() {} 133 SelectFileDialog::~SelectFileDialog() {}
128 134
129 void SelectFileDialog::CancelFileSelection(void* params) { 135 void SelectFileDialog::CancelFileSelection(void* params) {
130 if (listener_) 136 if (listener_)
131 listener_->FileSelectionCanceled(params); 137 listener_->FileSelectionCanceled(params);
132 } 138 }
133 139
134 } // namespace ui 140 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698