summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 01:55:52 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 01:55:52 +0000
commitc32a97f251e5d951e86d25815d989d4db2d59bdb (patch)
tree2d4384c2163a46e4c68d9ec0e6ede5dadcb14b33 /ppapi/cpp
parent9ad566288f5f4972570cd52cf6258d2ab0fe5090 (diff)
downloadchromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.zip
chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.tar.gz
chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.tar.bz2
Clarify/fix fullscreen semantics, and add GetScreenSize
BUG=none TEST=youtube, nba, amazon Review URL: http://codereview.chromium.org/6625034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp')
-rw-r--r--ppapi/cpp/dev/fullscreen_dev.cc14
-rw-r--r--ppapi/cpp/dev/fullscreen_dev.h8
2 files changed, 14 insertions, 8 deletions
diff --git a/ppapi/cpp/dev/fullscreen_dev.cc b/ppapi/cpp/dev/fullscreen_dev.cc
index e68b296..11bb09a 100644
--- a/ppapi/cpp/dev/fullscreen_dev.cc
+++ b/ppapi/cpp/dev/fullscreen_dev.cc
@@ -9,6 +9,7 @@
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
+#include "ppapi/cpp/size.h"
namespace pp {
@@ -21,7 +22,7 @@ template <> const char* interface_name<PPB_Fullscreen_Dev>() {
} // namespace
Fullscreen_Dev::Fullscreen_Dev(Instance* instance)
- : associated_instance_(instance) {
+ : instance_(instance) {
}
Fullscreen_Dev::~Fullscreen_Dev() {
@@ -30,14 +31,21 @@ Fullscreen_Dev::~Fullscreen_Dev() {
bool Fullscreen_Dev::IsFullscreen() {
return has_interface<PPB_Fullscreen_Dev>() &&
get_interface<PPB_Fullscreen_Dev>()->IsFullscreen(
- associated_instance_->pp_instance());
+ instance_->pp_instance());
}
bool Fullscreen_Dev::SetFullscreen(bool fullscreen) {
if (!has_interface<PPB_Fullscreen_Dev>())
return false;
return PPBoolToBool(get_interface<PPB_Fullscreen_Dev>()->SetFullscreen(
- associated_instance_->pp_instance(), BoolToPPBool(fullscreen)));
+ instance_->pp_instance(), BoolToPPBool(fullscreen)));
+}
+
+bool Fullscreen_Dev::GetScreenSize(Size* size) {
+ if (!has_interface<PPB_Fullscreen_Dev>())
+ return false;
+ return PPBoolToBool(get_interface<PPB_Fullscreen_Dev>()->GetScreenSize(
+ instance_->pp_instance(), &size->pp_size()));
}
} // namespace pp
diff --git a/ppapi/cpp/dev/fullscreen_dev.h b/ppapi/cpp/dev/fullscreen_dev.h
index 1050faf..9a11031 100644
--- a/ppapi/cpp/dev/fullscreen_dev.h
+++ b/ppapi/cpp/dev/fullscreen_dev.h
@@ -5,13 +5,10 @@
#ifndef PPAPI_CPP_DEV_FULLSCREEN_DEV_H_
#define PPAPI_CPP_DEV_FULLSCREEN_DEV_H_
-#include <string>
-
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
-
namespace pp {
class Instance;
+class Size;
class Fullscreen_Dev {
public:
@@ -21,9 +18,10 @@ class Fullscreen_Dev {
// PPB_Fullscreen_Dev methods.
bool IsFullscreen();
bool SetFullscreen(bool fullscreen);
+ bool GetScreenSize(Size* size);
private:
- Instance* associated_instance_;
+ Instance* instance_;
};
} // namespace pp