OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INSTANCE_ID_DELETE_TOKEN_REQUEST_HANDLER_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_DELETE_TOKEN_REQUEST_HANDLER_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_DELETE_TOKEN_REQUEST_HANDLER_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_DELETE_TOKEN_REQUEST_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "google_apis/gcm/engine/unregistration_request.h" | 11 #include "google_apis/gcm/engine/unregistration_request.h" |
12 | 12 |
13 namespace gcm { | 13 namespace gcm { |
14 | 14 |
15 // Provides custom logic to handle DeleteToken request for InstanceID. | 15 // Provides custom logic to handle DeleteToken request for InstanceID. |
16 class GCM_EXPORT InstanceIDDeleteTokenRequestHandler : | 16 class GCM_EXPORT InstanceIDDeleteTokenRequestHandler : |
17 public UnregistrationRequest::CustomRequestHandler { | 17 public UnregistrationRequest::CustomRequestHandler { |
18 public: | 18 public: |
19 InstanceIDDeleteTokenRequestHandler( | 19 InstanceIDDeleteTokenRequestHandler( |
20 const std::string& instance_id, | 20 const std::string& instance_id, |
21 const std::string& authorized_entity, | 21 const std::string& authorized_entity, |
22 const std::string& scope, | 22 const std::string& scope, |
23 int gcm_version); | 23 int gcm_version); |
24 ~InstanceIDDeleteTokenRequestHandler() override; | 24 ~InstanceIDDeleteTokenRequestHandler() override; |
25 | 25 |
26 // UnregistrationRequest overrides: | 26 // UnregistrationRequest overrides: |
27 void BuildRequestBody(std::string* body) override; | 27 void BuildRequestBody(std::string* body) override; |
28 UnregistrationRequest::Status ParseResponse( | 28 UnregistrationRequest::Status ParseResponse( |
29 const net::URLFetcher* source) override; | 29 const std::string& response) override; |
30 void ReportUMAs(UnregistrationRequest::Status status, | 30 void ReportUMAs(UnregistrationRequest::Status status, |
31 int retry_count, | 31 int retry_count, |
32 base::TimeDelta complete_time) override; | 32 base::TimeDelta complete_time) override; |
33 | 33 |
34 private: | 34 private: |
35 std::string instance_id_; | 35 std::string instance_id_; |
36 std::string authorized_entity_; | 36 std::string authorized_entity_; |
37 std::string scope_; | 37 std::string scope_; |
38 int gcm_version_; | 38 int gcm_version_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(InstanceIDDeleteTokenRequestHandler); | 40 DISALLOW_COPY_AND_ASSIGN(InstanceIDDeleteTokenRequestHandler); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace gcm | 43 } // namespace gcm |
44 | 44 |
45 #endif // GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_DELETE_TOKEN_REQUEST_HANDLER_H_ | 45 #endif // GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_DELETE_TOKEN_REQUEST_HANDLER_H_ |
OLD | NEW |