diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 11:04:19 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 11:04:19 +0000 |
commit | 1e0dadb1fd64bf29d92e73d1f94fea0b0348b86e (patch) | |
tree | bce8e5ef660bf2bd400920a634cb47a329cdbbbf /sync | |
parent | bb45262b5519feaf0b6e7deada458e0bc7552b37 (diff) | |
download | chromium_src-1e0dadb1fd64bf29d92e73d1f94fea0b0348b86e.zip chromium_src-1e0dadb1fd64bf29d92e73d1f94fea0b0348b86e.tar.gz chromium_src-1e0dadb1fd64bf29d92e73d1f94fea0b0348b86e.tar.bz2 |
[Sync] Add synced notifications shim
The shim fires JS events when told to by sync, and interfaces with the
synced notifications private api to get sync data.
This also goes ahead and disabled synced notifications by default while it's
in development.
BUG=372556
Review URL: https://codereview.chromium.org/306293009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r-- | sync/api/fake_sync_change_processor.cc | 34 | ||||
-rw-r--r-- | sync/api/fake_sync_change_processor.h | 20 |
2 files changed, 47 insertions, 7 deletions
diff --git a/sync/api/fake_sync_change_processor.cc b/sync/api/fake_sync_change_processor.cc index 83d669e..2721650 100644 --- a/sync/api/fake_sync_change_processor.cc +++ b/sync/api/fake_sync_change_processor.cc @@ -15,22 +15,46 @@ FakeSyncChangeProcessor::~FakeSyncChangeProcessor() {} syncer::SyncError FakeSyncChangeProcessor::ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) { - change_list_.insert( - change_list_.end(), change_list.begin(), change_list.end()); + changes_.insert( + changes_.end(), change_list.begin(), change_list.end()); return syncer::SyncError(); } syncer::SyncDataList FakeSyncChangeProcessor::GetAllSyncData( syncer::ModelType type) const { - return syncer::SyncDataList(); + return data_; +} + +syncer::SyncError FakeSyncChangeProcessor::UpdateDataTypeContext( + ModelType type, + ContextRefreshStatus refresh_status, + const std::string& context) { + context_ = context; + return syncer::SyncError(); } const syncer::SyncChangeList& FakeSyncChangeProcessor::changes() const { - return change_list_; + return changes_; } syncer::SyncChangeList& FakeSyncChangeProcessor::changes() { - return change_list_; + return changes_; +} + +const syncer::SyncDataList& FakeSyncChangeProcessor::data() const { + return data_; +} + +syncer::SyncDataList& FakeSyncChangeProcessor::data() { + return data_; +} + +const std::string& FakeSyncChangeProcessor::context() const { + return context_; +} + +std::string& FakeSyncChangeProcessor::context() { + return context_; } } // namespace syncer diff --git a/sync/api/fake_sync_change_processor.h b/sync/api/fake_sync_change_processor.h index d844493..521f018 100644 --- a/sync/api/fake_sync_change_processor.h +++ b/sync/api/fake_sync_change_processor.h @@ -24,15 +24,31 @@ class FakeSyncChangeProcessor : public SyncChangeProcessor { // SyncChangeProcessor implementation. // - // Returns an empty list. + // Returns data(). virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const OVERRIDE; + // SyncChangeProcessor implementation. + // + // Updates context(). + virtual syncer::SyncError UpdateDataTypeContext( + ModelType type, + ContextRefreshStatus refresh_status, + const std::string& context) OVERRIDE; + virtual const syncer::SyncChangeList& changes() const; virtual syncer::SyncChangeList& changes(); + virtual const syncer::SyncDataList& data() const; + virtual syncer::SyncDataList& data(); + + virtual const std::string& context() const; + virtual std::string& context(); + private: - syncer::SyncChangeList change_list_; + syncer::SyncChangeList changes_; + syncer::SyncDataList data_; + std::string context_; DISALLOW_COPY_AND_ASSIGN(FakeSyncChangeProcessor); }; |