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

Side by Side 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, 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
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 EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN AL_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN AL_API_H_
6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN AL_API_H_ 6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN AL_API_H_
7 7
8 #include <string>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/observer_list.h" 11 #include "base/observer_list.h"
10 #include "extensions/browser/api/printer_provider_internal/printer_provider_inte rnal_api_observer.h" 12 #include "extensions/browser/api/printer_provider_internal/printer_provider_inte rnal_api_observer.h"
11 #include "extensions/browser/browser_context_keyed_api_factory.h" 13 #include "extensions/browser/browser_context_keyed_api_factory.h"
12 #include "extensions/browser/extension_function.h" 14 #include "extensions/browser/extension_function.h"
13 #include "extensions/common/api/printer_provider_internal.h" 15 #include "extensions/common/api/printer_provider_internal.h"
14 16
15 namespace base { 17 namespace base {
16 class DictionaryValue; 18 class DictionaryValue;
17 class ListValue; 19 class ListValue;
18 } 20 }
19 21
20 namespace content { 22 namespace content {
23 class BlobHandle;
21 class BrowserContext; 24 class BrowserContext;
22 } 25 }
23 26
24 namespace extensions { 27 namespace extensions {
25 class Extension; 28 class Extension;
26 } 29 }
27 30
28 namespace extensions { 31 namespace extensions {
29 32
30 // Internal API instance. Primarily used to enable observers to watch for when 33 // Internal API instance. Primarily used to enable observers to watch for when
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ~PrinterProviderInternalReportPrintersFunction() override; 124 ~PrinterProviderInternalReportPrintersFunction() override;
122 ExtensionFunction::ResponseAction Run() override; 125 ExtensionFunction::ResponseAction Run() override;
123 126
124 private: 127 private:
125 DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrinters", 128 DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrinters",
126 PRINTERPROVIDERINTERNAL_REPORTPRINTERS) 129 PRINTERPROVIDERINTERNAL_REPORTPRINTERS)
127 130
128 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintersFunction); 131 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintersFunction);
129 }; 132 };
130 133
134 class PrinterProviderInternalGetPrintDataFunction
135 : public UIThreadExtensionFunction {
136 public:
137 PrinterProviderInternalGetPrintDataFunction();
138
139 protected:
140 ~PrinterProviderInternalGetPrintDataFunction() override;
141 ExtensionFunction::ResponseAction Run() override;
142
143 private:
144 void OnBlob(const std::string& type,
145 int size,
146 const scoped_refptr<base::RefCountedMemory>& data,
147 scoped_ptr<content::BlobHandle> blob);
148 DECLARE_EXTENSION_FUNCTION("printerProviderInternal.getPrintData",
149 PRINTERPROVIDERINTERNAL_GETPRINTDATA)
150
151 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalGetPrintDataFunction);
152 };
153
131 } // namespace extensions 154 } // namespace extensions
132 155
133 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INT ERNAL_API_H_ 156 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INT ERNAL_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698