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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/pepper/pepper_pdf_host.h
diff --git a/chrome/renderer/pepper/pepper_pdf_host.h b/chrome/renderer/pepper/pepper_pdf_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecc4dca5bea66fe45b87a754bc182ee699e56f69
--- /dev/null
+++ b/chrome/renderer/pepper/pepper_pdf_host.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_
+#define CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "ppapi/c/private/ppb_pdf.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/proxy/serialized_structs.h"
+
+struct PP_Size;
+class SkBitmap;
+
+namespace content {
+class RendererPpapiHost;
+}
+
+namespace ppapi {
+class HostResource;
+}
+
+namespace ppapi {
+namespace host {
+struct HostMessageContext;
+}
+}
+
+namespace chrome {
+
+class PepperPDFHost : public ppapi::host::ResourceHost {
+ public:
+ PepperPDFHost(content::RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+ virtual ~PepperPDFHost();
+
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ private:
+ int32_t OnHostMsgGetLocalizedString(ppapi::host::HostMessageContext* context,
+ int string_id);
+ int32_t OnHostMsgDidStartLoading(ppapi::host::HostMessageContext* context);
+ int32_t OnHostMsgDidStopLoading(ppapi::host::HostMessageContext* context);
+ int32_t OnHostMsgSetContentRestriction(
+ ppapi::host::HostMessageContext* context,
+ int restrictions);
+ int32_t OnHostMsgUserMetricsRecordAction(
+ ppapi::host::HostMessageContext* context,
+ std::string action);
yzshen1 2013/04/03 18:32:39 const &?
raymes 2013/04/03 23:18:21 Done.
+ int32_t OnHostMsgHasUnsupportedFeature(
+ ppapi::host::HostMessageContext* context);
+ int32_t OnHostMsgPrint(ppapi::host::HostMessageContext* context);
+ int32_t OnHostMsgSaveAs(ppapi::host::HostMessageContext* context);
+ int32_t OnHostMsgGetResourceImage(ppapi::host::HostMessageContext* context,
+ int image_id,
+ float scale);
+
+ bool CreateImageData(PP_Instance instance,
+ int32_t format,
+ const PP_Size& size,
+ const SkBitmap& pixels_to_write,
+ ppapi::HostResource* result,
+ std::string* out_image_data_desc,
+ ppapi::proxy::ImageHandle* out_image_handle,
+ uint32_t* out_byte_count);
+
+ content::RendererPpapiHost* host_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperPDFHost);
+};
+
+} // namespace chrome
+
+#endif // CHROME_RENDERER_PEPPER_PEPPER_PDF_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698