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.
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "content/common/content_export.h"
12 #include "content/renderer/pepper/pepper_truetype_font.h"
13 #include "ppapi/host/resource_host.h"
17 class RendererPpapiHost;
19 class CONTENT_EXPORT PepperTrueTypeFontHost : public ppapi::host::ResourceHost {
21 PepperTrueTypeFontHost(RendererPpapiHost* host,
24 const ppapi::proxy::SerializedTrueTypeFontDesc& desc);
26 virtual ~PepperTrueTypeFontHost();
28 virtual int32_t OnResourceMessageReceived(
29 const IPC::Message& msg,
30 ppapi::host::HostMessageContext* context) OVERRIDE;
33 int32_t OnHostMsgDescribe(ppapi::host::HostMessageContext* context);
34 int32_t OnHostMsgGetTableTags(ppapi::host::HostMessageContext* context);
35 int32_t OnHostMsgGetTable(ppapi::host::HostMessageContext* context,
38 int32_t max_data_length);
40 RendererPpapiHost* renderer_ppapi_host_;
41 scoped_ptr<PepperTrueTypeFont> font_;
43 base::WeakPtrFactory<PepperTrueTypeFontHost> weak_factory_;
45 DISALLOW_COPY_AND_ASSIGN(PepperTrueTypeFontHost);
48 } // namespace content
50 #endif // CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_