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/drive/file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/file_system_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const base::FilePath tmp_directory = | 316 const base::FilePath tmp_directory = |
317 cache_root_directory.AppendASCII("tmp"); | 317 cache_root_directory.AppendASCII("tmp"); |
318 if (!file_util::PathExists(persistent_directory)) | 318 if (!file_util::PathExists(persistent_directory)) |
319 return; | 319 return; |
320 | 320 |
321 const base::FilePath cache_file_directory = | 321 const base::FilePath cache_file_directory = |
322 cache_root_directory.Append(kCacheFileDirectory); | 322 cache_root_directory.Append(kCacheFileDirectory); |
323 | 323 |
324 // Move all files inside "persistent" to "files". | 324 // Move all files inside "persistent" to "files". |
325 MoveAllFilesFromDirectory(persistent_directory, cache_file_directory); | 325 MoveAllFilesFromDirectory(persistent_directory, cache_file_directory); |
326 file_util::Delete(persistent_directory, true /* recursive */); | 326 base::Delete(persistent_directory, true /* recursive */); |
327 | 327 |
328 // Move all files inside "tmp" to "files". | 328 // Move all files inside "tmp" to "files". |
329 MoveAllFilesFromDirectory(tmp_directory, cache_file_directory); | 329 MoveAllFilesFromDirectory(tmp_directory, cache_file_directory); |
330 } | 330 } |
331 | 331 |
332 void PrepareWritableFileAndRun(Profile* profile, | 332 void PrepareWritableFileAndRun(Profile* profile, |
333 const base::FilePath& path, | 333 const base::FilePath& path, |
334 const OpenFileCallback& callback) { | 334 const OpenFileCallback& callback) { |
335 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 335 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
336 DCHECK(!callback.is_null()); | 336 DCHECK(!callback.is_null()); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 GURL ReadUrlFromGDocFile(const base::FilePath& file_path) { | 434 GURL ReadUrlFromGDocFile(const base::FilePath& file_path) { |
435 return GURL(ReadStringFromGDocFile(file_path, "url")); | 435 return GURL(ReadStringFromGDocFile(file_path, "url")); |
436 } | 436 } |
437 | 437 |
438 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) { | 438 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) { |
439 return ReadStringFromGDocFile(file_path, "resource_id"); | 439 return ReadStringFromGDocFile(file_path, "resource_id"); |
440 } | 440 } |
441 | 441 |
442 } // namespace util | 442 } // namespace util |
443 } // namespace drive | 443 } // namespace drive |
OLD | NEW |