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/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
6 | 6 |
7 #include "apps/saved_files_service.h" | 7 #include "apps/saved_files_service.h" |
8 #include "apps/shell_window.h" | 8 #include "apps/shell_window.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 // smoothly, all accessed paths need to be registered in the list of | 651 // smoothly, all accessed paths need to be registered in the list of |
652 // external mount points. | 652 // external mount points. |
653 fileapi::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( | 653 fileapi::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( |
654 name, fileapi::kFileSystemTypeNativeLocal, path); | 654 name, fileapi::kFileSystemTypeNativeLocal, path); |
655 } | 655 } |
656 | 656 |
657 void FileSystemChooseEntryFunction::SetInitialPathOnFileThread( | 657 void FileSystemChooseEntryFunction::SetInitialPathOnFileThread( |
658 const base::FilePath& suggested_name, | 658 const base::FilePath& suggested_name, |
659 const base::FilePath& previous_path) { | 659 const base::FilePath& previous_path) { |
660 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 660 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
661 if (!previous_path.empty() && file_util::DirectoryExists(previous_path)) { | 661 if (!previous_path.empty() && base::DirectoryExists(previous_path)) { |
662 initial_path_ = previous_path.Append(suggested_name); | 662 initial_path_ = previous_path.Append(suggested_name); |
663 } else { | 663 } else { |
664 base::FilePath documents_dir; | 664 base::FilePath documents_dir; |
665 if (PathService::Get(chrome::DIR_USER_DOCUMENTS, &documents_dir)) { | 665 if (PathService::Get(chrome::DIR_USER_DOCUMENTS, &documents_dir)) { |
666 initial_path_ = documents_dir.Append(suggested_name); | 666 initial_path_ = documents_dir.Append(suggested_name); |
667 } else { | 667 } else { |
668 initial_path_ = suggested_name; | 668 initial_path_ = suggested_name; |
669 } | 669 } |
670 } | 670 } |
671 } | 671 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 // ID that was passed to restoreEntry. | 872 // ID that was passed to restoreEntry. |
873 RegisterFileSystemAndSendResponseWithIdOverride( | 873 RegisterFileSystemAndSendResponseWithIdOverride( |
874 file_entry->path, | 874 file_entry->path, |
875 file_entry->writable ? WRITABLE : READ_ONLY, | 875 file_entry->writable ? WRITABLE : READ_ONLY, |
876 file_entry->id); | 876 file_entry->id); |
877 } | 877 } |
878 return true; | 878 return true; |
879 } | 879 } |
880 | 880 |
881 } // namespace extensions | 881 } // namespace extensions |
OLD | NEW |