Index: chrome/browser/ui/gtk/dialogs_common.cc |
=================================================================== |
--- chrome/browser/ui/gtk/dialogs_common.cc (revision 101188) |
+++ chrome/browser/ui/gtk/dialogs_common.cc (working copy) |
@@ -6,8 +6,10 @@ |
#include "chrome/browser/ui/gtk/dialogs_common.h" |
+#include "base/environment.h" |
#include "base/file_util.h" |
#include "base/message_loop.h" |
+#include "base/nix/xdg_util.h" |
#include "base/threading/thread.h" |
#include "base/threading/thread_restrictions.h" |
#include "content/browser/browser_thread.h" |
@@ -18,6 +20,13 @@ |
// static |
SelectFileDialog* SelectFileDialog::Create(Listener* listener) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ scoped_ptr<base::Environment> env(base::Environment::Create()); |
+ base::nix::DesktopEnvironment desktop = |
+ base::nix::GetDesktopEnvironment(env.get()); |
+ if (desktop == base::nix::DESKTOP_ENVIRONMENT_KDE3 || |
+ desktop == base::nix::DESKTOP_ENVIRONMENT_KDE4) { |
+ return SelectFileDialogImpl::NewSelectFileDialogImplKDE(listener); |
+ } |
return SelectFileDialogImpl::NewSelectFileDialogImplGTK(listener); |
} |