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

Unified Diff: extensions/browser/api/printer_provider/printer_provider_print_job.h

Issue 973993003: Instead of ArrayBuffer, pass blob with printerProvider.onPrintRequested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kalman feedback 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/printer_provider/printer_provider_print_job.h
diff --git a/extensions/browser/api/printer_provider/printer_provider_print_job.h b/extensions/browser/api/printer_provider/printer_provider_print_job.h
index 36967c4f3daa3293db495280925daae0a5fd7b39..81fc9b8674fd47fd1aa6aabfa60cb8e4f548803f 100644
--- a/extensions/browser/api/printer_provider/printer_provider_print_job.h
+++ b/extensions/browser/api/printer_provider/printer_provider_print_job.h
@@ -7,7 +7,8 @@
#include <string>
-#include "base/macros.h"
+#include "base/files/file.h"
+#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
@@ -15,6 +16,9 @@ namespace extensions {
// Struct describing print job that should be forwarded to an extension via
// chrome.printerProvider.onPrintRequested event.
+// TODO(tbarzic): This should probably be a class and have some methods, e.g.
+// whether the job is initialized and whether the data is described using a file
+// or bytes.
struct PrinterProviderPrintJob {
PrinterProviderPrintJob();
~PrinterProviderPrintJob();
@@ -32,11 +36,17 @@ struct PrinterProviderPrintJob {
// Content type of the document that should be printed.
std::string content_type;
- // The document data that should be printed.
+ // The document data that should be printed. Should be NULL if document data
+ // is kept in a file.
scoped_refptr<base::RefCountedMemory> document_bytes;
- private:
- DISALLOW_COPY_AND_ASSIGN(PrinterProviderPrintJob);
+ // Path of the file which contains data to be printed. Should be set only if
+ // |document_bytes| are NULL.
+ base::FilePath document_path;
+
+ // Information about the file which contains data to be printed. Should be
+ // set only if |document_path| is set.
+ base::File::Info file_info;
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698