diff options
author | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-14 21:59:17 +0000 |
---|---|---|
committer | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-14 21:59:17 +0000 |
commit | 6570e56784b0970646c5c4c704e155015400a032 (patch) | |
tree | 6b3adbd125f753a275233834545bedee2a4c8302 /ppapi | |
parent | d280ab686b2dbfe743bbaa7d39e9d2f03af82e31 (diff) | |
download | chromium_src-6570e56784b0970646c5c4c704e155015400a032.zip chromium_src-6570e56784b0970646c5c4c704e155015400a032.tar.gz chromium_src-6570e56784b0970646c5c4c704e155015400a032.tar.bz2 |
PPAPI Fullscreen: move out of Dev.
BUG=41780
TEST=in CL
Review URL: http://codereview.chromium.org/8291002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
26 files changed, 247 insertions, 60 deletions
diff --git a/ppapi/api/ppb_fullscreen.idl b/ppapi/api/ppb_fullscreen.idl new file mode 100644 index 0000000..81d8dcf --- /dev/null +++ b/ppapi/api/ppb_fullscreen.idl @@ -0,0 +1,49 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the <code>PPB_Fullscreen</code> interface. + */ + +label Chrome { + M16 = 1.0 +}; + +interface PPB_Fullscreen { + /** + * Checks whether the plugin instance is currently in fullscreen mode. + */ + PP_Bool IsFullscreen( + [in] PP_Instance instance); + + /** + * Switches the plugin instance to/from fullscreen mode. Returns PP_TRUE on + * success, PP_FALSE on failure. + * + * This unbinds the current 2D or 3D devices. Pending flushes and swapbuffers + * will execute as if the resource was off-screen. The transition to and from + * fullscreen is asynchronous. During the transition, IsFullscreen will + * return the original value, and no 2D or 3D device can be bound. + * The transition ends at DidChangeView when IsFullscreen returns the new + * value. You might receive other DidChangeView calls while in + * transition. + * + * The transition to fullscreen can only occur while the browser is + * processing a user gesture, even if PP_TRUE is returned. + */ + PP_Bool SetFullscreen( + [in] PP_Instance instance, + [in] PP_Bool fullscreen); + + /** + * Gets the size of the screen in pixels. When going fullscreen, the instance + * will be resized to that size. + */ + PP_Bool GetScreenSize( + [in] PP_Instance instance, + [out] PP_Size size); +}; + diff --git a/ppapi/c/ppb_fullscreen.h b/ppapi/c/ppb_fullscreen.h new file mode 100644 index 0000000..e353f95d --- /dev/null +++ b/ppapi/c/ppb_fullscreen.h @@ -0,0 +1,62 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From ppb_fullscreen.idl modified Fri Oct 14 02:59:19 2011. */ + +#ifndef PPAPI_C_PPB_FULLSCREEN_H_ +#define PPAPI_C_PPB_FULLSCREEN_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_size.h" +#include "ppapi/c/pp_stdint.h" + +#define PPB_FULLSCREEN_INTERFACE_1_0 "PPB_Fullscreen;1.0" +#define PPB_FULLSCREEN_INTERFACE PPB_FULLSCREEN_INTERFACE_1_0 + +/** + * @file + * This file defines the <code>PPB_Fullscreen</code> interface. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Fullscreen { + /** + * Checks whether the plugin instance is currently in fullscreen mode. + */ + PP_Bool (*IsFullscreen)(PP_Instance instance); + /** + * Switches the plugin instance to/from fullscreen mode. Returns PP_TRUE on + * success, PP_FALSE on failure. + * + * This unbinds the current 2D or 3D devices. Pending flushes and swapbuffers + * will execute as if the resource was off-screen. The transition to and from + * fullscreen is asynchronous. During the transition, IsFullscreen will + * return the original value, and no 2D or 3D device can be bound. + * The transition ends at DidChangeView when IsFullscreen returns the new + * value. You might receive other DidChangeView calls while in + * transition. + * + * The transition to fullscreen can only occur while the browser is + * processing a user gesture, even if PP_TRUE is returned. + */ + PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen); + /** + * Gets the size of the screen in pixels. When going fullscreen, the instance + * will be resized to that size. + */ + PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size); +}; +/** + * @} + */ + +#endif /* PPAPI_C_PPB_FULLSCREEN_H_ */ + diff --git a/ppapi/cpp/fullscreen.cc b/ppapi/cpp/fullscreen.cc new file mode 100644 index 0000000..1c751cc6 --- /dev/null +++ b/ppapi/cpp/fullscreen.cc @@ -0,0 +1,50 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/cpp/fullscreen.h" + +#include "ppapi/c/ppb_fullscreen.h" +#include "ppapi/cpp/instance.h" +#include "ppapi/cpp/module.h" +#include "ppapi/cpp/module_impl.h" +#include "ppapi/cpp/size.h" + +namespace pp { + +namespace { + +template <> const char* interface_name<PPB_Fullscreen>() { + return PPB_FULLSCREEN_INTERFACE; +} + +} // namespace + +Fullscreen::Fullscreen(Instance* instance) + : instance_(instance) { +} + +Fullscreen::~Fullscreen() { +} + +bool Fullscreen::IsFullscreen() { + return has_interface<PPB_Fullscreen>() && + get_interface<PPB_Fullscreen>()->IsFullscreen( + instance_->pp_instance()); +} + +bool Fullscreen::SetFullscreen(bool fullscreen) { + if (!has_interface<PPB_Fullscreen>()) + return false; + return PP_ToBool(get_interface<PPB_Fullscreen>()->SetFullscreen( + instance_->pp_instance(), PP_FromBool(fullscreen))); +} + +bool Fullscreen::GetScreenSize(Size* size) { + if (!has_interface<PPB_Fullscreen>()) + return false; + return PP_ToBool(get_interface<PPB_Fullscreen>()->GetScreenSize( + instance_->pp_instance(), &size->pp_size())); +} + +} // namespace pp diff --git a/ppapi/cpp/fullscreen.h b/ppapi/cpp/fullscreen.h new file mode 100644 index 0000000..cb6a4f3 --- /dev/null +++ b/ppapi/cpp/fullscreen.h @@ -0,0 +1,29 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_CPP_FULLSCREEN_H_ +#define PPAPI_CPP_FULLSCREEN_H_ + +namespace pp { + +class Instance; +class Size; + +class Fullscreen { + public: + Fullscreen(Instance* instance); + virtual ~Fullscreen(); + + // PPB_Fullscreen methods. + bool IsFullscreen(); + bool SetFullscreen(bool fullscreen); + bool GetScreenSize(Size* size); + + private: + Instance* instance_; +}; + +} // namespace pp + +#endif // PPAPI_CPP_FULLSCREEN_H_ diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc index 3870142..ab94ccf 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc @@ -387,10 +387,10 @@ const PPB_Font_Dev* PPBFontInterface() { return ppb; } -const PPB_Fullscreen_Dev* PPBFullscreenInterface() { - static const PPB_Fullscreen_Dev* ppb = - static_cast<const PPB_Fullscreen_Dev*>( - GetBrowserInterfaceSafe(PPB_FULLSCREEN_DEV_INTERFACE)); +const PPB_Fullscreen* PPBFullscreenInterface() { + static const PPB_Fullscreen* ppb = + static_cast<const PPB_Fullscreen*>( + GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE)); return ppb; } diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h index b61ce110..6ce901b 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h @@ -8,7 +8,6 @@ #include "ppapi/c/dev/ppb_cursor_control_dev.h" #include "ppapi/c/dev/ppb_find_dev.h" #include "ppapi/c/dev/ppb_font_dev.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" #include "ppapi/c/dev/ppb_mouse_lock_dev.h" #include "ppapi/c/dev/ppb_scrollbar_dev.h" @@ -23,6 +22,7 @@ #include "ppapi/c/ppb_file_io.h" #include "ppapi/c/ppb_file_ref.h" #include "ppapi/c/ppb_file_system.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_graphics_3d.h" #include "ppapi/c/ppb_image_data.h" @@ -105,7 +105,7 @@ const PPB_FileRef* PPBFileRefInterface(); const PPB_FileSystem* PPBFileSystemInterface(); const PPB_Find_Dev* PPBFindInterface(); const PPB_Font_Dev* PPBFontInterface(); -const PPB_Fullscreen_Dev* PPBFullscreenInterface(); +const PPB_Fullscreen* PPBFullscreenInterface(); const PPB_Graphics2D* PPBGraphics2DInterface(); const PPB_Graphics3D* PPBGraphics3DInterface(); const PPB_Graphics3DTrusted* PPBGraphics3DTrustedInterface(); diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc index 3e54708..6a97097 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// SRPC-abstraction wrappers around PPB_Fullscreen_Dev functions. +// SRPC-abstraction wrappers around PPB_Fullscreen functions. #include "native_client/src/shared/ppapi_proxy/browser_globals.h" #include "native_client/src/shared/ppapi_proxy/utility.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/pp_size.h" +#include "ppapi/c/ppb_fullscreen.h" #include "srpcgen/ppb_rpc.h" using ppapi_proxy::DebugPrintf; diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc index faff8e5..fa24d45 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc @@ -60,7 +60,7 @@ InterfaceMapElement interface_map[] = { { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, - { PPB_FULLSCREEN_DEV_INTERFACE, PluginFullscreen::GetInterface(), true }, + { PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true }, { PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true }, { PPB_GRAPHICS_3D_INTERFACE, PluginGraphics3D::GetInterface(), true }, { PPB_IMAGEDATA_INTERFACE, PluginImageData::GetInterface(), true }, diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc index 3890bbb..478817f 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc @@ -5,8 +5,8 @@ #include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h" #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" #include "native_client/src/shared/ppapi_proxy/utility.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/pp_size.h" +#include "ppapi/c/ppb_fullscreen.h" #include "srpcgen/ppb_rpc.h" namespace ppapi_proxy { @@ -76,8 +76,8 @@ PP_Bool GetScreenSize(PP_Instance instance, struct PP_Size* size) { } // namespace -const PPB_Fullscreen_Dev* PluginFullscreen::GetInterface() { - static const PPB_Fullscreen_Dev fullscreen_interface = { +const PPB_Fullscreen* PluginFullscreen::GetInterface() { + static const PPB_Fullscreen fullscreen_interface = { IsFullscreen, SetFullscreen, GetScreenSize diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h index 02b5503..a3e62ab 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h +++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h @@ -6,14 +6,14 @@ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_PPB_FULLSCREEN_H_ #include "native_client/src/include/nacl_macros.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" +#include "ppapi/c/ppb_fullscreen.h" namespace ppapi_proxy { -// Implements the untrusted side of the PPB_Fullscreen_Dev interface. +// Implements the untrusted side of the PPB_Fullscreen interface. class PluginFullscreen { public: - static const PPB_Fullscreen_Dev* GetInterface(); + static const PPB_Fullscreen* GetInterface(); private: NACL_DISALLOW_COPY_AND_ASSIGN(PluginFullscreen); diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc index 6dd7186..beb0e62 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc +++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc @@ -2,8 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# RPC methods used to implement PPB_Fullscreen_Dev interface. -# See ppapi/c/dev/ppb_fullscreen_dev.h for interface details. +# RPC methods used to implement PPB_Fullscreen interface. +# See ppapi/c/dev/ppb_fullscreen.h for interface details. { 'name': 'PpbFullscreenRpc', 'rpcs': [ diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc index 333605e..432a444 100644 --- a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc +++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Tests PPB_Fullscreen_Dev. +// Tests PPB_Fullscreen. #include <string.h> @@ -11,8 +11,8 @@ #include "native_client/tests/ppapi_test_lib/test_interface.h" #include "native_client/tests/ppapi_test_lib/testable_callback.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/ppb_core.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_input_event.h" #include "ppapi/c/ppb_instance.h" @@ -66,24 +66,17 @@ bool CreateGraphics2D(PP_Resource* graphics2d) { // Test cases //////////////////////////////////////////////////////////////////////////////// -// Test for the availability of PPB_FULLSCREEN_DEV_INTERFACE. -void TestGetInterface() { - printf("--- TestGetInterface\n"); - EXPECT(PPBFullscreenDev() != NULL); - TEST_PASSED; -} - // Test // PP_Bool (*IsFullscreen)(PP_Instance instance); void TestIsFullscreenTrue() { printf("--- TestIsFullscreenTrue\n"); - EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_TRUE); + EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_TRUE); TEST_PASSED; } void TestIsFullscreenFalse() { printf("--- TestIsFullscreenFalse\n"); - EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE); + EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE); TEST_PASSED; } @@ -94,7 +87,7 @@ bool g_normal_pending = false; void TestSetFullscreenTrue() { printf("--- TestSetFullscreenTrue\n"); - const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev(); + const PPB_Fullscreen* ppb = PPBFullscreen(); if (ppb->IsFullscreen(pp_instance()) == PP_FALSE) { // Transition to fullscreen. // This can only be done when processing a user gesture - @@ -113,7 +106,7 @@ void TestSetFullscreenTrue() { void TestSetFullscreenFalse() { printf("--- TestSetFullscreenFalse\n"); - const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev(); + const PPB_Fullscreen* ppb = PPBFullscreen(); if (ppb->IsFullscreen(pp_instance()) == PP_TRUE) { // Transition out of fullscreen. EXPECT(CreateGraphics2D(&g_graphics2d)); @@ -142,7 +135,7 @@ void TestSetFullscreenFalse() { void TestGetScreenSizeHelper(PP_Size min_size, PP_Size max_size) { PP_Size size = PP_MakeSize(0, 0); - EXPECT(PPBFullscreenDev()->GetScreenSize(pp_instance(), &size) == PP_TRUE); + EXPECT(PPBFullscreen()->GetScreenSize(pp_instance(), &size) == PP_TRUE); EXPECT(IsSizeInRange(size, min_size, max_size)); } @@ -179,15 +172,15 @@ PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource event) { // We got the user gesture we needed, no need to handle events anymore. PPBInputEvent()->ClearInputEventRequest(pp_instance(), PP_INPUTEVENT_CLASS_MOUSE); - EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE); + EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE); EXPECT(CreateGraphics2D(&g_graphics2d)); - EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE); + EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE); g_fullscreen_pending = true; // Transition is pending, so additional requests fail. - EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_TRUE) == PP_FALSE); - EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_FALSE) == + EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_TRUE) == PP_FALSE); + EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_FALSE) == PP_FALSE); - EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE); + EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE); // No 2D or 3D device can be bound during transition. EXPECT(PPBGraphics2D()->IsGraphics2D(g_graphics2d) == PP_TRUE); EXPECT(PPBInstance()->BindGraphics(pp_instance(), g_graphics2d) == @@ -206,7 +199,7 @@ const PPP_InputEvent ppp_input_event_interface = { PP_Size GetScreenSize() { PP_Size screen_size = PP_MakeSize(0, 0); - CHECK(PPBFullscreenDev()->GetScreenSize(pp_instance(), &screen_size)); + CHECK(PPBFullscreen()->GetScreenSize(pp_instance(), &screen_size)); return screen_size; } @@ -245,14 +238,14 @@ void DidChangeView(PP_Instance instance, const char* test = NULL; PP_Size screen_size = GetScreenSize(); - if (g_fullscreen_pending && PPBFullscreenDev()->IsFullscreen(pp_instance())) { + if (g_fullscreen_pending && PPBFullscreen()->IsFullscreen(pp_instance())) { test = "TestSetFullscreenTrue"; g_fullscreen_pending = false; EXPECT(IsSizeEqual(position->size, screen_size)); // NOTE: we cannot reliably test for clip size being equal to the screen // because it might be affected by JS console, info bars, etc. } else if (g_normal_pending && - !PPBFullscreenDev()->IsFullscreen(pp_instance())) { + !PPBFullscreen()->IsFullscreen(pp_instance())) { test = "TestSetFullscreenFalse"; g_normal_pending = false; EXPECT(IsRectEqual(*position, g_normal_position)); @@ -277,7 +270,6 @@ const PPP_Instance ppp_instance_interface = { } // namespace void SetupTests() { - RegisterTest("TestGetInterface", TestGetInterface); RegisterTest("TestIsFullscreenTrue", TestIsFullscreenTrue); RegisterTest("TestIsFullscreenFalse", TestIsFullscreenFalse); RegisterTest("TestSetFullscreenTrue", TestSetFullscreenTrue); diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html index a4b56b7..2ddbfd3 100644 --- a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html +++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html @@ -35,7 +35,6 @@ }); } - addTest("TestGetInterface"); if (screen.width == 2560 && screen.height == 1600) // 30-inch. addTest("TestGetScreenSize2560x1600"); else if (screen.width == 1920 && screen.height == 1200) // 24-inch. diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc index bfbd773..c7fda1a 100644 --- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc +++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc @@ -7,7 +7,6 @@ #include "ppapi/c/dev/ppb_context_3d_dev.h" #include "ppapi/c/dev/ppb_cursor_control_dev.h" #include "ppapi/c/dev/ppb_font_dev.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" #include "ppapi/c/dev/ppb_scrollbar_dev.h" #include "ppapi/c/dev/ppb_surface_3d_dev.h" @@ -18,6 +17,7 @@ #include "ppapi/c/ppb_file_io.h" #include "ppapi/c/ppb_file_ref.h" #include "ppapi/c/ppb_file_system.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_graphics_3d.h" #include "ppapi/c/ppb_image_data.h" @@ -65,6 +65,11 @@ const PPB_FileSystem* PPBFileSystem() { GetBrowserInterface(PPB_FILESYSTEM_INTERFACE)); } +const PPB_Fullscreen* PPBFullscreen() { + return reinterpret_cast<const PPB_Fullscreen*>( + GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE)); +} + const PPB_Graphics2D* PPBGraphics2D() { return reinterpret_cast<const PPB_Graphics2D*>( GetBrowserInterfaceSafe(PPB_GRAPHICS_2D_INTERFACE)); @@ -153,11 +158,6 @@ const PPB_Font_Dev* PPBFontDev() { GetBrowserInterface(PPB_FONT_DEV_INTERFACE)); } -const PPB_Fullscreen_Dev* PPBFullscreenDev() { - return reinterpret_cast<const PPB_Fullscreen_Dev*>( - GetBrowserInterface(PPB_FULLSCREEN_DEV_INTERFACE)); -} - const PPB_Memory_Dev* PPBMemoryDev() { return reinterpret_cast<const PPB_Memory_Dev*>( GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE)); diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h index 826ad1b..9071b2a 100644 --- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h +++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h @@ -20,7 +20,7 @@ struct PPB_FileIO; struct PPB_FileRef; struct PPB_FileSystem; struct PPB_Font_Dev; -struct PPB_Fullscreen_Dev; +struct PPB_Fullscreen; struct PPB_Graphics2D; struct PPB_Graphics3D; struct PPB_ImageData; @@ -54,6 +54,7 @@ const PPB_Core* PPBCore(); const PPB_FileIO* PPBFileIO(); const PPB_FileRef* PPBFileRef(); const PPB_FileSystem* PPBFileSystem(); +const PPB_Fullscreen* PPBFullscreen(); const PPB_Graphics2D* PPBGraphics2D(); const PPB_Graphics3D* PPBGraphics3D(); const PPB_ImageData* PPBImageData(); @@ -77,7 +78,6 @@ const PPB_WheelInputEvent* PPBWheelInputEvent(); const PPB_Context3D_Dev* PPBContext3DDev(); const PPB_CursorControl_Dev* PPBCursorControlDev(); const PPB_Font_Dev* PPBFontDev(); -const PPB_Fullscreen_Dev* PPBFullscreenDev(); const PPB_Memory_Dev* PPBMemoryDev(); const PPB_Scrollbar_Dev* PPBScrollbarDev(); const PPB_Surface3D_Dev* PPBSurface3DDev(); diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi index 55d15a8..9f5124d 100644 --- a/ppapi/ppapi_cpp.gypi +++ b/ppapi/ppapi_cpp.gypi @@ -36,6 +36,7 @@ 'c/ppb_file_io.h', 'c/ppb_file_ref.h', 'c/ppb_file_system.h', + 'c/ppb_fullscreen.h', 'c/ppb_graphics_2d.h', 'c/ppb_graphics_3d.h', 'c/ppb_image_data.h', @@ -155,6 +156,8 @@ 'cpp/file_ref.h', 'cpp/file_system.cc', 'cpp/file_system.h', + 'cpp/fullscreen.cc', + 'cpp/fullscreen.h', 'cpp/graphics_2d.cc', 'cpp/graphics_2d.h', 'cpp/graphics_3d.cc', diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index 1713ebd..fc2c266 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -29,6 +29,7 @@ #include "ppapi/c/ppb_core.h" #include "ppapi/c/ppb_file_ref.h" #include "ppapi/c/ppb_file_system.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_image_data.h" #include "ppapi/c/ppb_input_event.h" diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h index ad920fd..028cf72 100644 --- a/ppapi/proxy/plugin_dispatcher.h +++ b/ppapi/proxy/plugin_dispatcher.h @@ -35,7 +35,7 @@ namespace proxy { struct InstanceData { InstanceData(); PP_Rect position; - PP_Bool fullscreen; // Used for PPB_Fullscreen_Dev. + PP_Bool fullscreen; // Used for PPB_Fullscreen. PP_Bool flash_fullscreen; // Used for PPB_FlashFullscreen. }; diff --git a/ppapi/proxy/ppp_instance_proxy_unittest.cc b/ppapi/proxy/ppp_instance_proxy_unittest.cc index 96ac24c..c97ef21 100644 --- a/ppapi/proxy/ppp_instance_proxy_unittest.cc +++ b/ppapi/proxy/ppp_instance_proxy_unittest.cc @@ -4,9 +4,9 @@ #include "base/synchronization/waitable_event.h" #include "ipc/ipc_message_utils.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/pp_var.h" #include "ppapi/c/ppb_core.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/c/ppb_url_loader.h" #include "ppapi/c/ppp_instance.h" #include "ppapi/c/private/ppb_flash_fullscreen.h" @@ -95,7 +95,7 @@ PPP_Instance_1_0 ppp_instance_1_0 = { PP_Bool IsFullscreen(PP_Instance instance) { return PP_FALSE; } -PPB_Fullscreen_Dev ppb_fullscreen = { &IsFullscreen }; +PPB_Fullscreen ppb_fullscreen = { &IsFullscreen }; PPB_FlashFullscreen ppb_flash_fullscreen = { &IsFullscreen }; } // namespace @@ -111,7 +111,7 @@ TEST_F(PPP_Instance_ProxyTest, PPPInstance1_0) { plugin().RegisterTestInterface(PPP_INSTANCE_INTERFACE_1_0, &ppp_instance_1_0); host().RegisterTestInterface(PPB_FLASHFULLSCREEN_INTERFACE, &ppb_flash_fullscreen); - host().RegisterTestInterface(PPB_FULLSCREEN_DEV_INTERFACE, + host().RegisterTestInterface(PPB_FULLSCREEN_INTERFACE, &ppb_fullscreen); // Grab the host-side proxy for the 1.0 interface. diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h index 9bfe3e4..516d0d9 100644 --- a/ppapi/tests/all_c_includes.h +++ b/ppapi/tests/all_c_includes.h @@ -74,6 +74,7 @@ #include "ppapi/c/ppb_file_io.h" #include "ppapi/c/ppb_file_ref.h" #include "ppapi/c/ppb_file_system.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_graphics_3d.h" #include "ppapi/c/ppb_image_data.h" diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h index c42a820..5308926 100644 --- a/ppapi/tests/all_cpp_includes.h +++ b/ppapi/tests/all_cpp_includes.h @@ -38,6 +38,7 @@ #include "ppapi/cpp/file_io.h" #include "ppapi/cpp/file_ref.h" #include "ppapi/cpp/file_system.h" +#include "ppapi/cpp/fullscreen.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/graphics_3d.h" #include "ppapi/cpp/graphics_3d_client.h" diff --git a/ppapi/tests/test_fullscreen.cc b/ppapi/tests/test_fullscreen.cc index ae85e4f..db535d5 100644 --- a/ppapi/tests/test_fullscreen.cc +++ b/ppapi/tests/test_fullscreen.cc @@ -9,7 +9,7 @@ #include <string> #include "ppapi/c/dev/ppb_testing_dev.h" -#include "ppapi/c/dev/ppb_fullscreen_dev.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/cpp/input_event.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" diff --git a/ppapi/tests/test_fullscreen.h b/ppapi/tests/test_fullscreen.h index 9b68655..6f2f127 100644 --- a/ppapi/tests/test_fullscreen.h +++ b/ppapi/tests/test_fullscreen.h @@ -7,7 +7,7 @@ #include <string> -#include "ppapi/cpp/dev/fullscreen_dev.h" +#include "ppapi/cpp/fullscreen.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/rect.h" #include "ppapi/cpp/size.h" @@ -39,7 +39,7 @@ class TestFullscreen : public TestCase { std::string error_; - pp::Fullscreen_Dev screen_mode_; + pp::Fullscreen screen_mode_; pp::Size screen_size_; pp::Rect normal_position_; diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index dde3182..81e4fb9 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -41,7 +41,6 @@ PROXIED_IFACE(PPB_FileChooser, PPB_FILECHOOSER_DEV_INTERFACE_0_5, PROXIED_IFACE(PPB_Font, PPB_FONT_DEV_INTERFACE_0_6, PPB_Font_Dev) PROXIED_IFACE(PPB_Instance, PPB_CHAR_SET_DEV_INTERFACE_0_4, PPB_CharSet_Dev) PROXIED_IFACE(PPB_Instance, PPB_CONSOLE_DEV_INTERFACE, PPB_Console_Dev) -PROXIED_IFACE(PPB_Instance, PPB_FULLSCREEN_DEV_INTERFACE, PPB_Fullscreen_Dev) PROXIED_IFACE(PPB_Instance, PPB_MOUSELOCK_DEV_INTERFACE_0_1, PPB_MouseLock_Dev) UNPROXIED_IFACE(PPB_Instance, PPB_QUERYPOLICY_DEV_INTERFACE_0_1, diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h index 579ce15..815a2b1 100644 --- a/ppapi/thunk/interfaces_ppb_public_stable.h +++ b/ppapi/thunk/interfaces_ppb_public_stable.h @@ -68,6 +68,7 @@ PROXIED_IFACE(NoAPIName, PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1, PPB_MouseInputEvent) PROXIED_IFACE(NoAPIName, PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0, PPB_WheelInputEvent) +PROXIED_IFACE(PPB_Instance, PPB_FULLSCREEN_INTERFACE_1_0, PPB_Fullscreen) PROXIED_IFACE(PPB_Instance, PPB_MESSAGING_INTERFACE_1_0, PPB_Messaging) PROXIED_IFACE(PPB_URLLoader, PPB_URLLOADER_INTERFACE_1_0, PPB_URLLoader) PROXIED_IFACE(NoAPIName, PPB_URLREQUESTINFO_INTERFACE_1_0, PPB_URLRequestInfo) diff --git a/ppapi/thunk/ppb_fullscreen_thunk.cc b/ppapi/thunk/ppb_fullscreen_thunk.cc index 72081f5..4c5626e 100644 --- a/ppapi/thunk/ppb_fullscreen_thunk.cc +++ b/ppapi/thunk/ppb_fullscreen_thunk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ppapi/c/dev/ppb_fullscreen_dev.h" +#include "ppapi/c/ppb_fullscreen.h" #include "ppapi/thunk/thunk.h" #include "ppapi/thunk/enter.h" #include "ppapi/thunk/ppb_instance_api.h" @@ -34,7 +34,7 @@ PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) { return enter.functions()->GetScreenSize(instance, size); } -const PPB_Fullscreen_Dev g_ppb_fullscreen_thunk = { +const PPB_Fullscreen g_ppb_fullscreen_thunk = { &IsFullscreen, &SetFullscreen, &GetScreenSize @@ -42,7 +42,7 @@ const PPB_Fullscreen_Dev g_ppb_fullscreen_thunk = { } // namespace -const PPB_Fullscreen_Dev* GetPPB_Fullscreen_Dev_Thunk() { +const PPB_Fullscreen* GetPPB_Fullscreen_Thunk() { return &g_ppb_fullscreen_thunk; } |