Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/local_discovery/pwg_raster_converter.h

Issue 935673004: Extract creation of PWG Raster converter settings out of privet_http_impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_PWG_RASTER_CONVERTER_H_ 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_ 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 10
11 namespace base { 11 namespace base {
12 class FilePath; 12 class FilePath;
13 } 13 }
14 14
15 namespace cloud_devices {
16 class CloudDeviceDescription;
17 }
18
15 namespace gfx { 19 namespace gfx {
16 class Size; 20 class Size;
17 } 21 }
18 22
19 namespace printing { 23 namespace printing {
20 class PdfRenderSettings; 24 class PdfRenderSettings;
21 struct PwgRasterSettings; 25 struct PwgRasterSettings;
22 } 26 }
23 27
24 namespace local_discovery { 28 namespace local_discovery {
25 29
26 class PWGRasterConverter { 30 class PWGRasterConverter {
27 public: 31 public:
28 // Callback for when the PDF is converted to a PWG raster. 32 // Callback for when the PDF is converted to a PWG raster.
29 // |success| denotes whether the conversion succeeded. 33 // |success| denotes whether the conversion succeeded.
30 // |temp_file| is the path to the temp file (owned by the converter) that 34 // |temp_file| is the path to the temp file (owned by the converter) that
31 // contains the PWG raster data. 35 // contains the PWG raster data.
32 typedef base::Callback<void(bool /*success*/, 36 typedef base::Callback<void(bool /*success*/,
33 const base::FilePath& /*temp_file*/)> 37 const base::FilePath& /*temp_file*/)>
34 ResultCallback; 38 ResultCallback;
35 virtual ~PWGRasterConverter() {} 39 virtual ~PWGRasterConverter() {}
36 40
37 static scoped_ptr<PWGRasterConverter> CreateDefault(); 41 static scoped_ptr<PWGRasterConverter> CreateDefault();
38 42
43 // Generates conversion settings to be used with converter from printer
44 // capabilities and page size.
45 // TODO(vitalybuka): Extract page size from pdf document data.
46 static printing::PdfRenderSettings GetConversionSettings(
47 const cloud_devices::CloudDeviceDescription& printer_capabilities,
48 const gfx::Size& page_size);
49
50 // Generates pwg bitmap settings to be used with the converter from
51 // device capabilites and printing ticket.
52 static printing::PwgRasterSettings GetBitmapSettings(
53 const cloud_devices::CloudDeviceDescription& printer_capabilities,
54 const cloud_devices::CloudDeviceDescription& ticket);
55
39 virtual void Start(base::RefCountedMemory* data, 56 virtual void Start(base::RefCountedMemory* data,
40 const printing::PdfRenderSettings& conversion_settings, 57 const printing::PdfRenderSettings& conversion_settings,
41 const printing::PwgRasterSettings& bitmap_settings, 58 const printing::PwgRasterSettings& bitmap_settings,
42 const ResultCallback& callback) = 0; 59 const ResultCallback& callback) = 0;
43 }; 60 };
44 61
45 } // namespace local_discovery 62 } // namespace local_discovery
46 63
47 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_ 64 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/privet_http_impl.cc ('k') | chrome/browser/local_discovery/pwg_raster_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698