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

Side by Side Diff: ui/shell_dialogs/select_file_dialog.cc

Issue 12315139: Sort out build dependencies for LinuxUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment Created 7 years, 9 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 | « ui/shell_dialogs/select_file_dialog.h ('k') | ui/ui.gyp » ('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/shell_dialogs/select_file_dialog.h" 5 #include "ui/shell_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/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
12 #include "ui/shell_dialogs/select_file_dialog_factory.h" 12 #include "ui/shell_dialogs/select_file_dialog_factory.h"
13 #include "ui/shell_dialogs/select_file_policy.h" 13 #include "ui/shell_dialogs/select_file_policy.h"
14 #include "ui/shell_dialogs/selected_file_info.h" 14 #include "ui/shell_dialogs/selected_file_info.h"
15 #include "ui/shell_dialogs/shell_dialogs_delegate.h" 15 #include "ui/shell_dialogs/shell_dialogs_delegate.h"
16 16
17 #if defined(OS_WIN) 17 #if defined(OS_WIN)
18 #include "ui/shell_dialogs/select_file_dialog_win.h" 18 #include "ui/shell_dialogs/select_file_dialog_win.h"
19 #elif defined(OS_MACOSX) 19 #elif defined(OS_MACOSX)
20 #include "ui/shell_dialogs/select_file_dialog_mac.h" 20 #include "ui/shell_dialogs/select_file_dialog_mac.h"
21 #elif defined(TOOLKIT_GTK) 21 #elif defined(TOOLKIT_GTK)
22 #include "ui/shell_dialogs/gtk/select_file_dialog_impl.h" 22 #include "ui/shell_dialogs/gtk/select_file_dialog_impl.h"
23 #elif defined(OS_ANDROID) 23 #elif defined(OS_ANDROID)
24 #include "ui/shell_dialogs/select_file_dialog_android.h" 24 #include "ui/shell_dialogs/select_file_dialog_android.h"
25 #elif defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX) 25 #elif defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
26 #include "ui/shell_dialogs/linux_ui_shell_dialog.h" 26 #include "ui/shell_dialogs/linux_shell_dialog.h"
27 #endif 27 #endif
28 28
29 namespace { 29 namespace {
30 30
31 // Optional dialog factory. Leaked. 31 // Optional dialog factory. Leaked.
32 ui::SelectFileDialogFactory* dialog_factory_ = NULL; 32 ui::SelectFileDialogFactory* dialog_factory_ = NULL;
33 33
34 // The global shell dialogs delegate. 34 // The global shell dialogs delegate.
35 ui::ShellDialogsDelegate* g_shell_dialogs_delegate_ = NULL; 35 ui::ShellDialogsDelegate* g_shell_dialogs_delegate_ = NULL;
36 36
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 scoped_refptr<SelectFileDialog> SelectFileDialog::Create( 72 scoped_refptr<SelectFileDialog> SelectFileDialog::Create(
73 Listener* listener, 73 Listener* listener,
74 ui::SelectFilePolicy* policy) { 74 ui::SelectFilePolicy* policy) {
75 if (dialog_factory_) { 75 if (dialog_factory_) {
76 SelectFileDialog* dialog = dialog_factory_->Create(listener, policy); 76 SelectFileDialog* dialog = dialog_factory_->Create(listener, policy);
77 if (dialog) 77 if (dialog)
78 return dialog; 78 return dialog;
79 } 79 }
80 80
81 #if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX) 81 #if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
82 const ui::LinuxUIShellDialog* linux_ui = 82 const ui::LinuxShellDialog* shell_dialogs = ui::LinuxShellDialog::instance();
83 static_cast<const ui::LinuxUIShellDialog*>(ui::LinuxUI::instance()); 83 if (shell_dialogs)
84 if (linux_ui) 84 return shell_dialogs->CreateSelectFileDialog(listener, policy);
85 return linux_ui->CreateSelectFileDialog(listener, policy);
86 #endif 85 #endif
87 86
88 #if defined(OS_WIN) 87 #if defined(OS_WIN)
89 // TODO(ananta) 88 // TODO(ananta)
90 // Fix this for Chrome ASH on Windows. 89 // Fix this for Chrome ASH on Windows.
91 return CreateWinSelectFileDialog(listener, policy); 90 return CreateWinSelectFileDialog(listener, policy);
92 #elif defined(OS_MACOSX) && !defined(USE_AURA) 91 #elif defined(OS_MACOSX) && !defined(USE_AURA)
93 return CreateMacSelectFileDialog(listener, policy); 92 return CreateMacSelectFileDialog(listener, policy);
94 #elif defined(TOOLKIT_GTK) 93 #elif defined(TOOLKIT_GTK)
95 return CreateLinuxSelectFileDialog(listener, policy); 94 return CreateLinuxSelectFileDialog(listener, policy);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void SelectFileDialog::CancelFileSelection(void* params) { 149 void SelectFileDialog::CancelFileSelection(void* params) {
151 if (listener_) 150 if (listener_)
152 listener_->FileSelectionCanceled(params); 151 listener_->FileSelectionCanceled(params);
153 } 152 }
154 153
155 ShellDialogsDelegate* SelectFileDialog::GetShellDialogsDelegate() { 154 ShellDialogsDelegate* SelectFileDialog::GetShellDialogsDelegate() {
156 return g_shell_dialogs_delegate_; 155 return g_shell_dialogs_delegate_;
157 } 156 }
158 157
159 } // namespace ui 158 } // namespace ui
OLDNEW
« no previous file with comments | « ui/shell_dialogs/select_file_dialog.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698