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

Side by Side Diff: jingle/notifier/listener/fake_push_client_observer.cc

Issue 10545170: [Sync] Propagate XMPP auth errors to SyncNotifierObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix deps, win compile error Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "jingle/notifier/listener/fake_push_client_observer.h" 5 #include "jingle/notifier/listener/fake_push_client_observer.h"
6 6
7 namespace notifier { 7 namespace notifier {
8 8
9 FakePushClientObserver::FakePushClientObserver() 9 FakePushClientObserver::FakePushClientObserver()
10 : notifications_enabled_(false) {} 10 :last_notifications_disabled_reason_(DEFAULT_NOTIFICATION_ERROR) {}
11 11
12 FakePushClientObserver::~FakePushClientObserver() {} 12 FakePushClientObserver::~FakePushClientObserver() {}
13 13
14 void FakePushClientObserver::OnNotificationStateChange( 14 void FakePushClientObserver::OnNotificationsEnabled() {
15 bool notifications_enabled) { 15 last_notifications_disabled_reason_ = NO_NOTIFICATION_ERROR;
16 notifications_enabled_ = notifications_enabled; 16 }
17
18 void FakePushClientObserver::OnNotificationsDisabled(
19 NotificationsDisabledReason reason) {
20 last_notifications_disabled_reason_ = reason;
17 } 21 }
18 22
19 void FakePushClientObserver::OnIncomingNotification( 23 void FakePushClientObserver::OnIncomingNotification(
20 const Notification& notification) { 24 const Notification& notification) {
21 last_incoming_notification_ = notification; 25 last_incoming_notification_ = notification;
22 } 26 }
23 27
24 bool FakePushClientObserver::notifications_enabled() const { 28 NotificationsDisabledReason
25 return notifications_enabled_; 29 FakePushClientObserver::last_notifications_disabled_reason() const {
30 return last_notifications_disabled_reason_;
26 } 31 }
27 32
28 const Notification& 33 const Notification&
29 FakePushClientObserver::last_incoming_notification() const { 34 FakePushClientObserver::last_incoming_notification() const {
30 return last_incoming_notification_; 35 return last_incoming_notification_;
31 } 36 }
32 37
33 } // namespace notifier 38 } // namespace notifier
34 39
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698