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

Side by Side Diff: sync/notifier/push_client_channel.cc

Issue 140513002: Client-to-server messages in GCMNetworkChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
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 "sync/notifier/push_client_channel.h" 5 #include "sync/notifier/push_client_channel.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "jingle/notifier/listener/push_client.h" 8 #include "jingle/notifier/listener/push_client.h"
9 9
10 namespace syncer { 10 namespace syncer {
(...skipping 30 matching lines...) Expand all
41 notifier::Recipient recipient; 41 notifier::Recipient recipient;
42 recipient.to = kBotJid; 42 recipient.to = kBotJid;
43 notifier::Notification notification; 43 notifier::Notification notification;
44 notification.channel = kChannelName; 44 notification.channel = kChannelName;
45 notification.recipients.push_back(recipient); 45 notification.recipients.push_back(recipient);
46 notification.data = encoded_message; 46 notification.data = encoded_message;
47 push_client_->SendNotification(notification); 47 push_client_->SendNotification(notification);
48 } 48 }
49 49
50 void PushClientChannel::OnNotificationsEnabled() { 50 void PushClientChannel::OnNotificationsEnabled() {
51 NotifyStateChange(INVALIDATIONS_ENABLED); 51 SetNetworkState(INVALIDATIONS_ENABLED);
52 } 52 }
53 53
54 void PushClientChannel::OnNotificationsDisabled( 54 void PushClientChannel::OnNotificationsDisabled(
55 notifier::NotificationsDisabledReason reason) { 55 notifier::NotificationsDisabledReason reason) {
56 NotifyStateChange(FromNotifierReason(reason)); 56 SetNetworkState(FromNotifierReason(reason));
57 } 57 }
58 58
59 void PushClientChannel::OnIncomingNotification( 59 void PushClientChannel::OnIncomingNotification(
60 const notifier::Notification& notification) { 60 const notifier::Notification& notification) {
61 DeliverIncomingMessage(notification.data); 61 DeliverIncomingMessage(notification.data);
62 } 62 }
63 63
64 } // namespace syncer 64 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698