Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / glue / shared_change_processor_ref.h
blobb6039b90428a3cc13959ca3fa2118179e33bf20f
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_REF_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_REF_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/sync/glue/shared_change_processor.h"
11 #include "sync/api/sync_change_processor.h"
12 #include "sync/api/sync_error_factory.h"
14 namespace browser_sync {
16 // A syncer::SyncChangeProcessor stub for interacting with a refcounted
17 // SharedChangeProcessor.
18 class SharedChangeProcessorRef : public syncer::SyncChangeProcessor,
19 public syncer::SyncErrorFactory {
20 public:
21 SharedChangeProcessorRef(
22 const scoped_refptr<browser_sync::SharedChangeProcessor>&
23 change_processor);
24 virtual ~SharedChangeProcessorRef();
26 // syncer::SyncChangeProcessor implementation.
27 virtual syncer::SyncError ProcessSyncChanges(
28 const tracked_objects::Location& from_here,
29 const syncer::SyncChangeList& change_list) OVERRIDE;
30 virtual syncer::SyncDataList GetAllSyncData(
31 syncer::ModelType type) const OVERRIDE;
33 // syncer::SyncErrorFactory implementation.
34 virtual syncer::SyncError CreateAndUploadError(
35 const tracked_objects::Location& from_here,
36 const std::string& message) OVERRIDE;
38 // Default copy and assign welcome (and safe due to refcounted-ness).
40 private:
41 scoped_refptr<browser_sync::SharedChangeProcessor> change_processor_;
44 } // namespace browser_sync
46 #endif // CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_REF_H_