Update user pod message to use Smart Lock.
[chromium-blink-merge.git] / ppapi / thunk / ppb_image_capture_config_private_thunk.cc
blob98f2900cca0e685f37e2d42b573be64d25a57045
1 // Copyright 2014 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.
5 // From private/ppb_image_capture_config_private.idl modified Wed Nov 5
6 // 14:29:15 2014.
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_image_capture_config_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_image_capture_config_api.h"
15 namespace ppapi {
16 namespace thunk {
18 namespace {
20 PP_Resource Create(PP_Instance instance) {
21 VLOG(4) << "PPB_ImageCaptureConfig_Private::Create()";
22 EnterResourceCreation enter(instance);
23 if (enter.failed())
24 return 0;
25 return enter.functions()->CreateImageCaptureConfigPrivate(instance);
28 PP_Bool IsImageCaptureConfig(PP_Resource resource) {
29 VLOG(4) << "PPB_ImageCaptureConfig_Private::IsImageCaptureConfig()";
30 EnterResource<PPB_ImageCaptureConfig_API> enter(resource, false);
31 return PP_FromBool(enter.succeeded());
34 void GetPreviewSize(PP_Resource config, struct PP_Size* preview_size) {
35 VLOG(4) << "PPB_ImageCaptureConfig_Private::GetPreviewSize()";
36 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
37 if (enter.failed())
38 return;
39 enter.object()->GetPreviewSize(preview_size);
42 void SetPreviewSize(PP_Resource config, const struct PP_Size* preview_size) {
43 VLOG(4) << "PPB_ImageCaptureConfig_Private::SetPreviewSize()";
44 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
45 if (enter.failed())
46 return;
47 enter.object()->SetPreviewSize(preview_size);
50 void GetJpegSize(PP_Resource config, struct PP_Size* jpeg_size) {
51 VLOG(4) << "PPB_ImageCaptureConfig_Private::GetJpegSize()";
52 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
53 if (enter.failed())
54 return;
55 enter.object()->GetJpegSize(jpeg_size);
58 void SetJpegSize(PP_Resource config, const struct PP_Size* jpeg_size) {
59 VLOG(4) << "PPB_ImageCaptureConfig_Private::SetJpegSize()";
60 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
61 if (enter.failed())
62 return;
63 enter.object()->SetJpegSize(jpeg_size);
66 const PPB_ImageCaptureConfig_Private_0_1
67 g_ppb_imagecaptureconfig_private_thunk_0_1 = {&Create,
68 &IsImageCaptureConfig,
69 &GetPreviewSize,
70 &SetPreviewSize,
71 &GetJpegSize,
72 &SetJpegSize};
74 } // namespace
76 PPAPI_THUNK_EXPORT const PPB_ImageCaptureConfig_Private_0_1*
77 GetPPB_ImageCaptureConfig_Private_0_1_Thunk() {
78 return &g_ppb_imagecaptureconfig_private_thunk_0_1;
81 } // namespace thunk
82 } // namespace ppapi