| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 common select dialog functionality between GTK and KDE. | 5 // This file implements common select dialog functionality between GTK and KDE. |
| 6 | 6 |
| 7 #include "ui/shell_dialogs/gtk/select_file_dialog_impl.h" | 7 #include "ui/shell_dialogs/gtk/select_file_dialog_impl.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/nix/xdg_util.h" | 11 #include "base/nix/xdg_util.h" |
| 12 #include "base/threading/thread_restrictions.h" | 12 #include "base/threading/thread_restrictions.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 enum UseKdeFileDialogStatus { | 16 enum UseKdeFileDialogStatus { |
| 17 UNKNOWN, | 17 UNKNOWN, |
| 18 NO_KDE, | 18 NO_KDE, |
| 19 YES_KDE | 19 YES_KDE |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 UseKdeFileDialogStatus use_kde_ = UNKNOWN; | 22 UseKdeFileDialogStatus use_kde_ = UNKNOWN; |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 namespace ui { | 26 namespace ui { |
| 27 | 27 |
| 28 FilePath* SelectFileDialogImpl::last_saved_path_ = NULL; | 28 base::FilePath* SelectFileDialogImpl::last_saved_path_ = NULL; |
| 29 FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; | 29 base::FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; |
| 30 | 30 |
| 31 // static | 31 // static |
| 32 SelectFileDialog* CreateLinuxSelectFileDialog( | 32 SelectFileDialog* CreateLinuxSelectFileDialog( |
| 33 SelectFileDialog::Listener* listener, | 33 SelectFileDialog::Listener* listener, |
| 34 SelectFilePolicy* policy) { | 34 SelectFilePolicy* policy) { |
| 35 if (use_kde_ == UNKNOWN) { | 35 if (use_kde_ == UNKNOWN) { |
| 36 // Start out assumimg we are not going to use KDE. | 36 // Start out assumimg we are not going to use KDE. |
| 37 use_kde_ = NO_KDE; | 37 use_kde_ = NO_KDE; |
| 38 | 38 |
| 39 // Check to see if KDE is the desktop environment. | 39 // Check to see if KDE is the desktop environment. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return parents_.find(parent_window) != parents_.end(); | 83 return parents_.find(parent_window) != parents_.end(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread( | 86 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread( |
| 87 const base::FilePath& path) { | 87 const base::FilePath& path) { |
| 88 base::ThreadRestrictions::ScopedAllowIO allow_io; | 88 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 89 return file_util::DirectoryExists(path); | 89 return file_util::DirectoryExists(path); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace ui | 92 } // namespace ui |
| OLD | NEW |