Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.h

Issue 9947002: Wired preference that hides hosted documents for the directory view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 77d440af592ff4f7a1c084779cc6e0b9f06d2307..4d5bbd350797433780c90524cd362daa80393a18 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_change_registrar.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;
};
// 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;
@@ -1258,6 +1270,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.
@@ -1286,6 +1304,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_;
+
+ PrefChangeRegistrar pref_registrar_;
+
// WeakPtrFactory and WeakPtr bound to the UI thread.
scoped_ptr<base::WeakPtrFactory<GDataFileSystem> > ui_weak_ptr_factory_;
base::WeakPtr<GDataFileSystem> ui_weak_ptr_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698