no_op_user_event_service.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2017 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.
  4. #ifndef COMPONENTS_SYNC_USER_EVENTS_NO_OP_USER_EVENT_SERVICE_H_
  5. #define COMPONENTS_SYNC_USER_EVENTS_NO_OP_USER_EVENT_SERVICE_H_
  6. #include <memory>
  7. #include "components/sync_user_events/user_event_service.h"
  8. namespace syncer {
  9. // This implementation is used when we know event should never be recorded,
  10. // such as in incognito mode.
  11. class NoOpUserEventService : public UserEventService {
  12. public:
  13. NoOpUserEventService();
  14. NoOpUserEventService(const NoOpUserEventService&) = delete;
  15. NoOpUserEventService& operator=(const NoOpUserEventService&) = delete;
  16. ~NoOpUserEventService() override;
  17. // UserEventService implementation.
  18. void RecordUserEvent(
  19. std::unique_ptr<sync_pb::UserEventSpecifics> specifics) override;
  20. void RecordUserEvent(const sync_pb::UserEventSpecifics& specifics) override;
  21. base::WeakPtr<syncer::ModelTypeControllerDelegate> GetControllerDelegate()
  22. override;
  23. };
  24. } // namespace syncer
  25. #endif // COMPONENTS_SYNC_USER_EVENTS_NO_OP_USER_EVENT_SERVICE_H_