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

Unified Diff: ppapi/proxy/ppb_font_proxy.cc

Issue 7044012: Support getting the font list in Pepper. This currently only works out of (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.h ('k') | ppapi/shared_impl/function_group_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_font_proxy.cc
===================================================================
--- ppapi/proxy/ppb_font_proxy.cc (revision 85766)
+++ ppapi/proxy/ppb_font_proxy.cc (working copy)
@@ -9,7 +9,9 @@
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_image_data_proxy.h"
+#include "ppapi/proxy/serialized_var.h"
#include "ppapi/shared_impl/resource_object_base.h"
+#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_image_data_api.h"
#include "ppapi/thunk/thunk.h"
@@ -61,6 +63,28 @@
return &info;
}
+::ppapi::thunk::PPB_Font_FunctionAPI* PPB_Font_Proxy::AsFont_FunctionAPI() {
+ return this;
+}
+
+PP_Var PPB_Font_Proxy::GetFontFamilies(PP_Instance instance) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return PP_MakeUndefined();
+
+ // Assume the font families don't change, so we can cache the result globally.
+ static std::string families;
+ if (families.empty()) {
+ dispatcher->SendToBrowser(
+ new PpapiHostMsg_PPBFont_GetFontFamilies(&families));
+ }
+
+ PP_Var result;
+ result.type = PP_VARTYPE_STRING;
+ result.value.as_id = PluginVarTracker::GetInstance()->MakeString(families);
+ return result;
+}
+
bool PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) {
// There aren't any font messages.
NOTREACHED();
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.h ('k') | ppapi/shared_impl/function_group_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698