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

Side by Side Diff: components/invalidation/gcm_invalidation_bridge.h

Issue 320993003: [GCM] Add app handler support for connection events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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 30 matching lines...) Expand all
41 IdentityProvider* identity_provider); 41 IdentityProvider* identity_provider);
42 virtual ~GCMInvalidationBridge(); 42 virtual ~GCMInvalidationBridge();
43 43
44 // OAuth2TokenService::Consumer implementation. 44 // OAuth2TokenService::Consumer implementation.
45 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, 45 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
46 const std::string& access_token, 46 const std::string& access_token,
47 const base::Time& expiration_time) OVERRIDE; 47 const base::Time& expiration_time) OVERRIDE;
48 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, 48 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
49 const GoogleServiceAuthError& error) OVERRIDE; 49 const GoogleServiceAuthError& error) OVERRIDE;
50 50
51 // gcm::GCMEventRouter implementation. 51 // gcm::GCMAppHandler implementation.
52 virtual void ShutdownHandler() OVERRIDE; 52 virtual void ShutdownHandler() OVERRIDE;
53 virtual void OnMessage(const std::string& app_id, 53 virtual void OnMessage(
54 const gcm::GCMClient::IncomingMessage& message) 54 const std::string& app_id,
55 OVERRIDE; 55 const gcm::GCMClient::IncomingMessage& message) OVERRIDE;
56 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; 56 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE;
57 virtual void OnSendError( 57 virtual void OnSendError(
58 const std::string& app_id, 58 const std::string& app_id,
59 const gcm::GCMClient::SendErrorDetails& send_error_details) OVERRIDE; 59 const gcm::GCMClient::SendErrorDetails& send_error_details) OVERRIDE;
60 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) OVERRIDE;
61 virtual void OnDisconnected() OVERRIDE;
60 62
61 scoped_ptr<syncer::GCMNetworkChannelDelegate> CreateDelegate(); 63 scoped_ptr<syncer::GCMNetworkChannelDelegate> CreateDelegate();
62 64
63 void CoreInitializationDone( 65 void CoreInitializationDone(
64 base::WeakPtr<Core> core, 66 base::WeakPtr<Core> core,
65 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner); 67 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner);
66 68
67 // Functions reflecting GCMNetworkChannelDelegate interface. These are called 69 // Functions reflecting GCMNetworkChannelDelegate interface. These are called
68 // on UI thread to perform actual work. 70 // on UI thread to perform actual work.
69 void RequestToken( 71 void RequestToken(
(...skipping 23 matching lines...) Expand all
93 bool subscribed_for_incoming_messages_; 95 bool subscribed_for_incoming_messages_;
94 96
95 base::WeakPtrFactory<GCMInvalidationBridge> weak_factory_; 97 base::WeakPtrFactory<GCMInvalidationBridge> weak_factory_;
96 98
97 DISALLOW_COPY_AND_ASSIGN(GCMInvalidationBridge); 99 DISALLOW_COPY_AND_ASSIGN(GCMInvalidationBridge);
98 }; 100 };
99 101
100 } // namespace invalidation 102 } // namespace invalidation
101 103
102 #endif // COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_ 104 #endif // COMPONENTS_INVALIDATION_GCM_INVALIDATION_BRIDGE_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop_unittest.cc ('k') | components/invalidation/gcm_invalidation_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698