| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ | 5 #ifndef COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ |
| 6 #define COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ | 6 #define COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 void Register(syncer::GCMNetworkChannelDelegate::RegisterCallback callback); | 80 void Register(syncer::GCMNetworkChannelDelegate::RegisterCallback callback); |
| 81 | 81 |
| 82 void SubscribeForIncomingMessages(); | 82 void SubscribeForIncomingMessages(); |
| 83 | 83 |
| 84 void RegisterFinished( | 84 void RegisterFinished( |
| 85 syncer::GCMNetworkChannelDelegate::RegisterCallback callback, | 85 syncer::GCMNetworkChannelDelegate::RegisterCallback callback, |
| 86 const std::string& registration_id, | 86 const std::string& registration_id, |
| 87 gcm::GCMClient::Result result); | 87 gcm::GCMClient::Result result); |
| 88 | 88 |
| 89 void Unregister(); |
| 90 |
| 91 static void UnregisterFinishedNoOp(gcm::GCMClient::Result result); |
| 92 |
| 89 private: | 93 private: |
| 90 gcm::GCMDriver* const gcm_driver_; | 94 gcm::GCMDriver* const gcm_driver_; |
| 91 IdentityProvider* const identity_provider_; | 95 IdentityProvider* const identity_provider_; |
| 92 | 96 |
| 93 base::WeakPtr<Core> core_; | 97 base::WeakPtr<Core> core_; |
| 94 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner_; | 98 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner_; |
| 95 | 99 |
| 96 // Fields related to RequestToken function. | 100 // Fields related to RequestToken function. |
| 97 scoped_ptr<OAuth2TokenService::Request> access_token_request_; | 101 scoped_ptr<OAuth2TokenService::Request> access_token_request_; |
| 98 syncer::GCMNetworkChannelDelegate::RequestTokenCallback | 102 syncer::GCMNetworkChannelDelegate::RequestTokenCallback |
| 99 request_token_callback_; | 103 request_token_callback_; |
| 100 bool subscribed_for_incoming_messages_; | 104 bool subscribed_for_incoming_messages_; |
| 101 | 105 |
| 102 base::WeakPtrFactory<GCMInvalidationBridge> weak_factory_; | 106 base::WeakPtrFactory<GCMInvalidationBridge> weak_factory_; |
| 103 | 107 |
| 104 DISALLOW_COPY_AND_ASSIGN(GCMInvalidationBridge); | 108 DISALLOW_COPY_AND_ASSIGN(GCMInvalidationBridge); |
| 105 }; | 109 }; |
| 106 | 110 |
| 107 } // namespace invalidation | 111 } // namespace invalidation |
| 108 | 112 |
| 109 #endif // COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ | 113 #endif // COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ |
| OLD | NEW |