Chromium Code Reviews| Index: content/renderer/pepper/pepper_image_capture_host.h |
| diff --git a/content/renderer/pepper/pepper_image_capture_host.h b/content/renderer/pepper/pepper_image_capture_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f89514f643b4f0bd436a944967f4daf93464343a |
| --- /dev/null |
| +++ b/content/renderer/pepper/pepper_image_capture_host.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
dmichael (off chromium)
2015/02/09 22:26:59
s/2014/2015
...and in other new files, too.
Justin Chuang
2015/02/10 16:01:02
Done. Only change new files.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_ |
| +#define CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/public/renderer/renderer_ppapi_host.h" |
| +#include "content/renderer/pepper/ppb_buffer_impl.h" |
| +#include "ppapi/c/pp_size.h" |
| +#include "ppapi/host/host_message_context.h" |
| +#include "ppapi/host/resource_host.h" |
| + |
| +namespace content { |
| +class PepperPlatformImageCapture; |
| +class RendererPpapiHostImpl; |
| + |
| +class PepperImageCaptureHost : public ppapi::host::ResourceHost { |
| + public: |
| + PepperImageCaptureHost(RendererPpapiHostImpl* host, |
| + PP_Instance instance, |
| + PP_Resource resource); |
| + |
| + ~PepperImageCaptureHost() override; |
| + |
| + bool Init(); |
| + |
| + int32_t OnResourceMessageReceived( |
| + const IPC::Message& msg, |
| + ppapi::host::HostMessageContext* context) override; |
| + |
| + // These methods are called by PepperPlatformImageCapture only. |
| + |
| + // Called when image capture is initialized. |
| + void OnInitialized(bool succeeded); |
| + |
| + // Called when the preview frame sizes are enumerated. |
| + void OnPreviewSizesEnumerated(const std::vector<PP_Size>& sizes); |
| + |
| + private: |
| + // Plugin -> host message handlers. |
| + |
|
dmichael (off chromium)
2015/02/09 22:26:59
nit: Please remove the extra carriage return
Justin Chuang
2015/02/10 16:01:02
Done.
|
| + int32_t OnOpen(ppapi::host::HostMessageContext* context, |
| + const std::string& device_id); |
| + int32_t OnClose(ppapi::host::HostMessageContext* context); |
| + int32_t OnGetSupportedPreviewSizes(ppapi::host::HostMessageContext* context); |
| + |
| + // Utility methods. |
| + |
|
dmichael (off chromium)
2015/02/09 22:26:59
ditto
Justin Chuang
2015/02/10 16:01:02
Done.
|
| + void DetachPlatformImageCapture(); |
| + |
| + scoped_ptr<PepperPlatformImageCapture> platform_image_capture_; |
| + |
| + RendererPpapiHostImpl* renderer_ppapi_host_; |
| + |
| + ppapi::host::ReplyMessageContext open_reply_context_; |
| + |
| + ppapi::host::ReplyMessageContext preview_sizes_reply_context_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PepperImageCaptureHost); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_ |