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

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..6fa328ae10520a65c16a100110afa3b94fee4b27 100644
--- a/ppapi/shared_impl/ppb_view_shared.cc
+++ b/ppapi/shared_impl/ppb_view_shared.cc
@@ -4,6 +4,12 @@
#include "ppapi/shared_impl/ppb_view_shared.h"
+namespace {
+bool IsRectVisible(const PP_Rect& rect) {
brettw 2013/02/12 18:48:02 Maybe IsRectNonempty would be a better name?
teravest 2013/02/12 19:01:41 Done.
+ return rect.size.width > 0 && rect.size.height > 0;
+}
+}
brettw 2013/02/12 18:48:02 Style nit: needs " // namespace" and I'd put spac
teravest 2013/02/12 19:01:41 Done.
+
namespace ppapi {
ViewData::ViewData() {
@@ -50,4 +56,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 && IsRectVisible(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