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_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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "components/gcm_driver/gcm_app_handler.h" | 14 #include "components/gcm_driver/gcm_app_handler.h" |
15 #include "components/gcm_driver/gcm_client.h" | 15 #include "components/gcm_driver/gcm_client.h" |
16 #include "google_apis/gcm/engine/account_mapping.h" | 16 #include "google_apis/gcm/engine/account_mapping.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class Clock; | 19 class Clock; |
20 } | 20 } |
21 | 21 |
22 namespace gcm { | 22 namespace gcm { |
23 | 23 |
24 class GCMDriver; | 24 class GCMDriver; |
| 25 extern const char kGCMAccountMapperAppId[]; |
25 | 26 |
26 // Class for mapping signed-in GAIA accounts to the GCM Device ID. | 27 // Class for mapping signed-in GAIA accounts to the GCM Device ID. |
27 class GCMAccountMapper : public GCMAppHandler { | 28 class GCMAccountMapper : public GCMAppHandler { |
28 public: | 29 public: |
29 // List of account mappings. | 30 // List of account mappings. |
30 typedef std::vector<AccountMapping> AccountMappings; | 31 typedef std::vector<AccountMapping> AccountMappings; |
31 | 32 |
32 explicit GCMAccountMapper(GCMDriver* gcm_driver); | 33 explicit GCMAccountMapper(GCMDriver* gcm_driver); |
33 virtual ~GCMAccountMapper(); | 34 virtual ~GCMAccountMapper(); |
34 | 35 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 bool initialized_; | 116 bool initialized_; |
116 | 117 |
117 base::WeakPtrFactory<GCMAccountMapper> weak_ptr_factory_; | 118 base::WeakPtrFactory<GCMAccountMapper> weak_ptr_factory_; |
118 | 119 |
119 DISALLOW_COPY_AND_ASSIGN(GCMAccountMapper); | 120 DISALLOW_COPY_AND_ASSIGN(GCMAccountMapper); |
120 }; | 121 }; |
121 | 122 |
122 } // namespace gcm | 123 } // namespace gcm |
123 | 124 |
124 #endif // COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ | 125 #endif // COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ |
OLD | NEW |