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

Side by Side Diff: components/gcm_driver/gcm_account_mapper.h

Issue 2578583002: Provide a mechanism for the GCM driver to send message receipts to GCM.
Patch Set: Adding new file I missed previously. Created 3 years, 11 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
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_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 namespace gcm { 23 namespace gcm {
24 24
25 class GCMDriver; 25 class GCMDriver;
26 extern const char kGCMAccountMapperAppId[]; 26 extern const char kGCMAccountMapperAppId[];
27 27
28 // Class for mapping signed-in GAIA accounts to the GCM Device ID. 28 // Class for mapping signed-in GAIA accounts to the GCM Device ID.
29 class GCMAccountMapper : public GCMAppHandler { 29 class GCMAccountMapper : public GCMAppHandler {
30 public: 30 public:
31 // List of account mappings. 31 // List of account mappings.
32 typedef std::vector<AccountMapping> AccountMappings; 32 typedef std::vector<AccountMapping> AccountMappings;
33 typedef base::Callback<void(const std::string& app_id, 33 typedef base::Callback<void(
34 const IncomingMessage& message)> 34 const std::string& app_id,
35 const IncomingMessage& message,
36 const GCMClient::MessageReceiptCallback& callback)>
35 DispatchMessageCallback; 37 DispatchMessageCallback;
36 38
37 explicit GCMAccountMapper(GCMDriver* gcm_driver); 39 explicit GCMAccountMapper(GCMDriver* gcm_driver);
38 ~GCMAccountMapper() override; 40 ~GCMAccountMapper() override;
39 41
40 void Initialize(const AccountMappings& account_mappings, 42 void Initialize(const AccountMappings& account_mappings,
41 const DispatchMessageCallback& callback); 43 const DispatchMessageCallback& callback);
42 44
43 // Called by AccountTracker, when a new list of account tokens is available. 45 // Called by AccountTracker, when a new list of account tokens is available.
44 // This will cause a refresh of account mappings and sending updates to GCM. 46 // This will cause a refresh of account mappings and sending updates to GCM.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 bool initialized_; 127 bool initialized_;
126 128
127 base::WeakPtrFactory<GCMAccountMapper> weak_ptr_factory_; 129 base::WeakPtrFactory<GCMAccountMapper> weak_ptr_factory_;
128 130
129 DISALLOW_COPY_AND_ASSIGN(GCMAccountMapper); 131 DISALLOW_COPY_AND_ASSIGN(GCMAccountMapper);
130 }; 132 };
131 133
132 } // namespace gcm 134 } // namespace gcm
133 135
134 #endif // COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ 136 #endif // COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698