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

Side by Side Diff: ppapi/thunk/ppb_flash_fullscreen_thunk.cc

Issue 10091003: Convert flash to thunk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/c/dev/ppb_fullscreen_dev.h" 5 #include "ppapi/c/dev/ppb_fullscreen_dev.h"
6 #include "ppapi/c/private/ppb_flash_fullscreen.h" 6 #include "ppapi/c/private/ppb_flash_fullscreen.h"
7 #include "ppapi/thunk/thunk.h" 7 #include "ppapi/thunk/thunk.h"
8 #include "ppapi/thunk/enter.h" 8 #include "ppapi/thunk/enter.h"
9 #include "ppapi/thunk/ppb_instance_api.h" 9 #include "ppapi/thunk/ppb_instance_api.h"
10 #include "ppapi/thunk/ppb_flash_api.h"
10 #include "ppapi/thunk/resource_creation_api.h" 11 #include "ppapi/thunk/resource_creation_api.h"
11 12
12 namespace ppapi { 13 namespace ppapi {
13 namespace thunk { 14 namespace thunk {
14 15
15 namespace { 16 namespace {
16 17
17 PP_Bool IsFullscreen(PP_Instance instance) { 18 PP_Bool IsFullscreen(PP_Instance instance) {
18 EnterInstance enter(instance); 19 EnterInstance enter(instance);
19 if (enter.failed()) 20 if (enter.failed())
20 return PP_FALSE; 21 return PP_FALSE;
21 return enter.functions()->FlashIsFullscreen(instance); 22 return enter.functions()->GetFlashAPI()->FlashIsFullscreen(instance);
22 } 23 }
23 24
24 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { 25 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) {
25 EnterInstance enter(instance); 26 EnterInstance enter(instance);
26 if (enter.failed()) 27 if (enter.failed())
27 return PP_FALSE; 28 return PP_FALSE;
28 return enter.functions()->FlashSetFullscreen(instance, fullscreen); 29 return enter.functions()->GetFlashAPI()->FlashSetFullscreen(instance,
30 fullscreen);
29 } 31 }
30 32
31 PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) { 33 PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) {
32 EnterInstance enter(instance); 34 EnterInstance enter(instance);
33 if (enter.failed()) 35 if (enter.failed())
34 return PP_FALSE; 36 return PP_FALSE;
35 return enter.functions()->FlashGetScreenSize(instance, size); 37 return enter.functions()->GetFlashAPI()->FlashGetScreenSize(instance, size);
36 } 38 }
37 39
38 const PPB_FlashFullscreen g_ppb_flash_fullscreen_thunk = { 40 const PPB_FlashFullscreen g_ppb_flash_fullscreen_thunk = {
39 &IsFullscreen, 41 &IsFullscreen,
40 &SetFullscreen, 42 &SetFullscreen,
41 &GetScreenSize 43 &GetScreenSize
42 }; 44 };
43 45
44 } // namespace 46 } // namespace
45 47
46 const PPB_FlashFullscreen_0_1* GetPPB_FlashFullscreen_0_1_Thunk() { 48 const PPB_FlashFullscreen_0_1* GetPPB_FlashFullscreen_0_1_Thunk() {
47 return &g_ppb_flash_fullscreen_thunk; 49 return &g_ppb_flash_fullscreen_thunk;
48 } 50 }
49 51
50 } // namespace thunk 52 } // namespace thunk
51 } // namespace ppapi 53 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698