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. 4 5 #include "ppapi/proxy/browser_font_singleton_resource.h" 6 7 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/shared_impl/var.h" 9 10 namespace ppapi { 11 namespace proxy { 12 13 BrowserFontSingletonResource::BrowserFontSingletonResource( 14 Connection connection, 15 PP_Instance instance) 16 : PluginResource(connection, instance) { 17 SendCreate(BROWSER, PpapiHostMsg_BrowserFontSingleton_Create()); 18 } 19 20 BrowserFontSingletonResource::~BrowserFontSingletonResource() { 21 } 22 23 thunk::PPB_BrowserFont_Singleton_API* 24 BrowserFontSingletonResource::AsPPB_BrowserFont_Singleton_API() { 25 return this; 26 } 27 28 PP_Var BrowserFontSingletonResource::GetFontFamilies(PP_Instance instance) { 29 if (families_.empty()) { 30 SyncCall<PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply>( 31 BROWSER, PpapiHostMsg_BrowserFontSingleton_GetFontFamilies(), 32 &families_); 33 } 34 return StringVar::StringToPPVar(families_); 35 } 36 37 } // namespace proxy 38 } // namespace ppapi 39