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 28 matching lines...) Expand all Loading... |
39 public: | 39 public: |
40 class Core; | 40 class Core; |
41 | 41 |
42 GCMInvalidationBridge(gcm::GCMDriver* gcm_driver, | 42 GCMInvalidationBridge(gcm::GCMDriver* gcm_driver, |
43 IdentityProvider* identity_provider); | 43 IdentityProvider* identity_provider); |
44 virtual ~GCMInvalidationBridge(); | 44 virtual ~GCMInvalidationBridge(); |
45 | 45 |
46 // OAuth2TokenService::Consumer implementation. | 46 // OAuth2TokenService::Consumer implementation. |
47 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 47 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
48 const std::string& access_token, | 48 const std::string& access_token, |
49 const base::Time& expiration_time) OVERRIDE; | 49 const base::Time& expiration_time) override; |
50 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 50 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
51 const GoogleServiceAuthError& error) OVERRIDE; | 51 const GoogleServiceAuthError& error) override; |
52 | 52 |
53 // gcm::GCMAppHandler implementation. | 53 // gcm::GCMAppHandler implementation. |
54 virtual void ShutdownHandler() OVERRIDE; | 54 virtual void ShutdownHandler() override; |
55 virtual void OnMessage( | 55 virtual void OnMessage( |
56 const std::string& app_id, | 56 const std::string& app_id, |
57 const gcm::GCMClient::IncomingMessage& message) OVERRIDE; | 57 const gcm::GCMClient::IncomingMessage& message) override; |
58 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; | 58 virtual void OnMessagesDeleted(const std::string& app_id) override; |
59 virtual void OnSendError( | 59 virtual void OnSendError( |
60 const std::string& app_id, | 60 const std::string& app_id, |
61 const gcm::GCMClient::SendErrorDetails& send_error_details) OVERRIDE; | 61 const gcm::GCMClient::SendErrorDetails& send_error_details) override; |
62 virtual void OnSendAcknowledged(const std::string& app_id, | 62 virtual void OnSendAcknowledged(const std::string& app_id, |
63 const std::string& message_id) OVERRIDE; | 63 const std::string& message_id) override; |
64 | 64 |
65 // gcm::GCMConnectionObserver implementation. | 65 // gcm::GCMConnectionObserver implementation. |
66 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) OVERRIDE; | 66 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) override; |
67 virtual void OnDisconnected() OVERRIDE; | 67 virtual void OnDisconnected() override; |
68 | 68 |
69 scoped_ptr<syncer::GCMNetworkChannelDelegate> CreateDelegate(); | 69 scoped_ptr<syncer::GCMNetworkChannelDelegate> CreateDelegate(); |
70 | 70 |
71 void CoreInitializationDone( | 71 void CoreInitializationDone( |
72 base::WeakPtr<Core> core, | 72 base::WeakPtr<Core> core, |
73 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner); | 73 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner); |
74 | 74 |
75 // Functions reflecting GCMNetworkChannelDelegate interface. These are called | 75 // Functions reflecting GCMNetworkChannelDelegate interface. These are called |
76 // on UI thread to perform actual work. | 76 // on UI thread to perform actual work. |
77 void RequestToken( | 77 void RequestToken( |
(...skipping 23 matching lines...) Expand all Loading... |
101 bool subscribed_for_incoming_messages_; | 101 bool subscribed_for_incoming_messages_; |
102 | 102 |
103 base::WeakPtrFactory<GCMInvalidationBridge> weak_factory_; | 103 base::WeakPtrFactory<GCMInvalidationBridge> weak_factory_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(GCMInvalidationBridge); | 105 DISALLOW_COPY_AND_ASSIGN(GCMInvalidationBridge); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace invalidation | 108 } // namespace invalidation |
109 | 109 |
110 #endif // COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ | 110 #endif // COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ |
OLD | NEW |