| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cpp/dev/fullscreen_dev.h" | 5 #include "ppapi/cpp/dev/fullscreen_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
| 8 #include "ppapi/cpp/common.h" |
| 8 #include "ppapi/cpp/instance.h" | 9 #include "ppapi/cpp/instance.h" |
| 9 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
| 10 #include "ppapi/cpp/module_impl.h" | 11 #include "ppapi/cpp/module_impl.h" |
| 11 | 12 |
| 12 namespace pp { | 13 namespace pp { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 DeviceFuncs<PPB_Fullscreen_Dev> ppb_fullscreen_f(PPB_FULLSCREEN_DEV_INTERFACE); | 17 DeviceFuncs<PPB_Fullscreen_Dev> ppb_fullscreen_f(PPB_FULLSCREEN_DEV_INTERFACE); |
| 17 | 18 |
| 18 } // anonymous namespace | 19 } // anonymous namespace |
| 19 | 20 |
| 20 Fullscreen_Dev::Fullscreen_Dev(Instance* instance) | 21 Fullscreen_Dev::Fullscreen_Dev(Instance* instance) |
| 21 : associated_instance_(instance) { | 22 : associated_instance_(instance) { |
| 22 } | 23 } |
| 23 | 24 |
| 24 Fullscreen_Dev::~Fullscreen_Dev() { | 25 Fullscreen_Dev::~Fullscreen_Dev() { |
| 25 } | 26 } |
| 26 | 27 |
| 27 bool Fullscreen_Dev::IsFullscreen() { | 28 bool Fullscreen_Dev::IsFullscreen() { |
| 28 return ppb_fullscreen_f && ppb_fullscreen_f->IsFullscreen( | 29 return ppb_fullscreen_f && ppb_fullscreen_f->IsFullscreen( |
| 29 associated_instance_->pp_instance()); | 30 associated_instance_->pp_instance()); |
| 30 } | 31 } |
| 31 | 32 |
| 32 bool Fullscreen_Dev::SetFullscreen(bool fullscreen) { | 33 bool Fullscreen_Dev::SetFullscreen(bool fullscreen) { |
| 33 if (!ppb_fullscreen_f) | 34 if (!ppb_fullscreen_f) |
| 34 return false; | 35 return false; |
| 35 return ppb_fullscreen_f->SetFullscreen(associated_instance_->pp_instance(), | 36 return PPBoolToBool( |
| 36 fullscreen); | 37 ppb_fullscreen_f->SetFullscreen(associated_instance_->pp_instance(), |
| 38 BoolToPPBool(fullscreen))); |
| 37 } | 39 } |
| 38 | 40 |
| 39 } // namespace pp | 41 } // namespace pp |
| OLD | NEW |