summaryrefslogtreecommitdiffstats
path: root/ui/base
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 21:23:10 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 21:23:10 +0000
commitec5f43302420c25042beb2b7b1d2ee2f67470885 (patch)
tree633a565aab13640a1bb112033fcd426a48b4d396 /ui/base
parentfa4f3668bd7046b74862bc8337e82e5c164dd91d (diff)
downloadchromium_src-ec5f43302420c25042beb2b7b1d2ee2f67470885.zip
chromium_src-ec5f43302420c25042beb2b7b1d2ee2f67470885.tar.gz
chromium_src-ec5f43302420c25042beb2b7b1d2ee2f67470885.tar.bz2
Use current gtk dialogs in linux_aura.
They payoff for the last month of refactoring: We now use the LinuxUI interface to generate gtk file selection dialogs from the shim library. We could theoretically make a Qt or EFL shim and get those desktops' native open dialogs. BUG=136909, 134167 TEST=none Review URL: https://chromiumcodereview.appspot.com/10829021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148813 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r--ui/base/dialogs/select_file_dialog.cc8
-rw-r--r--ui/base/linux_ui.h7
2 files changed, 13 insertions, 2 deletions
diff --git a/ui/base/dialogs/select_file_dialog.cc b/ui/base/dialogs/select_file_dialog.cc
index b35d0be..120faef 100644
--- a/ui/base/dialogs/select_file_dialog.cc
+++ b/ui/base/dialogs/select_file_dialog.cc
@@ -12,6 +12,7 @@
#include "ui/base/dialogs/select_file_dialog_factory.h"
#include "ui/base/dialogs/select_file_policy.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/linux_ui.h"
#if defined(OS_WIN)
#include "ui/base/dialogs/select_file_dialog_win.h"
@@ -67,9 +68,12 @@ SelectFileDialog* SelectFileDialog::Create(Listener* listener,
return dialog;
}
- // TODO(erg): Proxy to LinuxUI here.
+#if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
+ const ui::LinuxUI* linux_ui = ui::LinuxUI::instance();
+ if (linux_ui)
+ return linux_ui->CreateSelectFileDialog(listener, policy);
+#endif
- // TODO(erg): Add other OSs one by one here.
#if defined(OS_WIN) && !defined(USE_AURA)
// TODO(port): The windows people need this to work in aura, too.
return CreateWinSelectFileDialog(listener, policy);
diff --git a/ui/base/linux_ui.h b/ui/base/linux_ui.h
index 5332720..3fb34e5 100644
--- a/ui/base/linux_ui.h
+++ b/ui/base/linux_ui.h
@@ -5,6 +5,7 @@
#ifndef UI_BASE_LINUX_UI_H_
#define UI_BASE_LINUX_UI_H_
+#include "ui/base/dialogs/select_file_dialog.h"
#include "ui/base/ui_export.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -16,6 +17,7 @@ class Image;
}
namespace ui {
+class SelectFilePolicy;
// Adapter class with targets to render like different toolkits. Set by any
// project that wants to do linux desktop native rendering.
@@ -42,6 +44,11 @@ class UI_EXPORT LinuxUI {
virtual bool UseNativeTheme() const = 0;
virtual gfx::Image* GetThemeImageNamed(int id) const = 0;
virtual bool GetColor(int id, SkColor* color) const = 0;
+
+ // Returns a native file selection dialog.
+ virtual SelectFileDialog* CreateSelectFileDialog(
+ SelectFileDialog::Listener* listener,
+ SelectFilePolicy* policy) const = 0;
};
} // namespace ui