| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef SYNC_NOTIFIER_PUSH_CLIENT_CHANNEL_H_ | 5 #ifndef SYNC_NOTIFIER_PUSH_CLIENT_CHANNEL_H_ |
| 6 #define SYNC_NOTIFIER_PUSH_CLIENT_CHANNEL_H_ | 6 #define SYNC_NOTIFIER_PUSH_CLIENT_CHANNEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 // |push_client| is guaranteed to be destroyed only when this object | 29 // |push_client| is guaranteed to be destroyed only when this object |
| 30 // is destroyed. | 30 // is destroyed. |
| 31 explicit PushClientChannel(scoped_ptr<notifier::PushClient> push_client); | 31 explicit PushClientChannel(scoped_ptr<notifier::PushClient> push_client); |
| 32 | 32 |
| 33 virtual ~PushClientChannel(); | 33 virtual ~PushClientChannel(); |
| 34 | 34 |
| 35 // If not connected, connects with the given credentials. If | 35 // If not connected, connects with the given credentials. If |
| 36 // already connected, the next connection attempt will use the given | 36 // already connected, the next connection attempt will use the given |
| 37 // credentials. | 37 // credentials. |
| 38 void UpdateCredentials(const std::string& email, const std::string& token); | 38 virtual void UpdateCredentials(const std::string& email, |
| 39 const std::string& token) OVERRIDE; |
| 39 | 40 |
| 40 // SyncNetworkChannel implementation. | 41 // SyncNetworkChannel implementation. |
| 41 virtual void SendEncodedMessage(const std::string& encoded_message) OVERRIDE; | 42 virtual void SendEncodedMessage(const std::string& encoded_message) OVERRIDE; |
| 42 | 43 |
| 43 // notifier::PushClient::Observer implementation. | 44 // notifier::PushClient::Observer implementation. |
| 44 virtual void OnNotificationsEnabled() OVERRIDE; | 45 virtual void OnNotificationsEnabled() OVERRIDE; |
| 45 virtual void OnNotificationsDisabled( | 46 virtual void OnNotificationsDisabled( |
| 46 notifier::NotificationsDisabledReason reason) OVERRIDE; | 47 notifier::NotificationsDisabledReason reason) OVERRIDE; |
| 47 virtual void OnIncomingNotification( | 48 virtual void OnIncomingNotification( |
| 48 const notifier::Notification& notification) OVERRIDE; | 49 const notifier::Notification& notification) OVERRIDE; |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 scoped_ptr<notifier::PushClient> push_client_; | 52 scoped_ptr<notifier::PushClient> push_client_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(PushClientChannel); | 54 DISALLOW_COPY_AND_ASSIGN(PushClientChannel); |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace syncer | 57 } // namespace syncer |
| 57 | 58 |
| 58 #endif // SYNC_NOTIFIER_PUSH_CLIENT_CHANNEL_H_ | 59 #endif // SYNC_NOTIFIER_PUSH_CLIENT_CHANNEL_H_ |
| OLD | NEW |