OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file implements commond select dialog functionality between GTK and KDE. | 5 // This file implements commond select dialog functionality between GTK and KDE. |
6 | 6 |
7 #include "chrome/browser/ui/gtk/dialogs_common.h" | 7 #include "chrome/browser/ui/gtk/dialogs_common.h" |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/nix/xdg_util.h" | 12 #include "base/nix/xdg_util.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 | 16 |
| 17 using content::BrowserThread; |
| 18 |
17 FilePath* SelectFileDialogImpl::last_saved_path_ = NULL; | 19 FilePath* SelectFileDialogImpl::last_saved_path_ = NULL; |
18 FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; | 20 FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; |
19 | 21 |
20 // static | 22 // static |
21 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { | 23 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { |
22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
23 scoped_ptr<base::Environment> env(base::Environment::Create()); | 25 scoped_ptr<base::Environment> env(base::Environment::Create()); |
24 base::nix::DesktopEnvironment desktop = | 26 base::nix::DesktopEnvironment desktop = |
25 base::nix::GetDesktopEnvironment(env.get()); | 27 base::nix::GetDesktopEnvironment(env.get()); |
26 if (desktop == base::nix::DESKTOP_ENVIRONMENT_KDE3 || | 28 if (desktop == base::nix::DESKTOP_ENVIRONMENT_KDE3 || |
(...skipping 21 matching lines...) Expand all Loading... |
48 | 50 |
49 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow parent_window) const { | 51 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow parent_window) const { |
50 return parents_.find(parent_window) != parents_.end(); | 52 return parents_.find(parent_window) != parents_.end(); |
51 } | 53 } |
52 | 54 |
53 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread(const FilePath& path) { | 55 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread(const FilePath& path) { |
54 base::ThreadRestrictions::ScopedAllowIO allow_io; | 56 base::ThreadRestrictions::ScopedAllowIO allow_io; |
55 return file_util::DirectoryExists(path); | 57 return file_util::DirectoryExists(path); |
56 } | 58 } |
57 | 59 |
OLD | NEW |