Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Unified Diff: ppapi/shared_impl/ppb_view_shared.cc

Issue 12220082: IDL: Autogenerate thunk .cc file for PPB_View (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/ppb_view_shared.h ('k') | ppapi/thunk/ppb_view_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_view_shared.cc
diff --git a/ppapi/shared_impl/ppb_view_shared.cc b/ppapi/shared_impl/ppb_view_shared.cc
index 9e1565581ba9c41dd5986b2cc007e064be5a4259..f11fe1f3d0b9d18de1b65b64e3951e4f1029fa16 100644
--- a/ppapi/shared_impl/ppb_view_shared.cc
+++ b/ppapi/shared_impl/ppb_view_shared.cc
@@ -4,6 +4,14 @@
#include "ppapi/shared_impl/ppb_view_shared.h"
+namespace {
+
+bool IsRectNonempty(const PP_Rect& rect) {
+ return rect.size.width > 0 && rect.size.height > 0;
+}
+
+} // namespace
+
namespace ppapi {
ViewData::ViewData() {
@@ -50,4 +58,38 @@ const ViewData& PPB_View_Shared::GetData() const {
return data_;
}
+PP_Bool PPB_View_Shared::GetRect(PP_Rect* viewport) const {
+ if (!viewport)
+ return PP_FALSE;
+ *viewport = data_.rect;
+ return PP_TRUE;
+}
+
+PP_Bool PPB_View_Shared::IsFullscreen() const {
+ return PP_FromBool(data_.is_fullscreen);
+}
+
+PP_Bool PPB_View_Shared::IsVisible() const {
+ return PP_FromBool(data_.is_page_visible && IsRectNonempty(data_.clip_rect));
+}
+
+PP_Bool PPB_View_Shared::IsPageVisible() const {
+ return PP_FromBool(data_.is_page_visible);
+}
+
+PP_Bool PPB_View_Shared::GetClipRect(PP_Rect* clip) const {
+ if (!clip)
+ return PP_FALSE;
+ *clip = data_.clip_rect;
+ return PP_TRUE;
+}
+
+float PPB_View_Shared::GetDeviceScale() const {
+ return data_.device_scale;
+}
+
+float PPB_View_Shared::GetCSSScale() const {
+ return data_.css_scale;
+}
+
} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/ppb_view_shared.h ('k') | ppapi/thunk/ppb_view_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698