| 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 GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| 6 #define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Callback completing the registration request. | 60 // Callback completing the registration request. |
| 61 typedef base::Callback<void(Status status, | 61 typedef base::Callback<void(Status status, |
| 62 const std::string& registration_id)> | 62 const std::string& registration_id)> |
| 63 RegistrationCallback; | 63 RegistrationCallback; |
| 64 | 64 |
| 65 // Defines the common info about a registration/token request. All parameters | 65 // Defines the common info about a registration/token request. All parameters |
| 66 // are mandatory. | 66 // are mandatory. |
| 67 struct GCM_EXPORT RequestInfo { | 67 struct GCM_EXPORT RequestInfo { |
| 68 RequestInfo(uint64_t android_id, | 68 RequestInfo(uint64_t android_id, |
| 69 uint64_t security_token, | 69 uint64_t security_token, |
| 70 const std::string& app_id); | 70 const std::string& app_id, |
| 71 bool use_subtype, |
| 72 const std::string& product_category_for_subtypes); |
| 71 ~RequestInfo(); | 73 ~RequestInfo(); |
| 72 | 74 |
| 73 // Android ID of the device. | 75 // Android ID of the device. |
| 74 uint64_t android_id; | 76 uint64_t android_id; |
| 75 // Security token of the device. | 77 // Security token of the device. |
| 76 uint64_t security_token; | 78 uint64_t security_token; |
| 79 |
| 77 // Application ID. | 80 // Application ID. |
| 78 std::string app_id; | 81 std::string app_id; |
| 82 // Whether to send |app_id| to GCM as a "subtype" instead of a "category". |
| 83 bool use_subtype; |
| 84 // Category to send if |use_subtype|. |
| 85 std::string product_category_for_subtypes; |
| 79 }; | 86 }; |
| 80 | 87 |
| 81 // Encapsulates the custom logic that is needed to build and process the | 88 // Encapsulates the custom logic that is needed to build and process the |
| 82 // registration request. | 89 // registration request. |
| 83 class GCM_EXPORT CustomRequestHandler { | 90 class GCM_EXPORT CustomRequestHandler { |
| 84 public: | 91 public: |
| 85 CustomRequestHandler(); | 92 CustomRequestHandler(); |
| 86 virtual ~CustomRequestHandler(); | 93 virtual ~CustomRequestHandler(); |
| 87 | 94 |
| 88 // Builds the HTTP request body data. It is called after | 95 // Builds the HTTP request body data. It is called after |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 std::string source_to_record_; | 147 std::string source_to_record_; |
| 141 | 148 |
| 142 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; | 149 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; |
| 143 | 150 |
| 144 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); | 151 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); |
| 145 }; | 152 }; |
| 146 | 153 |
| 147 } // namespace gcm | 154 } // namespace gcm |
| 148 | 155 |
| 149 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ | 156 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| OLD | NEW |