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

Side by Side Diff: ppapi/cpp/view.cc

Issue 10454095: Fix pp::View and pp::BrowserFontTrusted wrapper version checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/cpp/trusted/browser_font_trusted.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/view.h" 5 #include "ppapi/cpp/view.h"
6 6
7 #include "ppapi/c/ppb_view.h" 7 #include "ppapi/c/ppb_view.h"
8 #include "ppapi/cpp/module_impl.h" 8 #include "ppapi/cpp/module_impl.h"
9 9
10 namespace pp { 10 namespace pp {
11 11
12 namespace { 12 namespace {
13 13
14 template <> const char* interface_name<PPB_View>() { 14 template <> const char* interface_name<PPB_View_1_0>() {
15 return PPB_VIEW_INTERFACE; 15 return PPB_VIEW_INTERFACE_1_0;
16 } 16 }
17 17
18 } // namespace 18 } // namespace
19 19
20 View::View() : Resource() { 20 View::View() : Resource() {
21 } 21 }
22 22
23 View::View(PP_Resource view_resource) : Resource(view_resource) { 23 View::View(PP_Resource view_resource) : Resource(view_resource) {
24 } 24 }
25 25
26 Rect View::GetRect() const { 26 Rect View::GetRect() const {
27 if (!has_interface<PPB_View>()) 27 if (!has_interface<PPB_View_1_0>())
28 return Rect(); 28 return Rect();
29 PP_Rect out; 29 PP_Rect out;
30 if (PP_ToBool(get_interface<PPB_View>()->GetRect(pp_resource(), &out))) 30 if (PP_ToBool(get_interface<PPB_View_1_0>()->GetRect(pp_resource(), &out)))
31 return Rect(out); 31 return Rect(out);
32 return Rect(); 32 return Rect();
33 } 33 }
34 34
35 bool View::IsFullscreen() const { 35 bool View::IsFullscreen() const {
36 if (!has_interface<PPB_View>()) 36 if (!has_interface<PPB_View_1_0>())
37 return false; 37 return false;
38 return PP_ToBool(get_interface<PPB_View>()->IsFullscreen(pp_resource())); 38 return PP_ToBool(get_interface<PPB_View_1_0>()->IsFullscreen(pp_resource()));
39 } 39 }
40 40
41 bool View::IsVisible() const { 41 bool View::IsVisible() const {
42 if (!has_interface<PPB_View>()) 42 if (!has_interface<PPB_View_1_0>())
43 return false; 43 return false;
44 return PP_ToBool(get_interface<PPB_View>()->IsVisible(pp_resource())); 44 return PP_ToBool(get_interface<PPB_View_1_0>()->IsVisible(pp_resource()));
45 } 45 }
46 46
47 bool View::IsPageVisible() const { 47 bool View::IsPageVisible() const {
48 if (!has_interface<PPB_View>()) 48 if (!has_interface<PPB_View_1_0>())
49 return true; 49 return true;
50 return PP_ToBool(get_interface<PPB_View>()->IsPageVisible(pp_resource())); 50 return PP_ToBool(get_interface<PPB_View_1_0>()->IsPageVisible(pp_resource()));
51 } 51 }
52 52
53 Rect View::GetClipRect() const { 53 Rect View::GetClipRect() const {
54 if (!has_interface<PPB_View>()) 54 if (!has_interface<PPB_View_1_0>())
55 return Rect(); 55 return Rect();
56 PP_Rect out; 56 PP_Rect out;
57 if (PP_ToBool(get_interface<PPB_View>()->GetClipRect(pp_resource(), &out))) 57 if (PP_ToBool(get_interface<PPB_View_1_0>()->GetClipRect(pp_resource(),
58 &out)))
58 return Rect(out); 59 return Rect(out);
59 return Rect(); 60 return Rect();
60 } 61 }
61 62
62 } // namespace pp 63 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/trusted/browser_font_trusted.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698