OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_REQUESTER_H_ | 5 #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_REQUESTER_H_ |
6 #define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_REQUESTER_H_ | 6 #define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_REQUESTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void RequestLocalSettings(const std::string& device_id); | 127 void RequestLocalSettings(const std::string& device_id); |
128 | 128 |
129 // Updates local settings on server. | 129 // Updates local settings on server. |
130 void SendLocalSettings(const std::string& device_id, | 130 void SendLocalSettings(const std::string& device_id, |
131 const LocalSettings& settings); | 131 const LocalSettings& settings); |
132 | 132 |
133 private: | 133 private: |
134 typedef base::Callback<void(const std::string&)> ParserCallback; | 134 typedef base::Callback<void(const std::string&)> ParserCallback; |
135 | 135 |
136 // CloudPrintRequester::Delegate methods: | 136 // CloudPrintRequester::Delegate methods: |
137 virtual void OnFetchComplete(const std::string& response) override; | 137 void OnFetchComplete(const std::string& response) override; |
138 virtual void OnFetchError(const std::string& server_api, | 138 void OnFetchError(const std::string& server_api, |
139 int server_code, | 139 int server_code, |
140 int server_http_code) override; | 140 int server_http_code) override; |
141 virtual void OnFetchTimeoutReached() override; | 141 void OnFetchTimeoutReached() override; |
142 | 142 |
143 // gaia::GaiaOAuthClient::Delegate methods: | 143 // gaia::GaiaOAuthClient::Delegate methods: |
144 virtual void OnGetTokensResponse(const std::string& refresh_token, | 144 void OnGetTokensResponse(const std::string& refresh_token, |
145 const std::string& access_token, | 145 const std::string& access_token, |
146 int expires_in_seconds) override; | 146 int expires_in_seconds) override; |
147 virtual void OnRefreshTokenResponse(const std::string& access_token, | 147 void OnRefreshTokenResponse(const std::string& access_token, |
148 int expires_in_seconds) override; | 148 int expires_in_seconds) override; |
149 virtual void OnOAuthError() override; | 149 void OnOAuthError() override; |
150 virtual void OnNetworkError(int response_code) override; | 150 void OnNetworkError(int response_code) override; |
151 | 151 |
152 // Creates GET request. | 152 // Creates GET request. |
153 scoped_ptr<CloudPrintRequest> CreateGet(const GURL& url, | 153 scoped_ptr<CloudPrintRequest> CreateGet(const GURL& url, |
154 const ParserCallback& callback); | 154 const ParserCallback& callback); |
155 | 155 |
156 // Creates POST request. | 156 // Creates POST request. |
157 scoped_ptr<CloudPrintRequest> CreatePost(const GURL& url, | 157 scoped_ptr<CloudPrintRequest> CreatePost(const GURL& url, |
158 const std::string& content, | 158 const std::string& content, |
159 const std::string& mimetype, | 159 const std::string& mimetype, |
160 const ParserCallback& callback); | 160 const ParserCallback& callback); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 ParserCallback parser_callback_; | 213 ParserCallback parser_callback_; |
214 | 214 |
215 Delegate* delegate_; | 215 Delegate* delegate_; |
216 | 216 |
217 DISALLOW_COPY_AND_ASSIGN(CloudPrintRequester); | 217 DISALLOW_COPY_AND_ASSIGN(CloudPrintRequester); |
218 }; | 218 }; |
219 | 219 |
220 #endif // CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_REQUESTER_H_ | 220 #endif // CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_REQUESTER_H_ |
221 | 221 |
OLD | NEW |