Revert of QUIC - Deleted disable_loading_server_info_for_new_servers field trial...
[chromium-blink-merge.git] / ppapi / cpp / fullscreen.cc
blobc5ad4f034ab3a056c0a50371edd1d05d8a29fed8
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"
13 namespace pp {
15 namespace {
17 template <> const char* interface_name<PPB_Fullscreen_1_0>() {
18 return PPB_FULLSCREEN_INTERFACE_1_0;
21 } // namespace
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>())
38 return false;
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>())
45 return false;
46 return PP_ToBool(get_interface<PPB_Fullscreen_1_0>()->GetScreenSize(
47 instance_.pp_instance(), &size->pp_size()));
50 } // namespace pp