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 CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 PrivetURLFetcher* fetcher, | 176 PrivetURLFetcher* fetcher, |
177 const PrivetURLFetcher::TokenCallback& callback) OVERRIDE; | 177 const PrivetURLFetcher::TokenCallback& callback) OVERRIDE; |
178 | 178 |
179 virtual void OnPrivetInfoDone(PrivetInfoOperation* operation, | 179 virtual void OnPrivetInfoDone(PrivetInfoOperation* operation, |
180 int http_code, | 180 int http_code, |
181 const base::DictionaryValue* value) OVERRIDE; | 181 const base::DictionaryValue* value) OVERRIDE; |
182 private: | 182 private: |
183 typedef base::Callback<void(const base::DictionaryValue* value)> | 183 typedef base::Callback<void(const base::DictionaryValue* value)> |
184 ResponseCallback; | 184 ResponseCallback; |
185 | 185 |
186 void StartCurrentRequest(); | |
187 | |
188 void StartInitialRequest(); | 186 void StartInitialRequest(); |
189 void GetCapabilities(); | 187 void GetCapabilities(); |
190 // TODO(noamsml): void DoCreatejob(); | 188 void DoCreatejob(); |
191 void DoSubmitdoc(); | 189 void DoSubmitdoc(); |
192 | 190 |
193 void OnCapabilities(const base::DictionaryValue* value); | 191 void OnCapabilitiesResponse(const base::DictionaryValue* value); |
194 void OnSubmitdocResponse(const base::DictionaryValue* value); | 192 void OnSubmitdocResponse(const base::DictionaryValue* value); |
| 193 void OnCreatejobResponse(const base::DictionaryValue* value); |
195 | 194 |
196 PrivetHTTPClientImpl* privet_client_; | 195 PrivetHTTPClientImpl* privet_client_; |
197 PrivetLocalPrintOperation::Delegate* delegate_; | 196 PrivetLocalPrintOperation::Delegate* delegate_; |
198 | 197 |
199 base::Closure current_request_; | |
200 ResponseCallback current_response_; | 198 ResponseCallback current_response_; |
201 | 199 |
202 std::string ticket_; | 200 std::string ticket_; |
203 std::string data_; | 201 std::string data_; |
204 | 202 |
205 bool use_pdf_; | 203 bool use_pdf_; |
206 bool has_capabilities_; | 204 bool has_capabilities_; |
207 bool has_extended_workflow_; | 205 bool has_extended_workflow_; |
208 bool started_; | 206 bool started_; |
209 bool offline_; | 207 bool offline_; |
210 | 208 |
211 std::string user_; | 209 std::string user_; |
212 std::string jobname_; | 210 std::string jobname_; |
213 | 211 |
| 212 std::string jobid_; |
| 213 |
214 scoped_ptr<PrivetURLFetcher> url_fetcher_; | 214 scoped_ptr<PrivetURLFetcher> url_fetcher_; |
215 scoped_ptr<PrivetInfoOperation> info_operation_; | 215 scoped_ptr<PrivetInfoOperation> info_operation_; |
216 }; | 216 }; |
217 | 217 |
218 class PrivetHTTPClientImpl : public PrivetHTTPClient, | 218 class PrivetHTTPClientImpl : public PrivetHTTPClient, |
219 public PrivetInfoOperation::Delegate { | 219 public PrivetInfoOperation::Delegate { |
220 public: | 220 public: |
221 PrivetHTTPClientImpl( | 221 PrivetHTTPClientImpl( |
222 const std::string& name, | 222 const std::string& name, |
223 const net::HostPortPair& host_port, | 223 const net::HostPortPair& host_port, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 PrivetURLFetcherFactory fetcher_factory_; | 263 PrivetURLFetcherFactory fetcher_factory_; |
264 net::HostPortPair host_port_; | 264 net::HostPortPair host_port_; |
265 scoped_ptr<base::DictionaryValue> cached_info_; | 265 scoped_ptr<base::DictionaryValue> cached_info_; |
266 | 266 |
267 scoped_ptr<PrivetInfoOperation> info_operation_; | 267 scoped_ptr<PrivetInfoOperation> info_operation_; |
268 TokenCallbackVector token_callbacks_; | 268 TokenCallbackVector token_callbacks_; |
269 }; | 269 }; |
270 | 270 |
271 } // namespace local_discovery | 271 } // namespace local_discovery |
272 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ | 272 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ |
OLD | NEW |