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.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 parser.file_system()->GetMetadata( | 171 parser.file_system()->GetMetadata( |
172 parser.file_path(), | 172 parser.file_path(), |
173 chromeos::file_system_provider::ProvidedFileSystemInterface:: | 173 chromeos::file_system_provider::ProvidedFileSystemInterface:: |
174 METADATA_FIELD_DEFAULT, | 174 METADATA_FIELD_DEFAULT, |
175 base::Bind(&GetMimeTypeAfterGetMetadataForProvidedFileSystem, | 175 base::Bind(&GetMimeTypeAfterGetMetadataForProvidedFileSystem, |
176 callback)); | 176 callback)); |
177 return; | 177 return; |
178 } | 178 } |
179 | 179 |
180 // As a fallback just return success with an empty mime type value. | 180 // As a fallback just return failure with an empty mime type value. |
181 content::BrowserThread::PostTask( | 181 content::BrowserThread::PostTask( |
182 content::BrowserThread::UI, | 182 content::BrowserThread::UI, |
183 FROM_HERE, | 183 FROM_HERE, |
184 base::Bind(callback, true /* success */, std::string())); | 184 base::Bind(callback, false /* failure */, std::string())); |
185 } | 185 } |
186 | 186 |
187 void IsNonNativeLocalPathDirectory( | 187 void IsNonNativeLocalPathDirectory( |
188 Profile* profile, | 188 Profile* profile, |
189 const base::FilePath& path, | 189 const base::FilePath& path, |
190 const base::Callback<void(bool)>& callback) { | 190 const base::Callback<void(bool)>& callback) { |
191 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 191 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
192 DCHECK(IsUnderNonNativeLocalPath(profile, path)); | 192 DCHECK(IsUnderNonNativeLocalPath(profile, path)); |
193 | 193 |
194 GURL url; | 194 GURL url; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 content::BrowserThread::IO, | 238 content::BrowserThread::IO, |
239 FROM_HERE, | 239 FROM_HERE, |
240 base::Bind(&PrepareFileOnIOThread, | 240 base::Bind(&PrepareFileOnIOThread, |
241 make_scoped_refptr(context), | 241 make_scoped_refptr(context), |
242 context->CrackURL(url), | 242 context->CrackURL(url), |
243 google_apis::CreateRelayCallback(callback))); | 243 google_apis::CreateRelayCallback(callback))); |
244 } | 244 } |
245 | 245 |
246 } // namespace util | 246 } // namespace util |
247 } // namespace file_manager | 247 } // namespace file_manager |
OLD | NEW |