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

Side by Side Diff: content/renderer/pepper/pepper_image_capture_host.h

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo: int32->int32_t Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/public/renderer/renderer_ppapi_host.h"
10 #include "content/renderer/pepper/ppb_buffer_impl.h"
11 #include "ppapi/c/pp_size.h"
12 #include "ppapi/host/host_message_context.h"
13 #include "ppapi/host/resource_host.h"
14
15 namespace content {
16 class PepperPlatformImageCapture;
17 class RendererPpapiHostImpl;
18
19 class PepperImageCaptureHost : public ppapi::host::ResourceHost {
20 public:
21 PepperImageCaptureHost(RendererPpapiHostImpl* host,
22 PP_Instance instance,
23 PP_Resource resource);
24
25 ~PepperImageCaptureHost() override;
26
27 bool Init();
28
29 int32_t OnResourceMessageReceived(
30 const IPC::Message& msg,
31 ppapi::host::HostMessageContext* context) override;
32
33 // These methods are called by PepperPlatformImageCapture only.
34
35 // Called when image capture is initialized.
36 void OnInitialized(bool succeeded);
37
38 // Called when the preview frame sizes are enumerated.
39 void OnPreviewSizesEnumerated(const std::vector<PP_Size>& sizes);
40
41 private:
42 // Plugin -> host message handlers.
43 int32_t OnOpen(ppapi::host::HostMessageContext* context,
44 const std::string& device_id);
45 int32_t OnClose(ppapi::host::HostMessageContext* context);
46 int32_t OnGetSupportedPreviewSizes(ppapi::host::HostMessageContext* context);
47
48 // Utility methods.
49 void DetachPlatformImageCapture();
50
51 scoped_ptr<PepperPlatformImageCapture> platform_image_capture_;
52
53 RendererPpapiHostImpl* renderer_ppapi_host_;
54
55 ppapi::host::ReplyMessageContext open_reply_context_;
56
57 ppapi::host::ReplyMessageContext preview_sizes_reply_context_;
58
59 DISALLOW_COPY_AND_ASSIGN(PepperImageCaptureHost);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/content_renderer_pepper_host_factory.cc ('k') | content/renderer/pepper/pepper_image_capture_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698