| 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> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 virtual void OnDocumentFeedFetched(int num_accumulated_entries) OVERRIDE; | 134 virtual void OnDocumentFeedFetched(int num_accumulated_entries) OVERRIDE; |
| 135 virtual void OnFeedFromServerLoaded() OVERRIDE; | 135 virtual void OnFeedFromServerLoaded() OVERRIDE; |
| 136 | 136 |
| 137 // Used in tests to load the root feed from the cache. | 137 // Used in tests to load the root feed from the cache. |
| 138 void LoadRootFeedFromCacheForTesting(); | 138 void LoadRootFeedFromCacheForTesting(); |
| 139 | 139 |
| 140 // Used in tests to update the file system from |feed_list|. | 140 // Used in tests to update the file system from |feed_list|. |
| 141 // See also the comment at GDataWapiFeedLoader::UpdateFromFeed(). | 141 // See also the comment at GDataWapiFeedLoader::UpdateFromFeed(). |
| 142 GDataFileError UpdateFromFeedForTesting( | 142 GDataFileError UpdateFromFeedForTesting( |
| 143 const std::vector<DocumentFeed*>& feed_list, | 143 const std::vector<DocumentFeed*>& feed_list, |
| 144 int start_changestamp, | 144 int64 start_changestamp, |
| 145 int root_feed_changestamp); | 145 int64 root_feed_changestamp); |
| 146 | 146 |
| 147 private: | 147 private: |
| 148 friend class GDataFileSystemTest; | 148 friend class GDataFileSystemTest; |
| 149 FRIEND_TEST_ALL_PREFIXES(GDataFileSystemTest, | 149 FRIEND_TEST_ALL_PREFIXES(GDataFileSystemTest, |
| 150 FindFirstMissingParentDirectory); | 150 FindFirstMissingParentDirectory); |
| 151 | 151 |
| 152 // Defines possible search results of FindFirstMissingParentDirectory(). | 152 // Defines possible search results of FindFirstMissingParentDirectory(). |
| 153 enum FindMissingDirectoryResult { | 153 enum FindMissingDirectoryResult { |
| 154 // Target directory found, it's not a directory. | 154 // Target directory found, it's not a directory. |
| 155 FOUND_INVALID, | 155 FOUND_INVALID, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 const FilePath& dir_path, | 440 const FilePath& dir_path, |
| 441 GDataErrorCode status, | 441 GDataErrorCode status, |
| 442 const GURL& document_url); | 442 const GURL& document_url); |
| 443 | 443 |
| 444 // Callback for handling account metadata fetch. | 444 // Callback for handling account metadata fetch. |
| 445 void OnGetAvailableSpace( | 445 void OnGetAvailableSpace( |
| 446 const GetAvailableSpaceCallback& callback, | 446 const GetAvailableSpaceCallback& callback, |
| 447 GDataErrorCode status, | 447 GDataErrorCode status, |
| 448 scoped_ptr<base::Value> data); | 448 scoped_ptr<base::Value> data); |
| 449 | 449 |
| 450 // Callback for handling Drive V2 about resource fetch. |
| 451 void OnGetQuotaStats( |
| 452 const GetAvailableSpaceCallback& callback, |
| 453 GDataErrorCode status, |
| 454 scoped_ptr<base::Value> data); |
| 455 |
| 450 // Callback for handling document remove attempt. | 456 // Callback for handling document remove attempt. |
| 451 void OnRemovedDocument( | 457 void OnRemovedDocument( |
| 452 const FileOperationCallback& callback, | 458 const FileOperationCallback& callback, |
| 453 const FilePath& file_path, | 459 const FilePath& file_path, |
| 454 GDataErrorCode status, | 460 GDataErrorCode status, |
| 455 const GURL& document_url); | 461 const GURL& document_url); |
| 456 | 462 |
| 457 // Callback for handling directory create requests. | 463 // Callback for handling directory create requests. |
| 458 void OnCreateDirectoryCompleted( | 464 void OnCreateDirectoryCompleted( |
| 459 const CreateDirectoryParams& params, | 465 const CreateDirectoryParams& params, |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 // invalidate the weak pointers before any other members are destroyed. | 823 // invalidate the weak pointers before any other members are destroyed. |
| 818 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 824 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
| 819 // Unlike other classes, we need this as we need this to redirect a task | 825 // Unlike other classes, we need this as we need this to redirect a task |
| 820 // from IO thread to UI thread. | 826 // from IO thread to UI thread. |
| 821 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 827 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
| 822 }; | 828 }; |
| 823 | 829 |
| 824 } // namespace gdata | 830 } // namespace gdata |
| 825 | 831 |
| 826 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 832 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |