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/cpp/fullscreen.h"
7 #include "ppapi/c/ppb_fullscreen.h"
8 #include "ppapi/cpp/instance_handle.h"
9 #include "ppapi/cpp/module.h"
10 #include "ppapi/cpp/module_impl.h"
11 #include "ppapi/cpp/size.h"
17 template <> const char* interface_name
<PPB_Fullscreen_1_0
>() {
18 return PPB_FULLSCREEN_INTERFACE_1_0
;
23 Fullscreen::Fullscreen(const InstanceHandle
& instance
)
24 : instance_(instance
) {
27 Fullscreen::~Fullscreen() {
30 bool Fullscreen::IsFullscreen() {
31 return has_interface
<PPB_Fullscreen_1_0
>() &&
32 get_interface
<PPB_Fullscreen_1_0
>()->IsFullscreen(
33 instance_
.pp_instance());
36 bool Fullscreen::SetFullscreen(bool fullscreen
) {
37 if (!has_interface
<PPB_Fullscreen_1_0
>())
39 return PP_ToBool(get_interface
<PPB_Fullscreen_1_0
>()->SetFullscreen(
40 instance_
.pp_instance(), PP_FromBool(fullscreen
)));
43 bool Fullscreen::GetScreenSize(Size
* size
) {
44 if (!has_interface
<PPB_Fullscreen_1_0
>())
46 return PP_ToBool(get_interface
<PPB_Fullscreen_1_0
>()->GetScreenSize(
47 instance_
.pp_instance(), &size
->pp_size()));