OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/renderer_host/pepper/pepper_talk_host.h" | 5 #include "chrome/browser/renderer_host/pepper/pepper_talk_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/public/browser/browser_ppapi_host.h" | 8 #include "content/public/browser/browser_ppapi_host.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (remoting_started_) { | 146 if (remoting_started_) { |
147 content::BrowserThread::PostTask(content::BrowserThread::UI, | 147 content::BrowserThread::PostTask(content::BrowserThread::UI, |
148 FROM_HERE, | 148 FROM_HERE, |
149 base::Bind(&StopRemotingOnUIThread)); | 149 base::Bind(&StopRemotingOnUIThread)); |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 int32_t PepperTalkHost::OnResourceMessageReceived( | 153 int32_t PepperTalkHost::OnResourceMessageReceived( |
154 const IPC::Message& msg, | 154 const IPC::Message& msg, |
155 ppapi::host::HostMessageContext* context) { | 155 ppapi::host::HostMessageContext* context) { |
156 IPC_BEGIN_MESSAGE_MAP(PepperTalkHost, msg) | 156 PPAPI_BEGIN_MESSAGE_MAP(PepperTalkHost, msg) |
157 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Talk_RequestPermission, | 157 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Talk_RequestPermission, |
158 OnRequestPermission) | 158 OnRequestPermission) |
159 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Talk_StartRemoting, | 159 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Talk_StartRemoting, |
160 OnStartRemoting) | 160 OnStartRemoting) |
161 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Talk_StopRemoting, | 161 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Talk_StopRemoting, |
162 OnStopRemoting) | 162 OnStopRemoting) |
163 IPC_END_MESSAGE_MAP() | 163 PPAPI_END_MESSAGE_MAP() |
164 return PP_ERROR_FAILED; | 164 return PP_ERROR_FAILED; |
165 } | 165 } |
166 | 166 |
167 int32_t PepperTalkHost::OnRequestPermission( | 167 int32_t PepperTalkHost::OnRequestPermission( |
168 ppapi::host::HostMessageContext* context, | 168 ppapi::host::HostMessageContext* context, |
169 PP_TalkPermission permission) { | 169 PP_TalkPermission permission) { |
170 if (permission < PP_TALKPERMISSION_SCREENCAST || | 170 if (permission < PP_TALKPERMISSION_SCREENCAST || |
171 permission >= PP_TALKPERMISSION_NUM_PERMISSIONS) | 171 permission >= PP_TALKPERMISSION_NUM_PERMISSIONS) |
172 return PP_ERROR_BADARGUMENT; | 172 return PP_ERROR_BADARGUMENT; |
173 | 173 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 248 } |
249 | 249 |
250 void PepperTalkHost::OnStopRemotingCompleted( | 250 void PepperTalkHost::OnStopRemotingCompleted( |
251 ppapi::host::ReplyMessageContext reply) { | 251 ppapi::host::ReplyMessageContext reply) { |
252 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 252 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
253 remoting_started_ = false; | 253 remoting_started_ = false; |
254 host()->SendReply(reply, PpapiPluginMsg_Talk_StopRemotingReply()); | 254 host()->SendReply(reply, PpapiPluginMsg_Talk_StopRemotingReply()); |
255 } | 255 } |
256 | 256 |
257 } // namespace chrome | 257 } // namespace chrome |
OLD | NEW |