| OLD | NEW |
| 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 // 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 "chrome/browser/ui/libgtkui/select_file_dialog_impl.h" | 7 #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h" |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 NO_KDE, | 21 NO_KDE, |
| 22 YES_KDE | 22 YES_KDE |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 UseKdeFileDialogStatus use_kde_ = UNKNOWN; | 25 UseKdeFileDialogStatus use_kde_ = UNKNOWN; |
| 26 | 26 |
| 27 } // namespace | 27 } // namespace |
| 28 | 28 |
| 29 namespace libgtkui { | 29 namespace libgtkui { |
| 30 | 30 |
| 31 base::FilePath* SelectFileDialogImpl::last_saved_path_ = NULL; | 31 base::FilePath* SelectFileDialogImpl::last_saved_path_ = nullptr; |
| 32 base::FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; | 32 base::FilePath* SelectFileDialogImpl::last_opened_path_ = nullptr; |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 ui::SelectFileDialog* SelectFileDialogImpl::Create( | 35 ui::SelectFileDialog* SelectFileDialogImpl::Create( |
| 36 ui::SelectFileDialog::Listener* listener, | 36 ui::SelectFileDialog::Listener* listener, |
| 37 ui::SelectFilePolicy* policy) { | 37 ui::SelectFilePolicy* policy) { |
| 38 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 38 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 39 if (use_kde_ == UNKNOWN) { | 39 if (use_kde_ == UNKNOWN) { |
| 40 // Start out assumimg we are not going to use KDE. | 40 // Start out assumimg we are not going to use KDE. |
| 41 use_kde_ = NO_KDE; | 41 use_kde_ = NO_KDE; |
| 42 | 42 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 type_(SELECT_NONE) { | 74 type_(SELECT_NONE) { |
| 75 if (!last_saved_path_) { | 75 if (!last_saved_path_) { |
| 76 last_saved_path_ = new base::FilePath(); | 76 last_saved_path_ = new base::FilePath(); |
| 77 last_opened_path_ = new base::FilePath(); | 77 last_opened_path_ = new base::FilePath(); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 SelectFileDialogImpl::~SelectFileDialogImpl() { } | 81 SelectFileDialogImpl::~SelectFileDialogImpl() { } |
| 82 | 82 |
| 83 void SelectFileDialogImpl::ListenerDestroyed() { | 83 void SelectFileDialogImpl::ListenerDestroyed() { |
| 84 listener_ = NULL; | 84 listener_ = nullptr; |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread( | 87 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread( |
| 88 const base::FilePath& path) { | 88 const base::FilePath& path) { |
| 89 base::ThreadRestrictions::ScopedAllowIO allow_io; | 89 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 90 return base::DirectoryExists(path); | 90 return base::DirectoryExists(path); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace libgtkui | 93 } // namespace libgtkui |
| OLD | NEW |