| OLD | NEW |
| 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/p2p_notifier.h" | 5 #include "sync/notifier/p2p_notifier.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 void P2PNotifier::RemoveObserver(SyncNotifierObserver* observer) { | 164 void P2PNotifier::RemoveObserver(SyncNotifierObserver* observer) { |
| 165 DCHECK(non_thread_safe_.CalledOnValidThread()); | 165 DCHECK(non_thread_safe_.CalledOnValidThread()); |
| 166 observer_list_.RemoveObserver(observer); | 166 observer_list_.RemoveObserver(observer); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void P2PNotifier::SetUniqueId(const std::string& unique_id) { | 169 void P2PNotifier::SetUniqueId(const std::string& unique_id) { |
| 170 DCHECK(non_thread_safe_.CalledOnValidThread()); | 170 DCHECK(non_thread_safe_.CalledOnValidThread()); |
| 171 unique_id_ = unique_id; | 171 unique_id_ = unique_id; |
| 172 } | 172 } |
| 173 | 173 |
| 174 void P2PNotifier::SetState(const std::string& state) { | 174 void P2PNotifier::SetStateDeprecated(const std::string& state) { |
| 175 DCHECK(non_thread_safe_.CalledOnValidThread()); | 175 DCHECK(non_thread_safe_.CalledOnValidThread()); |
| 176 // Do nothing. | 176 // Do nothing. |
| 177 } | 177 } |
| 178 | 178 |
| 179 void P2PNotifier::UpdateCredentials( | 179 void P2PNotifier::UpdateCredentials( |
| 180 const std::string& email, const std::string& token) { | 180 const std::string& email, const std::string& token) { |
| 181 DCHECK(non_thread_safe_.CalledOnValidThread()); | 181 DCHECK(non_thread_safe_.CalledOnValidThread()); |
| 182 notifier::Subscription subscription; | 182 notifier::Subscription subscription; |
| 183 subscription.channel = kSyncP2PNotificationChannel; | 183 subscription.channel = kSyncP2PNotificationChannel; |
| 184 // There may be some subtle issues around case sensitivity of the | 184 // There may be some subtle issues around case sensitivity of the |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 const P2PNotificationData& notification_data) { | 274 const P2PNotificationData& notification_data) { |
| 275 DCHECK(non_thread_safe_.CalledOnValidThread()); | 275 DCHECK(non_thread_safe_.CalledOnValidThread()); |
| 276 notifier::Notification notification; | 276 notifier::Notification notification; |
| 277 notification.channel = kSyncP2PNotificationChannel; | 277 notification.channel = kSyncP2PNotificationChannel; |
| 278 notification.data = notification_data.ToString(); | 278 notification.data = notification_data.ToString(); |
| 279 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); | 279 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); |
| 280 push_client_->SendNotification(notification); | 280 push_client_->SendNotification(notification); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace sync_notifier | 283 } // namespace sync_notifier |
| OLD | NEW |