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

Side by Side Diff: components/sync/user_events/no_op_user_event_service.h

Issue 2909283003: [Sync] Split UserEventService into interface and impl, add fake impl, add unit tests. (Closed)
Patch Set: Added a NoOp service to handle OffTheRecord. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
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
5 #ifndef COMPONENTS_SYNC_USER_EVENTS_NO_OP_USER_EVENT_SERVICE_H_
6 #define COMPONENTS_SYNC_USER_EVENTS_NO_OP_USER_EVENT_SERVICE_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "components/sync/user_events/user_event_service.h"
13
14 namespace syncer {
15
16 class ModelTypeSyncBridge;
17
18 // This implementation is used when we know event should never be recorded,
19 // such as in incognito mode.
20 class NoOpUserEventService : public UserEventService {
21 public:
22 NoOpUserEventService();
23 ~NoOpUserEventService() override;
24
25 // UserEventService implementation.
26 void RecordUserEvent(
27 std::unique_ptr<sync_pb::UserEventSpecifics> specifics) override;
28 void RecordUserEvent(const sync_pb::UserEventSpecifics& specifics) override;
29 void RegisterDependentFieldTrial(
30 const std::string& trial_name,
31 sync_pb::UserEventSpecifics::EventCase event_case) override;
32 base::WeakPtr<ModelTypeSyncBridge> GetSyncBridge() override;
33
34 private:
35 DISALLOW_COPY_AND_ASSIGN(NoOpUserEventService);
36 };
37
38 } // namespace syncer
39
40 #endif // COMPONENTS_SYNC_USER_EVENTS_NO_OP_USER_EVENT_SERVICE_H_
OLDNEW
« no previous file with comments | « components/sync/user_events/fake_user_event_service.cc ('k') | components/sync/user_events/no_op_user_event_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698