OLD | NEW |
| (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 #ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TALK_HOST_H_ | |
6 #define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TALK_HOST_H_ | |
7 | |
8 #include "base/memory/weak_ptr.h" | |
9 #include "ppapi/c/private/ppb_talk_private.h" | |
10 #include "ppapi/host/resource_host.h" | |
11 #include "ppapi/proxy/resource_message_params.h" | |
12 | |
13 namespace content { | |
14 class BrowserPpapiHost; | |
15 } | |
16 | |
17 namespace ppapi { | |
18 namespace host { | |
19 struct ReplyMessageContext; | |
20 } | |
21 } | |
22 | |
23 namespace chrome { | |
24 | |
25 class PepperTalkHost : public ppapi::host::ResourceHost { | |
26 public: | |
27 PepperTalkHost(content::BrowserPpapiHost* host, | |
28 PP_Instance instance, | |
29 PP_Resource resource); | |
30 ~PepperTalkHost() override; | |
31 | |
32 private: | |
33 // ResourceHost override. | |
34 int32_t OnResourceMessageReceived( | |
35 const IPC::Message& msg, | |
36 ppapi::host::HostMessageContext* context) override; | |
37 | |
38 int32_t OnRequestPermission(ppapi::host::HostMessageContext* context, | |
39 PP_TalkPermission permission); | |
40 int32_t OnStartRemoting(ppapi::host::HostMessageContext* context); | |
41 int32_t OnStopRemoting(ppapi::host::HostMessageContext* context); | |
42 void OnRemotingStopEvent(); | |
43 | |
44 void OnRequestPermissionCompleted(ppapi::host::ReplyMessageContext reply); | |
45 void OnStartRemotingCompleted(ppapi::host::ReplyMessageContext reply); | |
46 void OnStopRemotingCompleted(ppapi::host::ReplyMessageContext reply); | |
47 | |
48 content::BrowserPpapiHost* browser_ppapi_host_; | |
49 bool remoting_started_; | |
50 base::WeakPtrFactory<PepperTalkHost> weak_factory_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(PepperTalkHost); | |
53 }; | |
54 | |
55 } // namespace chrome | |
56 | |
57 #endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TALK_HOST_H_ | |
OLD | NEW |