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

Unified Diff: jingle/notifier/listener/xmpp_push_client.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 side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/listener/xmpp_push_client.cc
diff --git a/jingle/notifier/listener/xmpp_push_client.cc b/jingle/notifier/listener/xmpp_push_client.cc
index b1272f33602718c49bc0a4745fa90b9d1ca30423..66521f209256615fba92ffeefda29a03af984448 100644
--- a/jingle/notifier/listener/xmpp_push_client.cc
+++ b/jingle/notifier/listener/xmpp_push_client.cc
@@ -58,11 +58,19 @@ void XmppPushClient::OnConnect(
}
}
-void XmppPushClient::OnDisconnect() {
+void XmppPushClient::OnTransientDisconnection() {
DCHECK(non_thread_safe_.CalledOnValidThread());
base_task_.reset();
FOR_EACH_OBSERVER(PushClientObserver, observers_,
- OnNotificationStateChange(false));
+ OnNotificationsDisabled(TRANSIENT_NOTIFICATION_ERROR));
+}
+
+void XmppPushClient::OnCredentialsRejected() {
+ DCHECK(non_thread_safe_.CalledOnValidThread());
+ base_task_.reset();
+ FOR_EACH_OBSERVER(
+ PushClientObserver, observers_,
+ OnNotificationsDisabled(NOTIFICATION_CREDENTIALS_REJECTED));
}
void XmppPushClient::OnNotificationReceived(
@@ -75,13 +83,13 @@ void XmppPushClient::OnNotificationReceived(
void XmppPushClient::OnSubscribed() {
DCHECK(non_thread_safe_.CalledOnValidThread());
FOR_EACH_OBSERVER(PushClientObserver, observers_,
- OnNotificationStateChange(true));
+ OnNotificationsEnabled());
}
void XmppPushClient::OnSubscriptionError() {
DCHECK(non_thread_safe_.CalledOnValidThread());
FOR_EACH_OBSERVER(PushClientObserver, observers_,
- OnNotificationStateChange(false));
+ OnNotificationsDisabled(TRANSIENT_NOTIFICATION_ERROR));
}
void XmppPushClient::AddObserver(PushClientObserver* observer) {

Powered by Google App Engine
This is Rietveld 408576698