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

Side by Side Diff: ppapi/thunk/ppb_view_dev_thunk.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 unified diff | Download patch
« no previous file with comments | « ppapi/thunk/ppb_view_api.h ('k') | ppapi/thunk/ppb_view_thunk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // From dev/ppb_view_dev.idl modified Fri Feb 8 14:28:54 2013.
6
7 #include "ppapi/c/dev/ppb_view_dev.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_instance_api.h"
12 #include "ppapi/thunk/ppb_view_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
15
16 namespace ppapi {
17 namespace thunk {
18
19 namespace {
20
21 float GetDeviceScale(PP_Resource resource) {
22 EnterResource<PPB_View_API> enter(resource, true);
23 if (enter.failed())
24 return 0.0f;
25 return enter.object()->GetDeviceScale();
26 }
27
28 float GetCSSScale(PP_Resource resource) {
29 EnterResource<PPB_View_API> enter(resource, true);
30 if (enter.failed())
31 return 0.0f;
32 return enter.object()->GetCSSScale();
33 }
34
35 const PPB_View_Dev_0_1 g_ppb_view_dev_thunk_0_1 = {
36 &GetDeviceScale,
37 &GetCSSScale
38 };
39
40 } // namespace
41
42 const PPB_View_Dev_0_1* GetPPB_View_Dev_0_1_Thunk() {
43 return &g_ppb_view_dev_thunk_0_1;
44 }
45
46 } // namespace thunk
47 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_view_api.h ('k') | ppapi/thunk/ppb_view_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698