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_GCM_UNREGISTRATION_REQUEST_HANDLER_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_UNREGISTRATION_REQUEST_HANDLER_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_GCM_UNREGISTRATION_REQUEST_HANDLER_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_GCM_UNREGISTRATION_REQUEST_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "google_apis/gcm/engine/unregistration_request.h" | 9 #include "google_apis/gcm/engine/unregistration_request.h" |
10 | 10 |
11 namespace gcm { | 11 namespace gcm { |
12 | 12 |
13 // Used to revoke the registration ID when unregister is called or the | 13 // Used to revoke the registration ID when unregister is called or the |
14 // application has been uninstalled. | 14 // application has been uninstalled. |
15 class GCM_EXPORT GCMUnregistrationRequestHandler : | 15 class GCM_EXPORT GCMUnregistrationRequestHandler : |
16 public UnregistrationRequest::CustomRequestHandler { | 16 public UnregistrationRequest::CustomRequestHandler { |
17 public: | 17 public: |
18 GCMUnregistrationRequestHandler(const std::string& app_id); | 18 GCMUnregistrationRequestHandler(const std::string& app_id); |
19 ~GCMUnregistrationRequestHandler() override; | 19 ~GCMUnregistrationRequestHandler() override; |
20 | 20 |
21 // UnregistrationRequest::CustomRequestHandler overrides: | 21 // UnregistrationRequest::CustomRequestHandler overrides: |
22 void BuildRequestBody(std::string* body) override; | 22 void BuildRequestBody(std::string* body) override; |
23 UnregistrationRequest::Status ParseResponse( | 23 UnregistrationRequest::Status ParseResponse( |
24 const net::URLFetcher* source) override; | 24 const std::string& response) override; |
25 void ReportUMAs(UnregistrationRequest::Status status, | 25 void ReportUMAs(UnregistrationRequest::Status status, |
26 int retry_count, | 26 int retry_count, |
27 base::TimeDelta complete_time) override; | 27 base::TimeDelta complete_time) override; |
28 | 28 |
29 private: | 29 private: |
30 std::string app_id_; | 30 std::string app_id_; |
31 | 31 |
32 DISALLOW_COPY_AND_ASSIGN(GCMUnregistrationRequestHandler); | 32 DISALLOW_COPY_AND_ASSIGN(GCMUnregistrationRequestHandler); |
33 }; | 33 }; |
34 | 34 |
35 } // namespace gcm | 35 } // namespace gcm |
36 | 36 |
37 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_UNREGISTRATION_REQUEST_HANDLER_H_ | 37 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_UNREGISTRATION_REQUEST_HANDLER_H_ |
OLD | NEW |