| 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 #include "chrome/browser/chromeos/file_manager/open_util.h" | 5 #include "chrome/browser/chromeos/file_manager/open_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 ExecuteFileTaskForUrl(profile, chosen_task->task_descriptor(), url); | 170 ExecuteFileTaskForUrl(profile, chosen_task->task_descriptor(), url); |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| 174 // Used to implement OpenItem(). | 174 // Used to implement OpenItem(). |
| 175 void ContinueOpenItem(Profile* profile, | 175 void ContinueOpenItem(Profile* profile, |
| 176 const base::FilePath& file_path, | 176 const base::FilePath& file_path, |
| 177 base::PlatformFileError error) { | 177 base::File::Error error) { |
| 178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 179 | 179 |
| 180 if (error == base::PLATFORM_FILE_OK) { | 180 if (error == base::File::FILE_OK) { |
| 181 // A directory exists at |file_path|. Open it with the file manager. | 181 // A directory exists at |file_path|. Open it with the file manager. |
| 182 OpenFileManagerWithInternalActionId(profile, file_path, "open"); | 182 OpenFileManagerWithInternalActionId(profile, file_path, "open"); |
| 183 } else { | 183 } else { |
| 184 // |file_path| should be a file. Open it. | 184 // |file_path| should be a file. Open it. |
| 185 if (!OpenFile(profile, file_path)) | 185 if (!OpenFile(profile, file_path)) |
| 186 ShowWarningMessageBox(profile, file_path); | 186 ShowWarningMessageBox(profile, file_path); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 // Used to implement CheckIfDirectoryExists(). | 190 // Used to implement CheckIfDirectoryExists(). |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 base::Bind(&ContinueOpenItem, profile, file_path)); | 239 base::Bind(&ContinueOpenItem, profile, file_path)); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void ShowItemInFolder(Profile* profile, const base::FilePath& file_path) { | 242 void ShowItemInFolder(Profile* profile, const base::FilePath& file_path) { |
| 243 // This action changes the selection so we do not reuse existing tabs. | 243 // This action changes the selection so we do not reuse existing tabs. |
| 244 OpenFileManagerWithInternalActionId(profile, file_path, "select"); | 244 OpenFileManagerWithInternalActionId(profile, file_path, "select"); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace util | 247 } // namespace util |
| 248 } // namespace file_manager | 248 } // namespace file_manager |
| OLD | NEW |