summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/truetype_font_singleton_resource.h
diff options
context:
space:
mode:
authorbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-16 09:57:51 +0000
committerbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-16 09:57:51 +0000
commit725056b71817b5b35c49bad39ddc44d7156c4086 (patch)
tree7f83956f8bb9a224c913d9a22b71078a595d32ab /ppapi/proxy/truetype_font_singleton_resource.h
parentaffb072ce9b81d57d8b62c281eedeab7ab14a29c (diff)
downloadchromium_src-725056b71817b5b35c49bad39ddc44d7156c4086.zip
chromium_src-725056b71817b5b35c49bad39ddc44d7156c4086.tar.gz
chromium_src-725056b71817b5b35c49bad39ddc44d7156c4086.tar.bz2
Add Pepper TrueType font API plumbing.
Adds Font resource and host, font singleton resource and host. Adds PPAPI IPC messages to communicate with renderer and browser. Adds Browser process font listing helper class abstraction and impls for Windows, Mac, and Linux. Font family enumeration is done in the browser process and is a rework of the trusted BrowserFont API. Adds Renderer process font helper class abstraction and impl stubs. Font operations are done in the renderer process because of Linux sandbox restrictions. BUG=79375 Review URL: https://chromiumcodereview.appspot.com/12600019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/truetype_font_singleton_resource.h')
-rw-r--r--ppapi/proxy/truetype_font_singleton_resource.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/ppapi/proxy/truetype_font_singleton_resource.h b/ppapi/proxy/truetype_font_singleton_resource.h
new file mode 100644
index 0000000..03c9c7d
--- /dev/null
+++ b/ppapi/proxy/truetype_font_singleton_resource.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2013 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 PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_
+#define PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_
+
+#include <string>
+#include <vector>
+
+#include "ppapi/proxy/connection.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/thunk/ppb_truetype_font_singleton_api.h"
+
+namespace ppapi {
+
+class TrackedCallback;
+
+namespace proxy {
+
+struct SerializedTrueTypeFontDescription;
+
+// This handles the singleton calls (that don't take a PP_Resource parameter)
+// on the TrueType font interface.
+class TrueTypeFontSingletonResource
+ : public PluginResource,
+ public thunk::PPB_TrueTypeFont_Singleton_API {
+ public:
+ TrueTypeFontSingletonResource(Connection connection, PP_Instance instance);
+ virtual ~TrueTypeFontSingletonResource();
+
+ // Resource override.
+ virtual thunk::PPB_TrueTypeFont_Singleton_API*
+ AsPPB_TrueTypeFont_Singleton_API() OVERRIDE;
+
+ // thunk::PPB_TrueTypeFont_Singleton_API implementation.
+ virtual int32_t GetFontFamilies(
+ PP_Instance instance,
+ const PP_ArrayOutput& output,
+ const scoped_refptr<TrackedCallback>& callback) OVERRIDE;
+
+ private:
+ void OnPluginMsgGetFontFamiliesComplete(
+ scoped_refptr<TrackedCallback> callback,
+ PP_ArrayOutput array_output,
+ const ResourceMessageReplyParams& params,
+ const std::vector<std::string>& data);
+
+ DISALLOW_COPY_AND_ASSIGN(TrueTypeFontSingletonResource);
+};
+
+} // namespace proxy
+} // namespace ppapi
+
+#endif // PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_