| 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_URL_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_FETCHER_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_URL_FETCHER_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "net/url_request/url_fetcher.h" | 14 #include "net/url_request/url_fetcher.h" |
| 15 #include "net/url_request/url_fetcher_delegate.h" | 15 #include "net/url_request/url_fetcher_delegate.h" |
| 16 #include "net/url_request/url_request_context_getter.h" | 16 #include "net/url_request/url_request_context_getter.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class FilePath; | 20 class FilePath; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace local_discovery { | 23 namespace cloud_print { |
| 24 | 24 |
| 25 // Privet-specific URLFetcher adapter. Currently supports only the subset | 25 // Privet-specific URLFetcher adapter. Currently supports only the subset |
| 26 // of HTTP features required by Privet for GCP 1.5 | 26 // of HTTP features required by Privet for GCP 1.5 |
| 27 // (/privet/info and /privet/register). | 27 // (/privet/info and /privet/register). |
| 28 class PrivetURLFetcher : public net::URLFetcherDelegate { | 28 class PrivetURLFetcher : public net::URLFetcherDelegate { |
| 29 public: | 29 public: |
| 30 enum ErrorType { | 30 enum ErrorType { |
| 31 JSON_PARSE_ERROR, | 31 JSON_PARSE_ERROR, |
| 32 REQUEST_CANCELED, | 32 REQUEST_CANCELED, |
| 33 RESPONSE_CODE_ERROR, | 33 RESPONSE_CODE_ERROR, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 int tries_; | 135 int tries_; |
| 136 std::string upload_data_; | 136 std::string upload_data_; |
| 137 std::string upload_content_type_; | 137 std::string upload_content_type_; |
| 138 base::FilePath upload_file_path_; | 138 base::FilePath upload_file_path_; |
| 139 scoped_ptr<net::URLFetcher> url_fetcher_; | 139 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 140 | 140 |
| 141 base::WeakPtrFactory<PrivetURLFetcher> weak_factory_; | 141 base::WeakPtrFactory<PrivetURLFetcher> weak_factory_; |
| 142 DISALLOW_COPY_AND_ASSIGN(PrivetURLFetcher); | 142 DISALLOW_COPY_AND_ASSIGN(PrivetURLFetcher); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace local_discovery | 145 } // namespace cloud_print |
| 146 | 146 |
| 147 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_URL_FETCHER_H_ | 147 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_FETCHER_H_ |
| OLD | NEW |