diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 20:15:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 20:15:25 +0000 |
commit | 7a26d92ecbe0ec01d433a4bc97106b4743c15049 (patch) | |
tree | 8ec52949f54934b188ae3b345f9ecf212435839b /ppapi/proxy/ppb_instance_proxy.cc | |
parent | 94394dc91c469fe2f851769784e4f2d81e0c9573 (diff) | |
download | chromium_src-7a26d92ecbe0ec01d433a4bc97106b4743c15049.zip chromium_src-7a26d92ecbe0ec01d433a4bc97106b4743c15049.tar.gz chromium_src-7a26d92ecbe0ec01d433a4bc97106b4743c15049.tar.bz2 |
Rename PPB_Font to PPB_BrowserFont_Trusted.
PPB_Font can never be exported to NaCl since it relies on in-process WebKit.
So I'm renaming this to BrowserFont_Trusted to imply that this is the way that
the browser would render fonts in the content area (if we export a font API to
NaCl in the future, it will likely be a simpler native font API).
The new API is binary compatible with the old font API, so I map PPB_Font to
PPB_BrowserFont_Trusted for now to avoid breaking Flash (which uses this). When
we update Flash and push it out, we can remove the mapping and PPB_Font.
This does a lot of cleanup of the font implementation. It had complexity from
the fact that it used to run on a different thread. I was able to remove a lot
of code.
Review URL: https://chromiumcodereview.appspot.com/9360045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_instance_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 7cc33f0..5bdde43 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -12,11 +12,13 @@ #include "ppapi/proxy/enter_proxy.h" #include "ppapi/proxy/host_dispatcher.h" #include "ppapi/proxy/plugin_dispatcher.h" +#include "ppapi/proxy/plugin_proxy_delegate.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/serialized_var.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/ppb_url_util_shared.h" #include "ppapi/shared_impl/ppb_view_shared.h" +#include "ppapi/shared_impl/var.h" #include "ppapi/thunk/enter.h" #include "ppapi/thunk/thunk.h" @@ -213,6 +215,21 @@ PP_Bool PPB_Instance_Proxy::FlashIsFullscreen(PP_Instance instance) { return data->flash_fullscreen; } +PP_Var PPB_Instance_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. + CR_DEFINE_STATIC_LOCAL(std::string, families, ()); + if (families.empty()) { + PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( + new PpapiHostMsg_PPBInstance_GetFontFamilies(&families)); + } + + return StringVar::StringToPPVar(families); +} + PP_Bool PPB_Instance_Proxy::SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { PP_Bool result = PP_FALSE; |