| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/filesystem_api_util.h" | 5 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/chromeos/drive/file_errors.h" | 10 #include "chrome/browser/chromeos/drive/file_errors.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 base::Bind(callback, false)); | 164 base::Bind(callback, false)); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 | 167 |
| 168 util::CheckIfDirectoryExists( | 168 util::CheckIfDirectoryExists( |
| 169 GetFileSystemContextForExtensionId(profile, kFileManagerAppId), | 169 GetFileSystemContextForExtensionId(profile, kFileManagerAppId), |
| 170 url, | 170 url, |
| 171 base::Bind(&BoolCallbackAsFileErrorCallback, callback)); | 171 base::Bind(&BoolCallbackAsFileErrorCallback, callback)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void PrepareNonNativeLocalPathWritableFile( | 174 void PrepareNonNativeLocalFileForWritableApp( |
| 175 Profile* profile, | 175 Profile* profile, |
| 176 const base::FilePath& path, | 176 const base::FilePath& path, |
| 177 const base::Callback<void(bool)>& callback) { | 177 const base::Callback<void(bool)>& callback) { |
| 178 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 178 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 179 DCHECK(IsUnderNonNativeLocalPath(profile, path)); | 179 DCHECK(IsUnderNonNativeLocalPath(profile, path)); |
| 180 | 180 |
| 181 GURL url; | 181 GURL url; |
| 182 if (!util::ConvertAbsoluteFilePathToFileSystemUrl( | 182 if (!util::ConvertAbsoluteFilePathToFileSystemUrl( |
| 183 profile, path, kFileManagerAppId, &url)) { | 183 profile, path, kFileManagerAppId, &url)) { |
| 184 // Posting to the current thread, so that we always call back asynchronously | 184 // Posting to the current thread, so that we always call back asynchronously |
| (...skipping 16 matching lines...) Expand all Loading... |
| 201 content::BrowserThread::IO, | 201 content::BrowserThread::IO, |
| 202 FROM_HERE, | 202 FROM_HERE, |
| 203 base::Bind(&PrepareFileOnIOThread, | 203 base::Bind(&PrepareFileOnIOThread, |
| 204 make_scoped_refptr(context), | 204 make_scoped_refptr(context), |
| 205 context->CrackURL(url), | 205 context->CrackURL(url), |
| 206 google_apis::CreateRelayCallback(callback))); | 206 google_apis::CreateRelayCallback(callback))); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace util | 209 } // namespace util |
| 210 } // namespace file_manager | 210 } // namespace file_manager |
| OLD | NEW |