Index: ppapi/proxy/camera_capabilities_resource.h |
diff --git a/ppapi/proxy/camera_capabilities_resource.h b/ppapi/proxy/camera_capabilities_resource.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..751fb51811166378b4ebb59f35ab10cb54566cc7 |
--- /dev/null |
+++ b/ppapi/proxy/camera_capabilities_resource.h |
@@ -0,0 +1,58 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef PPAPI_PROXY_CAMERA_CAPABILITIES_RESOURCE_H_ |
+#define PPAPI_PROXY_CAMERA_CAPABILITIES_RESOURCE_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "ppapi/proxy/ppapi_proxy_export.h" |
+#include "ppapi/shared_impl/resource.h" |
+#include "ppapi/thunk/ppb_camera_capabilities_api.h" |
+ |
+namespace ppapi { |
+namespace proxy { |
+ |
+class ImageCaptureResource; |
+ |
+class PPAPI_PROXY_EXPORT CameraCapabilitiesResource |
+ : public Resource, |
+ public thunk::PPB_CameraCapabilities_API { |
+ public: |
+ CameraCapabilitiesResource(PP_Instance instance); |
+ |
+ virtual ~CameraCapabilitiesResource(); |
+ |
+ // Resource overrides: |
+ virtual thunk::PPB_CameraCapabilities_API* AsPPB_CameraCapabilities_API() |
+ override; |
+ |
+ // PPB_CameraCapabilities_API overrides |
+ virtual void GetSupportedPreviewSizes(int32_t* array_size, |
+ PP_Size** preview_sizes) override; |
+ virtual void GetSupportedJpegSizes(int32_t* array_size, |
+ PP_Size** jpeg_sizes) override; |
+ |
+ private: |
+ friend ImageCaptureResource; |
+ |
+ // Methods that must be called at most once at initialization to guarantee the |
+ // returned pointers in GetSupported*Sizes() are valid within the lifecycle of |
+ // this class. |
+ void SetPreviewSizes(const std::vector<PP_Size>& sizes); |
+ void SetJpegSizes(const std::vector<PP_Size>& sizes); |
+ |
+ int32_t num_preview_sizes_; |
+ scoped_ptr<PP_Size[]> preview_sizes_; |
+ |
+ int32_t num_jpeg_sizes_; |
+ scoped_ptr<PP_Size[]> jpeg_sizes_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CameraCapabilitiesResource); |
+}; |
+ |
+} // namespace proxy |
+} // namespace ppapi |
+ |
+#endif // PPAPI_PROXY_CAMERA_CAPABILITIES_RESOURCE_H_ |