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

Side by Side Diff: chrome/browser/ui/webui/print_preview/extension_printer_handler.h

Issue 922833004: Make PrinterProviderAPI a pure interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/extension_printer_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // by |printer_description|. 66 // by |printer_description|.
67 // |callback| is called with the converted data. 67 // |callback| is called with the converted data.
68 void ConvertToPWGRaster( 68 void ConvertToPWGRaster(
69 const scoped_refptr<base::RefCountedMemory>& data, 69 const scoped_refptr<base::RefCountedMemory>& data,
70 const cloud_devices::CloudDeviceDescription& printer_description, 70 const cloud_devices::CloudDeviceDescription& printer_description,
71 const std::string& ticket, 71 const std::string& ticket,
72 const gfx::Size& page_size, 72 const gfx::Size& page_size,
73 const RefCountedMemoryCallback& callback); 73 const RefCountedMemoryCallback& callback);
74 74
75 // Sets print job document data and dispatches it using printerProvider API. 75 // Sets print job document data and dispatches it using printerProvider API.
76 // TODO(tbarzic): Move PrinterProvider::PrintJob to it's own file so it can
77 // be forward-declared.
78 void DispatchPrintJob( 76 void DispatchPrintJob(
79 const PrinterHandler::PrintCallback& callback, 77 const PrinterHandler::PrintCallback& callback,
80 scoped_ptr<extensions::PrinterProviderAPI::PrintJob> print_job, 78 scoped_ptr<extensions::PrinterProviderPrintJob> print_job,
81 const scoped_refptr<base::RefCountedMemory>& data); 79 const scoped_refptr<base::RefCountedMemory>& data);
82 80
83 // Methods used as wrappers to callbacks for extensions::PrinterProviderAPI 81 // Methods used as wrappers to callbacks for extensions::PrinterProviderAPI
84 // methods, primarily so the callbacks can be bound to this class' weak ptr. 82 // methods, primarily so the callbacks can be bound to this class' weak ptr.
85 // They just propagate results to callbacks passed to them. 83 // They just propagate results to callbacks passed to them.
86 void WrapGetPrintersCallback( 84 void WrapGetPrintersCallback(
87 const PrinterHandler::GetPrintersCallback& callback, 85 const PrinterHandler::GetPrintersCallback& callback,
88 const base::ListValue& pritners, 86 const base::ListValue& pritners,
89 bool done); 87 bool done);
90 void WrapGetCapabilityCallback( 88 void WrapGetCapabilityCallback(
91 const PrinterHandler::GetCapabilityCallback& callback, 89 const PrinterHandler::GetCapabilityCallback& callback,
92 const std::string& destination_id, 90 const std::string& destination_id,
93 const base::DictionaryValue& capability); 91 const base::DictionaryValue& capability);
94 void WrapPrintCallback(const PrinterHandler::PrintCallback& callback, 92 void WrapPrintCallback(const PrinterHandler::PrintCallback& callback,
95 bool success, 93 bool success,
96 const std::string& status); 94 const std::string& status);
97 95
98 content::BrowserContext* browser_context_; 96 content::BrowserContext* browser_context_;
99 97
100 scoped_ptr<local_discovery::PWGRasterConverter> pwg_raster_converter_; 98 scoped_ptr<local_discovery::PWGRasterConverter> pwg_raster_converter_;
101 99
102 base::WeakPtrFactory<ExtensionPrinterHandler> weak_ptr_factory_; 100 base::WeakPtrFactory<ExtensionPrinterHandler> weak_ptr_factory_;
103 101
104 DISALLOW_COPY_AND_ASSIGN(ExtensionPrinterHandler); 102 DISALLOW_COPY_AND_ASSIGN(ExtensionPrinterHandler);
105 }; 103 };
106 104
107 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_H_ 105 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/extension_printer_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698