| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "chrome/browser/local_discovery/privet_http.h" | 15 #include "chrome/browser/local_discovery/privet_http.h" |
| 16 #include "components/cloud_devices/common/cloud_device_description.h" | 16 #include "components/cloud_devices/common/cloud_device_description.h" |
| 17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
| 18 | 18 |
| 19 namespace printing { | |
| 20 struct PwgRasterSettings; | |
| 21 }; | |
| 22 | |
| 23 namespace local_discovery { | 19 namespace local_discovery { |
| 24 | 20 |
| 25 class PrivetHTTPClient; | 21 class PrivetHTTPClient; |
| 26 | 22 |
| 27 class PrivetInfoOperationImpl : public PrivetJSONOperation, | 23 class PrivetInfoOperationImpl : public PrivetJSONOperation, |
| 28 public PrivetURLFetcher::Delegate { | 24 public PrivetURLFetcher::Delegate { |
| 29 public: | 25 public: |
| 30 PrivetInfoOperationImpl(PrivetHTTPClient* privet_client, | 26 PrivetInfoOperationImpl(PrivetHTTPClient* privet_client, |
| 31 const PrivetJSONOperation::ResultCallback& callback); | 27 const PrivetJSONOperation::ResultCallback& callback); |
| 32 ~PrivetInfoOperationImpl() override; | 28 ~PrivetInfoOperationImpl() override; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 195 |
| 200 void StartConvertToPWG(); | 196 void StartConvertToPWG(); |
| 201 void StartPrinting(); | 197 void StartPrinting(); |
| 202 | 198 |
| 203 void OnPrivetInfoDone(const base::DictionaryValue* value); | 199 void OnPrivetInfoDone(const base::DictionaryValue* value); |
| 204 void OnSubmitdocResponse(bool has_error, | 200 void OnSubmitdocResponse(bool has_error, |
| 205 const base::DictionaryValue* value); | 201 const base::DictionaryValue* value); |
| 206 void OnCreatejobResponse(bool has_error, | 202 void OnCreatejobResponse(bool has_error, |
| 207 const base::DictionaryValue* value); | 203 const base::DictionaryValue* value); |
| 208 void OnPWGRasterConverted(bool success, const base::FilePath& pwg_file_path); | 204 void OnPWGRasterConverted(bool success, const base::FilePath& pwg_file_path); |
| 209 void FillPwgRasterSettings(printing::PwgRasterSettings* transfrom_settings); | |
| 210 | 205 |
| 211 PrivetHTTPClient* privet_client_; | 206 PrivetHTTPClient* privet_client_; |
| 212 PrivetLocalPrintOperation::Delegate* delegate_; | 207 PrivetLocalPrintOperation::Delegate* delegate_; |
| 213 | 208 |
| 214 ResponseCallback current_response_; | 209 ResponseCallback current_response_; |
| 215 | 210 |
| 216 cloud_devices::CloudDeviceDescription ticket_; | 211 cloud_devices::CloudDeviceDescription ticket_; |
| 217 cloud_devices::CloudDeviceDescription capabilities_; | 212 cloud_devices::CloudDeviceDescription capabilities_; |
| 218 | 213 |
| 219 scoped_refptr<base::RefCountedBytes> data_; | 214 scoped_refptr<base::RefCountedBytes> data_; |
| 220 base::FilePath pwg_file_path_; | 215 base::FilePath pwg_file_path_; |
| 221 | 216 |
| 222 bool use_pdf_; | 217 bool use_pdf_; |
| 223 bool has_extended_workflow_; | 218 bool has_extended_workflow_; |
| 224 bool started_; | 219 bool started_; |
| 225 bool offline_; | 220 bool offline_; |
| 226 gfx::Size page_size_; | 221 gfx::Size page_size_; |
| 227 int dpi_; | |
| 228 | 222 |
| 229 std::string user_; | 223 std::string user_; |
| 230 std::string jobname_; | 224 std::string jobname_; |
| 231 | 225 |
| 232 std::string jobid_; | 226 std::string jobid_; |
| 233 | 227 |
| 234 int invalid_job_retries_; | 228 int invalid_job_retries_; |
| 235 | 229 |
| 236 scoped_ptr<PrivetURLFetcher> url_fetcher_; | 230 scoped_ptr<PrivetURLFetcher> url_fetcher_; |
| 237 scoped_ptr<PrivetJSONOperation> info_operation_; | 231 scoped_ptr<PrivetJSONOperation> info_operation_; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 private: | 288 private: |
| 295 PrivetHTTPClient* info_client() { return info_client_.get(); } | 289 PrivetHTTPClient* info_client() { return info_client_.get(); } |
| 296 | 290 |
| 297 scoped_ptr<PrivetHTTPClient> info_client_; | 291 scoped_ptr<PrivetHTTPClient> info_client_; |
| 298 | 292 |
| 299 DISALLOW_COPY_AND_ASSIGN(PrivetV1HTTPClientImpl); | 293 DISALLOW_COPY_AND_ASSIGN(PrivetV1HTTPClientImpl); |
| 300 }; | 294 }; |
| 301 | 295 |
| 302 } // namespace local_discovery | 296 } // namespace local_discovery |
| 303 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ | 297 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ |
| OLD | NEW |