| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // In the case of loading the root feed we use |root_feed_changestamp| as its | 102 // In the case of loading the root feed we use |root_feed_changestamp| as its |
| 103 // initial changestamp value since it does not come with that info. | 103 // initial changestamp value since it does not come with that info. |
| 104 // When done |load_feed_callback| is invoked. | 104 // When done |load_feed_callback| is invoked. |
| 105 // |entry_found_callback| is used only when this is invoked while searching | 105 // |entry_found_callback| is used only when this is invoked while searching |
| 106 // for file info, and is used in |load_feed_callback|. If successful, it will | 106 // for file info, and is used in |load_feed_callback|. If successful, it will |
| 107 // try to find the file upon retrieval completion. | 107 // try to find the file upon retrieval completion. |
| 108 // |should_fetch_multiple_feeds| is true iff don't want to stop feed loading | 108 // |should_fetch_multiple_feeds| is true iff don't want to stop feed loading |
| 109 // after we retrieve first feed chunk. | 109 // after we retrieve first feed chunk. |
| 110 // If invoked as a part of content search, query will be set in | 110 // If invoked as a part of content search, query will be set in |
| 111 // |search_query|. | 111 // |search_query|. |
| 112 // If |feed_to_load| is set, this is feed url that will be used to load feed. |
| 112 void LoadFromServer( | 113 void LoadFromServer( |
| 113 ContentOrigin initial_origin, | 114 ContentOrigin initial_origin, |
| 114 int start_changestamp, | 115 int start_changestamp, |
| 115 int root_feed_changestamp, | 116 int root_feed_changestamp, |
| 116 bool should_fetch_multiple_feeds, | 117 bool should_fetch_multiple_feeds, |
| 117 const FilePath& search_file_path, | 118 const FilePath& search_file_path, |
| 118 const std::string& search_query, | 119 const std::string& search_query, |
| 120 const GURL& feed_to_load, |
| 119 const std::string& directory_resource_id, | 121 const std::string& directory_resource_id, |
| 120 const FindEntryCallback& entry_found_callback, | 122 const FindEntryCallback& entry_found_callback, |
| 121 const LoadDocumentFeedCallback& feed_load_callback); | 123 const LoadDocumentFeedCallback& feed_load_callback); |
| 122 | 124 |
| 123 // Retrieves account metadata and determines from the last change timestamp | 125 // Retrieves account metadata and determines from the last change timestamp |
| 124 // if the feed content loading from the server needs to be initiated. | 126 // if the feed content loading from the server needs to be initiated. |
| 125 void ReloadFromServerIfNeeded( | 127 void ReloadFromServerIfNeeded( |
| 126 ContentOrigin initial_origin, | 128 ContentOrigin initial_origin, |
| 127 int local_changestamp, | 129 int local_changestamp, |
| 128 const FilePath& search_file_path, | 130 const FilePath& search_file_path, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 GDataFileSystemInterface::Observer* observer) OVERRIDE; | 215 GDataFileSystemInterface::Observer* observer) OVERRIDE; |
| 214 virtual void StartUpdates() OVERRIDE; | 216 virtual void StartUpdates() OVERRIDE; |
| 215 virtual void StopUpdates() OVERRIDE; | 217 virtual void StopUpdates() OVERRIDE; |
| 216 virtual void NotifyFileSystemMounted() OVERRIDE; | 218 virtual void NotifyFileSystemMounted() OVERRIDE; |
| 217 virtual void NotifyFileSystemToBeUnmounted() OVERRIDE; | 219 virtual void NotifyFileSystemToBeUnmounted() OVERRIDE; |
| 218 virtual void CheckForUpdates() OVERRIDE; | 220 virtual void CheckForUpdates() OVERRIDE; |
| 219 virtual void GetEntryInfoByResourceId( | 221 virtual void GetEntryInfoByResourceId( |
| 220 const std::string& resource_id, | 222 const std::string& resource_id, |
| 221 const GetEntryInfoWithFilePathCallback& callback) OVERRIDE; | 223 const GetEntryInfoWithFilePathCallback& callback) OVERRIDE; |
| 222 virtual void Search(const std::string& search_query, | 224 virtual void Search(const std::string& search_query, |
| 225 const GURL& next_feed, |
| 223 const SearchCallback& callback) OVERRIDE; | 226 const SearchCallback& callback) OVERRIDE; |
| 224 virtual void TransferFileFromRemoteToLocal( | 227 virtual void TransferFileFromRemoteToLocal( |
| 225 const FilePath& remote_src_file_path, | 228 const FilePath& remote_src_file_path, |
| 226 const FilePath& local_dest_file_path, | 229 const FilePath& local_dest_file_path, |
| 227 const FileOperationCallback& callback) OVERRIDE; | 230 const FileOperationCallback& callback) OVERRIDE; |
| 228 virtual void TransferFileFromLocalToRemote( | 231 virtual void TransferFileFromLocalToRemote( |
| 229 const FilePath& local_src_file_path, | 232 const FilePath& local_src_file_path, |
| 230 const FilePath& remote_dest_file_path, | 233 const FilePath& remote_dest_file_path, |
| 231 const FileOperationCallback& callback) OVERRIDE; | 234 const FileOperationCallback& callback) OVERRIDE; |
| 232 virtual void OpenFile(const FilePath& file_path, | 235 virtual void OpenFile(const FilePath& file_path, |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 // Called when GDataUploader::UploadUpdatedFile() is completed for | 818 // Called when GDataUploader::UploadUpdatedFile() is completed for |
| 816 // UpdateFileByResourceId(). | 819 // UpdateFileByResourceId(). |
| 817 void OnUpdatedFileUploaded( | 820 void OnUpdatedFileUploaded( |
| 818 const FileOperationCallback& callback, | 821 const FileOperationCallback& callback, |
| 819 GDataFileError error, | 822 GDataFileError error, |
| 820 scoped_ptr<UploadFileInfo> upload_file_info); | 823 scoped_ptr<UploadFileInfo> upload_file_info); |
| 821 | 824 |
| 822 // The following functions are used to forward calls to asynchronous public | 825 // The following functions are used to forward calls to asynchronous public |
| 823 // member functions to UI thread. | 826 // member functions to UI thread. |
| 824 void SearchAsyncOnUIThread(const std::string& search_query, | 827 void SearchAsyncOnUIThread(const std::string& search_query, |
| 828 const GURL& next_feed, |
| 825 const SearchCallback& callback); | 829 const SearchCallback& callback); |
| 826 void OpenFileOnUIThread(const FilePath& file_path, | 830 void OpenFileOnUIThread(const FilePath& file_path, |
| 827 const OpenFileCallback& callback); | 831 const OpenFileCallback& callback); |
| 828 void CloseFileOnUIThread(const FilePath& file_path, | 832 void CloseFileOnUIThread(const FilePath& file_path, |
| 829 const FileOperationCallback& callback); | 833 const FileOperationCallback& callback); |
| 830 void CopyOnUIThread(const FilePath& src_file_path, | 834 void CopyOnUIThread(const FilePath& src_file_path, |
| 831 const FilePath& dest_file_path, | 835 const FilePath& dest_file_path, |
| 832 const FileOperationCallback& callback); | 836 const FileOperationCallback& callback); |
| 833 void MoveOnUIThread(const FilePath& src_file_path, | 837 void MoveOnUIThread(const FilePath& src_file_path, |
| 834 const FilePath& dest_file_path, | 838 const FilePath& dest_file_path, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 // invalidate the weak pointers before any other members are destroyed. | 974 // invalidate the weak pointers before any other members are destroyed. |
| 971 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 975 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
| 972 // Unlike other classes, we need this as we need this to redirect a task | 976 // Unlike other classes, we need this as we need this to redirect a task |
| 973 // from IO thread to UI thread. | 977 // from IO thread to UI thread. |
| 974 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 978 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
| 975 }; | 979 }; |
| 976 | 980 |
| 977 } // namespace gdata | 981 } // namespace gdata |
| 978 | 982 |
| 979 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 983 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |