scoped_ptr<PrivetURLFetcher> url_fetcher_;
};
+class PrivetDataReadOperationImpl : public PrivetDataReadOperation,
+ public PrivetURLFetcher::Delegate {
+ public:
+ PrivetDataReadOperationImpl(
+ PrivetHTTPClientImpl* privet_client,
+ const std::string& path,
+ const std::string& query_params,
+ const PrivetDataReadOperation::ResultCallback& callback);
+ virtual ~PrivetDataReadOperationImpl();
+
+ virtual void Start() OVERRIDE;
+
+ virtual void SetDataRange(int range_start, int range_end) OVERRIDE;
+
+ virtual void SaveDataToFile() OVERRIDE;
+
+ virtual PrivetHTTPClient* GetHTTPClient() OVERRIDE;
+
+ virtual void OnError(PrivetURLFetcher* fetcher,
+ PrivetURLFetcher::ErrorType error) OVERRIDE;
+ virtual void OnParsedJson(PrivetURLFetcher* fetcher,
+ const base::DictionaryValue* value,
+ bool has_error) OVERRIDE;
+ virtual void OnNeedPrivetToken(
+ PrivetURLFetcher* fetcher,
+ const PrivetURLFetcher::TokenCallback& callback) OVERRIDE;
+ virtual bool OnRawData(PrivetURLFetcher* fetcher,
+ bool is_file,
+ const std::string& data_str,
+ const base::FilePath& file_path) OVERRIDE;
+
+ private:
+ PrivetHTTPClientImpl* privet_client_;
+ std::string path_;
+ std::string query_params_;
+ int range_start_;
+ int range_end_;
+ PrivetDataReadOperation::ResultCallback callback_;
+
+ bool has_range_;
+ bool save_to_file_;
+
+ scoped_ptr<PrivetURLFetcher> url_fetcher_;
+};
+
class PrivetLocalPrintOperationImpl
: public PrivetLocalPrintOperation,
public PrivetURLFetcher::Delegate {
virtual void SetOffline(bool offline) OVERRIDE;
- virtual void SetConversionSettings(
- const printing::PdfRenderSettings& conversion_settings) OVERRIDE;
+ virtual void SetPageSize(const gfx::Size& page_size) OVERRIDE;
virtual void SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) OVERRIDE;
bool has_extended_workflow_;
bool started_;
bool offline_;
- printing::PdfRenderSettings conversion_settings_;
+ gfx::Size page_size_;
+ int dpi_;
std::string user_;
std::string jobname_;
const std::string& path,
const PrivetJSONOperation::ResultCallback& callback) OVERRIDE;
+ virtual scoped_ptr<PrivetDataReadOperation> CreateStorageReadOperation(
+ const std::string& path,
+ const PrivetDataReadOperation::ResultCallback& callback) OVERRIDE;
+
virtual const std::string& GetName() OVERRIDE;
scoped_ptr<PrivetURLFetcher> CreateURLFetcher(