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

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) 2012 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/private/ppb_pdf.h"
13 #include "ppapi/host/resource_host.h"
14 #include "ppapi/proxy/serialized_structs.h"
15
16 struct PP_Size;
17 class SkBitmap;
18
19 namespace content {
20 class RendererPpapiHost;
21 }
22
23 namespace ppapi {
24 class HostResource;
25 }
26
27 namespace ppapi {
28 namespace host {
29 struct HostMessageContext;
30 }
31 }
32
33 namespace chrome {
34
35 class PepperPDFHost : public ppapi::host::ResourceHost {
36 public:
37 PepperPDFHost(content::RendererPpapiHost* host,
38 PP_Instance instance,
39 PP_Resource resource);
40 virtual ~PepperPDFHost();
41
42 virtual int32_t OnResourceMessageReceived(
43 const IPC::Message& msg,
44 ppapi::host::HostMessageContext* context) OVERRIDE;
45
46 private:
47 int32_t OnHostMsgGetLocalizedString(ppapi::host::HostMessageContext* context,
48 int string_id);
49 int32_t OnHostMsgDidStartLoading(ppapi::host::HostMessageContext* context);
50 int32_t OnHostMsgDidStopLoading(ppapi::host::HostMessageContext* context);
51 int32_t OnHostMsgSetContentRestriction(
52 ppapi::host::HostMessageContext* context,
53 int restrictions);
54 int32_t OnHostMsgUserMetricsRecordAction(
55 ppapi::host::HostMessageContext* context,
56 std::string action);
yzshen1 2013/04/03 18:32:39 const &?
raymes 2013/04/03 23:18:21 Done.
57 int32_t OnHostMsgHasUnsupportedFeature(
58 ppapi::host::HostMessageContext* context);
59 int32_t OnHostMsgPrint(ppapi::host::HostMessageContext* context);
60 int32_t OnHostMsgSaveAs(ppapi::host::HostMessageContext* context);
61 int32_t OnHostMsgGetResourceImage(ppapi::host::HostMessageContext* context,
62 int image_id,
63 float scale);
64
65 bool CreateImageData(PP_Instance instance,
66 int32_t format,
67 const PP_Size& size,
68 const SkBitmap& pixels_to_write,
69 ppapi::HostResource* result,
70 std::string* out_image_data_desc,
71 ppapi::proxy::ImageHandle* out_image_handle,
72 uint32_t* out_byte_count);
73
74 content::RendererPpapiHost* host_;
75
76 DISALLOW_COPY_AND_ASSIGN(PepperPDFHost);
77 };
78
79 } // namespace chrome
80
81 #endif // CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698