Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/gdata_file_system.h |
| diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h |
| index f82c9e0dbca38d5aae74bb6eba541524e5602521..e22022c22356ea6af41d24ef09ca830701a340cf 100644 |
| --- a/chrome/browser/chromeos/gdata/gdata_file_system.h |
| +++ b/chrome/browser/chromeos/gdata/gdata_file_system.h |
| @@ -24,8 +24,10 @@ |
| #include "chrome/browser/chromeos/gdata/gdata_params.h" |
| #include "chrome/browser/chromeos/gdata/gdata_parser.h" |
| #include "chrome/browser/chromeos/gdata/gdata_uploader.h" |
| +#include "chrome/browser/prefs/pref_set_observer.h" |
| #include "chrome/browser/profiles/profile_keyed_service.h" |
| #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| +#include "content/public/browser/notification_observer.h" |
| namespace base { |
| class WaitableEvent; |
| @@ -395,10 +397,14 @@ class GDataFileSystemInterface { |
| DocumentEntry* entry, |
| const FilePath& file_content_path, |
| FileOperationType cache_operation) = 0; |
| + |
| + // Returns true if hosted documents should be hidden. |
| + virtual bool hide_hosted_documents() = 0; |
|
achuithb
2012/04/04 19:14:11
Shouldn't this be HideHostedDocuments?
zel
2012/04/04 20:16:57
it's a simple getter, unlike its setter method tha
achuithb
2012/04/04 20:46:19
I'm not sure what the rule is with getters when th
|
| }; |
| // The production implementation of GDataFileSystemInterface. |
| -class GDataFileSystem : public GDataFileSystemInterface { |
| +class GDataFileSystem : public GDataFileSystemInterface, |
| + public content::NotificationObserver { |
| public: |
| GDataFileSystem(Profile* profile, |
| DocumentsServiceInterface* documents_service); |
| @@ -475,6 +481,12 @@ class GDataFileSystem : public GDataFileSystemInterface { |
| DocumentEntry* entry, |
| const FilePath& file_content_path, |
| FileOperationType cache_operation) OVERRIDE; |
| + virtual bool hide_hosted_documents() OVERRIDE; |
| + |
| + // content::NotificationObserver implementation. |
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| private: |
| friend class GDataUploader; |
| @@ -1206,6 +1218,12 @@ class GDataFileSystem : public GDataFileSystemInterface { |
| const std::string& resource_id, |
| const std::string& md5); |
| + // Changes state of hosted documents visibility, triggers directory refresh. |
| + void SetHideHostedDocuments(bool hide); |
| + |
| + // Initializes preference change observer. |
| + void InitializePreferenceObserver(); |
| + |
| scoped_ptr<GDataRootDirectory> root_; |
| // This guards regular states. |
| @@ -1234,6 +1252,11 @@ class GDataFileSystem : public GDataFileSystemInterface { |
| int num_pending_tasks_; |
| base::Lock num_pending_tasks_lock_; |
| + // True if hosted documents should be hidden. |
| + bool hide_hosted_docs_; |
| + |
| + scoped_ptr<PrefSetObserver> pref_observer_; |
| + |
| // WeakPtrFactory and WeakPtr bound to the UI thread. |
| scoped_ptr<base::WeakPtrFactory<GDataFileSystem> > ui_weak_ptr_factory_; |
| base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |