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

Side by Side Diff: ppapi/proxy/ppb_font_proxy.cc

Issue 9360045: Rename PPB_Font to PPB_BrowserFont_Trusted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 #include "ppapi/proxy/ppb_font_proxy.h"
6
7 #include "ppapi/c/dev/ppb_font_dev.h"
8 #include "ppapi/proxy/plugin_dispatcher.h"
9 #include "ppapi/proxy/plugin_globals.h"
10 #include "ppapi/proxy/plugin_proxy_delegate.h"
11 #include "ppapi/proxy/ppapi_messages.h"
12 #include "ppapi/shared_impl/var.h"
13
14 using ppapi::thunk::PPB_Font_FunctionAPI;
15
16 namespace ppapi {
17 namespace proxy {
18
19 PPB_Font_Proxy::PPB_Font_Proxy(Dispatcher* dispatcher)
20 : InterfaceProxy(dispatcher) {
21 }
22
23 PPB_Font_Proxy::~PPB_Font_Proxy() {
24 }
25
26 PPB_Font_FunctionAPI* PPB_Font_Proxy::AsPPB_Font_FunctionAPI() {
27 return this;
28 }
29
30 // TODO(ananta)
31 // This needs to be wired up to the PPAPI plugin code.
32 PP_Var PPB_Font_Proxy::GetFontFamilies(PP_Instance instance) {
33 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
34 if (!dispatcher)
35 return PP_MakeUndefined();
36
37 // Assume the font families don't change, so we can cache the result globally.
38 CR_DEFINE_STATIC_LOCAL(std::string, families, ());
39 if (families.empty()) {
40 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
41 new PpapiHostMsg_PPBFont_GetFontFamilies(&families));
42 }
43
44 return StringVar::StringToPPVar(families);
45 }
46
47 bool PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) {
48 // There aren't any font messages.
49 NOTREACHED();
50 return false;
51 }
52
53 } // namespace proxy
54 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698