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

Side by Side Diff: chrome/renderer/pepper/pepper_pdf_host.h

Issue 13004012: Implement the host side of the PPB_PDF proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_
6 #define CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "ppapi/c/ppb_image_data.h"
13 #include "ppapi/c/private/ppb_pdf.h"
14 #include "ppapi/host/resource_host.h"
15 #include "ppapi/proxy/serialized_structs.h"
16
17 struct PP_Size;
18 class SkBitmap;
19
20 namespace content {
21 class RendererPpapiHost;
22 }
23
24 namespace ppapi {
25 class HostResource;
26 }
27
28 namespace ppapi {
29 namespace host {
30 struct HostMessageContext;
31 }
32 }
33
34 namespace chrome {
35
36 class PepperPDFHost : public ppapi::host::ResourceHost {
37 public:
38 PepperPDFHost(content::RendererPpapiHost* host,
39 PP_Instance instance,
40 PP_Resource resource);
41 virtual ~PepperPDFHost();
42
43 virtual int32_t OnResourceMessageReceived(
44 const IPC::Message& msg,
45 ppapi::host::HostMessageContext* context) OVERRIDE;
46
47 private:
48 int32_t OnHostMsgGetLocalizedString(ppapi::host::HostMessageContext* context,
49 PP_ResourceString string_id);
50 int32_t OnHostMsgDidStartLoading(ppapi::host::HostMessageContext* context);
51 int32_t OnHostMsgDidStopLoading(ppapi::host::HostMessageContext* context);
52 int32_t OnHostMsgSetContentRestriction(
53 ppapi::host::HostMessageContext* context,
54 int restrictions);
55 int32_t OnHostMsgUserMetricsRecordAction(
56 ppapi::host::HostMessageContext* context,
57 const std::string& action);
58 int32_t OnHostMsgHasUnsupportedFeature(
59 ppapi::host::HostMessageContext* context);
60 int32_t OnHostMsgPrint(ppapi::host::HostMessageContext* context);
61 int32_t OnHostMsgSaveAs(ppapi::host::HostMessageContext* context);
62 int32_t OnHostMsgGetResourceImage(ppapi::host::HostMessageContext* context,
63 PP_ResourceImage image_id,
64 float scale);
65
66 bool CreateImageData(PP_Instance instance,
67 PP_ImageDataFormat format,
68 const PP_Size& size,
69 const SkBitmap& pixels_to_write,
70 ppapi::HostResource* result,
71 std::string* out_image_data_desc,
72 ppapi::proxy::ImageHandle* out_image_handle,
73 uint32_t* out_byte_count);
74
75 content::RendererPpapiHost* host_;
76
77 DISALLOW_COPY_AND_ASSIGN(PepperPDFHost);
78 };
79
80 } // namespace chrome
81
82 #endif // CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc ('k') | chrome/renderer/pepper/pepper_pdf_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698