Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / sync_backend_host_core.h
index d246255..4ae89c7 100644 (file)
@@ -11,6 +11,7 @@
 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
 #include "components/sync_driver/system_encryptor.h"
 #include "sync/internal_api/public/base/cancelation_signal.h"
+#include "sync/internal_api/public/sessions/type_debug_info_observer.h"
 #include "sync/internal_api/public/sync_encryption_handler.h"
 #include "url/gurl.h"
 
@@ -79,7 +80,8 @@ struct DoConfigureSyncerTypes {
 class SyncBackendHostCore
     : public base::RefCountedThreadSafe<SyncBackendHostCore>,
       public syncer::SyncEncryptionHandler::Observer,
-      public syncer::SyncManager::Observer {
+      public syncer::SyncManager::Observer,
+      public syncer::TypeDebugInfoObserver {
  public:
   SyncBackendHostCore(const std::string& name,
        const base::FilePath& sync_data_folder_path,
@@ -121,6 +123,17 @@ class SyncBackendHostCore
   virtual void OnPassphraseTypeChanged(syncer::PassphraseType type,
                                        base::Time passphrase_time) OVERRIDE;
 
+  // TypeDebugInfoObserver implementation
+  virtual void OnCommitCountersUpdated(
+      syncer::ModelType type,
+      const syncer::CommitCounters& counters) OVERRIDE;
+  virtual void OnUpdateCountersUpdated(
+      syncer::ModelType type,
+      const syncer::UpdateCounters& counters) OVERRIDE;
+  virtual void OnStatusCountersUpdated(
+      syncer::ModelType type,
+      const syncer::StatusCounters& counters) OVERRIDE;
+
   // Forwards an invalidation state change to the sync manager.
   void DoOnInvalidatorStateChange(syncer::InvalidatorState state);
 
@@ -209,7 +222,16 @@ class SyncBackendHostCore
     return synced_device_tracker_.get();
   }
 
-  void SetForwardProtocolEvents(bool forward);
+  void SendBufferedProtocolEventsAndEnableForwarding();
+  void DisableProtocolEventForwarding();
+
+  // Enables the forwarding of directory type debug counters to the
+  // SyncBackendHost.  Also requests that updates to all counters be
+  // emitted right away to initialize any new listeners' states.
+  void EnableDirectoryTypeDebugInfoForwarding();
+
+  // Disables forwarding of directory type debug counters.
+  void DisableDirectoryTypeDebugInfoForwarding();
 
   // Delete the sync data folder to cleanup backend data.  Happens the first
   // time sync is enabled for a user (to prevent accidentally reusing old
@@ -222,6 +244,12 @@ class SyncBackendHostCore
     return &release_request_context_signal_;
   }
 
+  void GetAllNodesForTypes(
+      syncer::ModelTypeSet types,
+      scoped_refptr<base::SequencedTaskRunner> task_runner,
+      base::Callback<void(const std::vector<syncer::ModelType>& type,
+                          ScopedVector<base::ListValue>) > callback);
+
  private:
   friend class base::RefCountedThreadSafe<SyncBackendHostCore>;
   friend class SyncBackendHostForProfileSyncTest;