| Index: ppapi/proxy/flash_resource.cc
|
| diff --git a/ppapi/proxy/flash_resource.cc b/ppapi/proxy/flash_resource.cc
|
| index be5acd3a851eb26532aa54b95d96768e90bea998..42c1c427774625c63aaa77aa0a6eca8aa5a1f560 100644
|
| --- a/ppapi/proxy/flash_resource.cc
|
| +++ b/ppapi/proxy/flash_resource.cc
|
| @@ -6,15 +6,22 @@
|
|
|
| #include "ppapi/c/pp_errors.h"
|
| #include "ppapi/c/private/ppb_flash.h"
|
| +#include "ppapi/proxy/plugin_dispatcher.h"
|
| #include "ppapi/proxy/plugin_globals.h"
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| +#include "ppapi/shared_impl/ppapi_preferences.h"
|
| +#include "ppapi/shared_impl/scoped_pp_var.h"
|
| #include "ppapi/shared_impl/var.h"
|
| +#include "ppapi/thunk/enter.h"
|
|
|
| namespace ppapi {
|
| namespace proxy {
|
|
|
| -FlashResource::FlashResource(Connection connection, PP_Instance instance)
|
| - : PluginResource(connection, instance) {
|
| +FlashResource::FlashResource(Connection connection,
|
| + PP_Instance instance,
|
| + PluginDispatcher* plugin_dispatcher)
|
| + : PluginResource(connection, instance),
|
| + plugin_dispatcher_(plugin_dispatcher) {
|
| SendCreate(RENDERER, PpapiHostMsg_Flash_Create());
|
| SendCreate(BROWSER, PpapiHostMsg_Flash_Create());
|
| }
|
| @@ -56,5 +63,35 @@ PP_Bool FlashResource::SetCrashData(PP_Instance instance,
|
| return PP_FALSE;
|
| }
|
|
|
| +PP_Var FlashResource::GetSetting(PP_Instance instance,
|
| + PP_FlashSetting setting) {
|
| + switch (setting) {
|
| + case PP_FLASHSETTING_3DENABLED:
|
| + return PP_MakeBool(PP_FromBool(
|
| + plugin_dispatcher_->preferences().is_3d_supported));
|
| + case PP_FLASHSETTING_INCOGNITO:
|
| + return PP_MakeBool(PP_FromBool(plugin_dispatcher_->incognito()));
|
| + case PP_FLASHSETTING_STAGE3DENABLED:
|
| + return PP_MakeBool(PP_FromBool(
|
| + plugin_dispatcher_->preferences().is_stage3d_supported));
|
| + case PP_FLASHSETTING_LANGUAGE:
|
| + return StringVar::StringToPPVar(
|
| + PluginGlobals::Get()->GetUILanguage());
|
| + case PP_FLASHSETTING_NUMCORES:
|
| + return PP_MakeInt32(
|
| + plugin_dispatcher_->preferences().number_of_cpu_cores);
|
| + case PP_FLASHSETTING_LSORESTRICTIONS: {
|
| + int32_t restrictions;
|
| + int32_t result =
|
| + SyncCall<PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply>(BROWSER,
|
| + PpapiHostMsg_Flash_GetLocalDataRestrictions(), &restrictions);
|
| + if (result != PP_OK)
|
| + return PP_MakeInt32(PP_FLASHLSORESTRICTIONS_NONE);
|
| + return PP_MakeInt32(restrictions);
|
| + }
|
| + }
|
| + return PP_MakeUndefined();
|
| +}
|
| +
|
| } // namespace proxy
|
| } // namespace ppapi
|
|
|