1 // Copyright (c) 2012 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 #include "ppapi/proxy/browser_font_singleton_resource.h"
7 #include "ppapi/proxy/ppapi_messages.h"
8 #include "ppapi/shared_impl/var.h"
13 BrowserFontSingletonResource::BrowserFontSingletonResource(
14 Connection connection
,
16 : PluginResource(connection
, instance
) {
17 SendCreate(BROWSER
, PpapiHostMsg_BrowserFontSingleton_Create());
20 BrowserFontSingletonResource::~BrowserFontSingletonResource() {
23 thunk::PPB_BrowserFont_Singleton_API
*
24 BrowserFontSingletonResource::AsPPB_BrowserFont_Singleton_API() {
28 PP_Var
BrowserFontSingletonResource::GetFontFamilies(PP_Instance instance
) {
29 if (families_
.empty()) {
30 SyncCall
<PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply
>(
31 BROWSER
, PpapiHostMsg_BrowserFontSingleton_GetFontFamilies(),
34 return StringVar::StringToPPVar(families_
);