| 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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
| 17 #include "base/timer.h" | 17 #include "base/timer.h" |
| 18 #include "chrome/browser/api/prefs/pref_change_registrar.h" | 18 #include "chrome/browser/api/prefs/pref_change_registrar.h" |
| 19 #include "chrome/browser/chromeos/gdata/drive_resource_metadata.h" |
| 19 #include "chrome/browser/chromeos/gdata/gdata_cache.h" | 20 #include "chrome/browser/chromeos/gdata/gdata_cache.h" |
| 20 #include "chrome/browser/chromeos/gdata/gdata_directory_service.h" | |
| 21 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 21 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
| 22 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" | 22 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" |
| 23 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h" | 23 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h" |
| 24 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" | 24 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" |
| 25 #include "content/public/browser/notification_observer.h" | 25 #include "content/public/browser/notification_observer.h" |
| 26 | 26 |
| 27 namespace base { | 27 namespace base { |
| 28 class SequencedTaskRunner; | 28 class SequencedTaskRunner; |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // Callback for handling document copy attempt. | 417 // Callback for handling document copy attempt. |
| 418 // |callback| must not be null. | 418 // |callback| must not be null. |
| 419 void OnCopyDocumentCompleted(const FilePath& dir_path, | 419 void OnCopyDocumentCompleted(const FilePath& dir_path, |
| 420 const FileOperationCallback& callback, | 420 const FileOperationCallback& callback, |
| 421 GDataErrorCode status, | 421 GDataErrorCode status, |
| 422 scoped_ptr<base::Value> data); | 422 scoped_ptr<base::Value> data); |
| 423 | 423 |
| 424 // Callback for handling an attempt to move a file or directory from the | 424 // Callback for handling an attempt to move a file or directory from the |
| 425 // root directory to another directory on the server side. This function | 425 // root directory to another directory on the server side. This function |
| 426 // moves |entry| to the root directory on the client side with | 426 // moves |entry| to the root directory on the client side with |
| 427 // GDataDirectoryService::MoveEntryToDirectory(). | 427 // DriveResourceMetadata::MoveEntryToDirectory(). |
| 428 // | 428 // |
| 429 // |callback| must not be null. | 429 // |callback| must not be null. |
| 430 void OnMoveEntryFromRootDirectoryCompleted( | 430 void OnMoveEntryFromRootDirectoryCompleted( |
| 431 const FileOperationCallback& callback, | 431 const FileOperationCallback& callback, |
| 432 const FilePath& file_path, | 432 const FilePath& file_path, |
| 433 const FilePath& dir_path, | 433 const FilePath& dir_path, |
| 434 GDataErrorCode status, | 434 GDataErrorCode status, |
| 435 const GURL& document_url); | 435 const GURL& document_url); |
| 436 | 436 |
| 437 // Callback for handling account metadata fetch. | 437 // Callback for handling account metadata fetch. |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 // OnGetEntryInfoCompleteForGetFileByPath and | 660 // OnGetEntryInfoCompleteForGetFileByPath and |
| 661 // OnGetEntryInfoCompleteForOpenFile. | 661 // OnGetEntryInfoCompleteForOpenFile. |
| 662 void GetResolvedFileByPath( | 662 void GetResolvedFileByPath( |
| 663 const FilePath& file_path, | 663 const FilePath& file_path, |
| 664 const GetFileCallback& get_file_callback, | 664 const GetFileCallback& get_file_callback, |
| 665 const GetContentCallback& get_content_callback, | 665 const GetContentCallback& get_content_callback, |
| 666 GDataFileError error, | 666 GDataFileError error, |
| 667 const DriveEntryProto* entry_proto); | 667 const DriveEntryProto* entry_proto); |
| 668 | 668 |
| 669 // Part of UpdateFileByResourceId(). Called when | 669 // Part of UpdateFileByResourceId(). Called when |
| 670 // GDataDirectory::GetEntryInfoByResourceId() is complete. | 670 // DriveDirectory::GetEntryInfoByResourceId() is complete. |
| 671 // |callback| must not be null. | 671 // |callback| must not be null. |
| 672 void UpdateFileByEntryInfo( | 672 void UpdateFileByEntryInfo( |
| 673 const FileOperationCallback& callback, | 673 const FileOperationCallback& callback, |
| 674 GDataFileError error, | 674 GDataFileError error, |
| 675 const FilePath& /* drive_file_path */, | 675 const FilePath& /* drive_file_path */, |
| 676 scoped_ptr<DriveEntryProto> entry_proto); | 676 scoped_ptr<DriveEntryProto> entry_proto); |
| 677 | 677 |
| 678 // Part of UpdateFileByResourceId(). | 678 // Part of UpdateFileByResourceId(). |
| 679 // Called when GDataCache::GetFileOnUIThread() is completed for | 679 // Called when GDataCache::GetFileOnUIThread() is completed for |
| 680 // UpdateFileByResourceId(). | 680 // UpdateFileByResourceId(). |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 const std::string& md5, | 829 const std::string& md5, |
| 830 const FilePath& local_cache_path); | 830 const FilePath& local_cache_path); |
| 831 void CheckLocalModificationAndRunAfterGetFileInfo( | 831 void CheckLocalModificationAndRunAfterGetFileInfo( |
| 832 scoped_ptr<DriveEntryProto> entry_proto, | 832 scoped_ptr<DriveEntryProto> entry_proto, |
| 833 const GetEntryInfoCallback& callback, | 833 const GetEntryInfoCallback& callback, |
| 834 base::PlatformFileInfo* file_info, | 834 base::PlatformFileInfo* file_info, |
| 835 bool* get_file_info_result); | 835 bool* get_file_info_result); |
| 836 | 836 |
| 837 // All members should be accessed only on UI thread. Do not post tasks to | 837 // All members should be accessed only on UI thread. Do not post tasks to |
| 838 // other threads with base::Unretained(this). | 838 // other threads with base::Unretained(this). |
| 839 scoped_ptr<GDataDirectoryService> directory_service_; | 839 scoped_ptr<DriveResourceMetadata> resource_metadata_; |
| 840 | 840 |
| 841 // The profile hosts the GDataFileSystem via GDataSystemService. | 841 // The profile hosts the GDataFileSystem via GDataSystemService. |
| 842 Profile* profile_; | 842 Profile* profile_; |
| 843 | 843 |
| 844 // The cache owned by GDataSystemService. | 844 // The cache owned by GDataSystemService. |
| 845 GDataCache* cache_; | 845 GDataCache* cache_; |
| 846 | 846 |
| 847 // The uploader owned by GDataSystemService. | 847 // The uploader owned by GDataSystemService. |
| 848 GDataUploaderInterface* uploader_; | 848 GDataUploaderInterface* uploader_; |
| 849 | 849 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 876 // invalidate the weak pointers before any other members are destroyed. | 876 // invalidate the weak pointers before any other members are destroyed. |
| 877 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 877 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
| 878 // Unlike other classes, we need this as we need this to redirect a task | 878 // Unlike other classes, we need this as we need this to redirect a task |
| 879 // from IO thread to UI thread. | 879 // from IO thread to UI thread. |
| 880 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 880 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
| 881 }; | 881 }; |
| 882 | 882 |
| 883 } // namespace gdata | 883 } // namespace gdata |
| 884 | 884 |
| 885 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 885 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |