OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "sync/notifier/fake_sync_notifier_observer.h" | |
6 | |
7 namespace syncer { | |
8 | |
9 FakeSyncNotifierObserver::FakeSyncNotifierObserver() | |
10 : reason_(TRANSIENT_NOTIFICATION_ERROR), | |
11 last_source_(LOCAL_NOTIFICATION), | |
12 notification_count_(0) {} | |
13 | |
14 FakeSyncNotifierObserver::~FakeSyncNotifierObserver() {} | |
15 | |
16 NotificationsDisabledReason | |
17 FakeSyncNotifierObserver::GetNotificationsDisabledReason() const { | |
18 return reason_; | |
19 } | |
20 | |
21 const ObjectIdStateMap& | |
22 FakeSyncNotifierObserver::GetLastNotificationIdStateMap() const { | |
23 return last_id_state_map_; | |
24 } | |
25 | |
26 IncomingNotificationSource | |
27 FakeSyncNotifierObserver::GetLastNotificationSource() const { | |
28 return last_source_; | |
29 } | |
30 | |
31 int FakeSyncNotifierObserver::GetNotificationCount() const { | |
32 return notification_count_; | |
33 } | |
34 | |
35 void FakeSyncNotifierObserver::OnNotificationsEnabled() { | |
36 reason_ = NO_NOTIFICATION_ERROR; | |
37 } | |
38 | |
39 void FakeSyncNotifierObserver::OnNotificationsDisabled( | |
40 NotificationsDisabledReason reason) { | |
41 reason_ = reason; | |
42 } | |
43 | |
44 void FakeSyncNotifierObserver::OnIncomingNotification( | |
45 const ObjectIdStateMap& id_state_map, | |
46 IncomingNotificationSource source) { | |
47 last_id_state_map_ = id_state_map; | |
48 last_source_ = source; | |
49 ++notification_count_; | |
50 } | |
51 | |
52 } // namespace syncer | |
OLD | NEW |