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" |
| 11 #include "base/file_util.h" |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "chrome/browser/local_discovery/privet_http.h" | 13 #include "chrome/browser/local_discovery/privet_http.h" |
13 | 14 |
14 namespace local_discovery { | 15 namespace local_discovery { |
15 | 16 |
16 class PrivetHTTPClientImpl; | 17 class PrivetHTTPClientImpl; |
17 | 18 |
18 class PrivetInfoOperationImpl : public PrivetInfoOperation, | 19 class PrivetInfoOperationImpl : public PrivetInfoOperation, |
19 public PrivetURLFetcher::Delegate { | 20 public PrivetURLFetcher::Delegate { |
20 public: | 21 public: |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 public PrivetInfoOperation::Delegate { | 150 public PrivetInfoOperation::Delegate { |
150 public: | 151 public: |
151 PrivetLocalPrintOperationImpl( | 152 PrivetLocalPrintOperationImpl( |
152 PrivetHTTPClientImpl* privet_client, | 153 PrivetHTTPClientImpl* privet_client, |
153 PrivetLocalPrintOperation::Delegate* delegate); | 154 PrivetLocalPrintOperation::Delegate* delegate); |
154 | 155 |
155 virtual ~PrivetLocalPrintOperationImpl(); | 156 virtual ~PrivetLocalPrintOperationImpl(); |
156 virtual void Start() OVERRIDE; | 157 virtual void Start() OVERRIDE; |
157 | 158 |
158 virtual void SendData(const std::string& data) OVERRIDE; | 159 virtual void SendData(const std::string& data) OVERRIDE; |
| 160 virtual void SendDataFile(const base::FilePath& data) OVERRIDE; |
159 | 161 |
160 virtual void SetTicket(const std::string& ticket) OVERRIDE; | 162 virtual void SetTicket(const std::string& ticket) OVERRIDE; |
161 | 163 |
162 virtual void SetUsername(const std::string& user) OVERRIDE; | 164 virtual void SetUsername(const std::string& user) OVERRIDE; |
163 | 165 |
164 virtual void SetJobname(const std::string& jobname) OVERRIDE; | 166 virtual void SetJobname(const std::string& jobname) OVERRIDE; |
165 | 167 |
166 virtual void SetOffline(bool offline) OVERRIDE; | 168 virtual void SetOffline(bool offline) OVERRIDE; |
167 | 169 |
168 virtual PrivetHTTPClient* GetHTTPClient() OVERRIDE; | 170 virtual PrivetHTTPClient* GetHTTPClient() OVERRIDE; |
(...skipping 19 matching lines...) Expand all Loading... |
188 void DoCreatejob(); | 190 void DoCreatejob(); |
189 void DoSubmitdoc(); | 191 void DoSubmitdoc(); |
190 | 192 |
191 void OnCapabilitiesResponse(bool has_error, | 193 void OnCapabilitiesResponse(bool has_error, |
192 const base::DictionaryValue* value); | 194 const base::DictionaryValue* value); |
193 void OnSubmitdocResponse(bool has_error, | 195 void OnSubmitdocResponse(bool has_error, |
194 const base::DictionaryValue* value); | 196 const base::DictionaryValue* value); |
195 void OnCreatejobResponse(bool has_error, | 197 void OnCreatejobResponse(bool has_error, |
196 const base::DictionaryValue* value); | 198 const base::DictionaryValue* value); |
197 | 199 |
| 200 void SendDataInternal(); |
| 201 |
198 PrivetHTTPClientImpl* privet_client_; | 202 PrivetHTTPClientImpl* privet_client_; |
199 PrivetLocalPrintOperation::Delegate* delegate_; | 203 PrivetLocalPrintOperation::Delegate* delegate_; |
200 | 204 |
201 ResponseCallback current_response_; | 205 ResponseCallback current_response_; |
202 | 206 |
203 std::string ticket_; | 207 std::string ticket_; |
204 std::string data_; | 208 std::string data_; |
| 209 base::FilePath data_file_; |
205 | 210 |
206 bool use_pdf_; | 211 bool use_pdf_; |
207 bool has_capabilities_; | 212 bool has_capabilities_; |
208 bool has_extended_workflow_; | 213 bool has_extended_workflow_; |
209 bool started_; | 214 bool started_; |
210 bool offline_; | 215 bool offline_; |
211 | 216 |
212 std::string user_; | 217 std::string user_; |
213 std::string jobname_; | 218 std::string jobname_; |
214 | 219 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 PrivetURLFetcherFactory fetcher_factory_; | 275 PrivetURLFetcherFactory fetcher_factory_; |
271 net::HostPortPair host_port_; | 276 net::HostPortPair host_port_; |
272 scoped_ptr<base::DictionaryValue> cached_info_; | 277 scoped_ptr<base::DictionaryValue> cached_info_; |
273 | 278 |
274 scoped_ptr<PrivetInfoOperation> info_operation_; | 279 scoped_ptr<PrivetInfoOperation> info_operation_; |
275 TokenCallbackVector token_callbacks_; | 280 TokenCallbackVector token_callbacks_; |
276 }; | 281 }; |
277 | 282 |
278 } // namespace local_discovery | 283 } // namespace local_discovery |
279 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ | 284 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ |
OLD | NEW |