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

Unified Diff: extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h

Issue 973993003: Instead of ArrayBuffer, pass blob with printerProvider.onPrintRequested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & add ext fun histogram 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_internal/printer_provider_internal_api.h
diff --git a/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h b/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
index 703ffb56625987b13ab4789c1baa66201f70f2f6..611e3118ef8b9aada128d5adbc5a43f40e46feed 100644
--- a/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
+++ b/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
@@ -5,6 +5,8 @@
#ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_H_
#define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_H_
+#include <string>
+
#include "base/macros.h"
#include "base/observer_list.h"
#include "extensions/browser/api/printer_provider_internal/printer_provider_internal_api_observer.h"
@@ -18,6 +20,7 @@ class ListValue;
}
namespace content {
+class BlobHandle;
class BrowserContext;
}
@@ -128,6 +131,26 @@ class PrinterProviderInternalReportPrintersFunction
DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintersFunction);
};
+class PrinterProviderInternalGetPrintDataFunction
+ : public UIThreadExtensionFunction {
+ public:
+ PrinterProviderInternalGetPrintDataFunction();
+
+ protected:
+ ~PrinterProviderInternalGetPrintDataFunction() override;
+ ExtensionFunction::ResponseAction Run() override;
+
+ private:
+ void OnBlob(const std::string& type,
+ int size,
+ const scoped_refptr<base::RefCountedMemory>& data,
+ scoped_ptr<content::BlobHandle> blob);
+ DECLARE_EXTENSION_FUNCTION("printerProviderInternal.getPrintData",
+ PRINTERPROVIDERINTERNAL_GETPRINTDATA)
+
+ DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalGetPrintDataFunction);
+};
+
} // namespace extensions
#endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_H_

Powered by Google App Engine
This is Rietveld 408576698