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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 // |has_enough_space|. | 593 // |has_enough_space|. |
594 void StartDownloadFileIfEnoughSpace(const GetFileFromCacheParams& params, | 594 void StartDownloadFileIfEnoughSpace(const GetFileFromCacheParams& params, |
595 const GURL& content_url, | 595 const GURL& content_url, |
596 const FilePath& cache_file_path, | 596 const FilePath& cache_file_path, |
597 bool* has_enough_space); | 597 bool* has_enough_space); |
598 | 598 |
599 // Helper function used to perform synchronous file search on UI thread. | 599 // Helper function used to perform synchronous file search on UI thread. |
600 void FindEntryByPathSyncOnUIThread(const FilePath& search_file_path, | 600 void FindEntryByPathSyncOnUIThread(const FilePath& search_file_path, |
601 const FindEntryCallback& callback); | 601 const FindEntryCallback& callback); |
602 | 602 |
603 // Changes state of hosted documents visibility, triggers directory refresh. | |
604 void SetHideHostedDocuments(bool hide); | |
605 | |
606 // Initializes preference change observer. | 603 // Initializes preference change observer. |
607 void InitializePreferenceObserver(); | 604 void InitializePreferenceObserver(); |
608 | 605 |
609 // Called when an entry is found for GetEntryInfoByPath(). | 606 // Called when an entry is found for GetEntryInfoByPath(). |
610 void OnGetEntryInfo(const GetEntryInfoCallback& callback, | 607 void OnGetEntryInfo(const GetEntryInfoCallback& callback, |
611 GDataFileError error, | 608 GDataFileError error, |
612 GDataEntry* entry); | 609 GDataEntry* entry); |
613 | 610 |
614 // Called when an entry is found for ReadDirectoryByPath(). | 611 // Called when an entry is found for ReadDirectoryByPath(). |
615 void OnReadDirectory(const ReadDirectoryCallback& callback, | 612 void OnReadDirectory(const ReadDirectoryCallback& callback, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 787 |
791 // The document service owned by GDataSystemService. | 788 // The document service owned by GDataSystemService. |
792 DocumentsServiceInterface* documents_service_; | 789 DocumentsServiceInterface* documents_service_; |
793 | 790 |
794 // The webapps registry owned by GDataSystemService. | 791 // The webapps registry owned by GDataSystemService. |
795 DriveWebAppsRegistryInterface* webapps_registry_; | 792 DriveWebAppsRegistryInterface* webapps_registry_; |
796 | 793 |
797 // Periodic timer for checking updates. | 794 // Periodic timer for checking updates. |
798 base::Timer update_timer_; | 795 base::Timer update_timer_; |
799 | 796 |
800 // True if hosted documents should be hidden. | |
801 bool hide_hosted_docs_; | |
802 | |
803 // The set of paths opened by OpenFile but not yet closed by CloseFile. | 797 // The set of paths opened by OpenFile but not yet closed by CloseFile. |
804 std::set<FilePath> open_files_; | 798 std::set<FilePath> open_files_; |
805 | 799 |
806 scoped_ptr<PrefChangeRegistrar> pref_registrar_; | 800 scoped_ptr<PrefChangeRegistrar> pref_registrar_; |
807 | 801 |
808 // The loader is used to load the feeds. | 802 // The loader is used to load the feeds. |
809 scoped_ptr<GDataWapiFeedLoader> feed_loader_; | 803 scoped_ptr<GDataWapiFeedLoader> feed_loader_; |
810 | 804 |
811 ObserverList<GDataFileSystemInterface::Observer> observers_; | 805 ObserverList<GDataFileSystemInterface::Observer> observers_; |
812 | 806 |
813 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 807 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
814 | 808 |
815 // WeakPtrFactory and WeakPtr bound to the UI thread. | 809 // WeakPtrFactory and WeakPtr bound to the UI thread. |
816 // Note: These should remain the last member so they'll be destroyed and | 810 // Note: These should remain the last member so they'll be destroyed and |
817 // invalidate the weak pointers before any other members are destroyed. | 811 // invalidate the weak pointers before any other members are destroyed. |
818 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 812 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
819 // Unlike other classes, we need this as we need this to redirect a task | 813 // Unlike other classes, we need this as we need this to redirect a task |
820 // from IO thread to UI thread. | 814 // from IO thread to UI thread. |
821 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 815 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
822 }; | 816 }; |
823 | 817 |
824 } // namespace gdata | 818 } // namespace gdata |
825 | 819 |
826 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 820 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |