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 "ppapi/proxy/ppb_flash_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "ppapi/c/dev/ppb_font_dev.h" | 10 #include "ppapi/c/dev/ppb_font_dev.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 // TODO(viettrungluu): Implement me. | 216 // TODO(viettrungluu): Implement me. |
217 | 217 |
218 return PP_ERROR_NOTSUPPORTED; | 218 return PP_ERROR_NOTSUPPORTED; |
219 } | 219 } |
220 | 220 |
221 void UpdateActivity(PP_Instance instance) { | 221 void UpdateActivity(PP_Instance instance) { |
222 // TODO(viettrungluu): Implement me. | 222 // TODO(viettrungluu): Implement me. |
223 } | 223 } |
224 | 224 |
| 225 PP_Var GetDeviceID(PP_Instance instance) { |
| 226 // TODO(brettw) implement me. |
| 227 return PP_MakeUndefined(); |
| 228 } |
| 229 |
225 const PPB_Flash_11 flash_interface_11 = { | 230 const PPB_Flash_11 flash_interface_11 = { |
226 &SetInstanceAlwaysOnTop, | 231 &SetInstanceAlwaysOnTop, |
227 &DrawGlyphs11, | 232 &DrawGlyphs11, |
228 &GetProxyForURL, | 233 &GetProxyForURL, |
229 &Navigate11, | 234 &Navigate11, |
230 &RunMessageLoop, | 235 &RunMessageLoop, |
231 &QuitMessageLoop, | 236 &QuitMessageLoop, |
232 &GetLocalTimeZoneOffset, | 237 &GetLocalTimeZoneOffset, |
233 &GetCommandLineArgs | 238 &GetCommandLineArgs |
234 }; | 239 }; |
(...skipping 18 matching lines...) Expand all Loading... |
253 &RunMessageLoop, | 258 &RunMessageLoop, |
254 &QuitMessageLoop, | 259 &QuitMessageLoop, |
255 &GetLocalTimeZoneOffset, | 260 &GetLocalTimeZoneOffset, |
256 &GetCommandLineArgs, | 261 &GetCommandLineArgs, |
257 &PreLoadFontWin, | 262 &PreLoadFontWin, |
258 &IsRectTopmost, | 263 &IsRectTopmost, |
259 &InvokePrinting, | 264 &InvokePrinting, |
260 &UpdateActivity | 265 &UpdateActivity |
261 }; | 266 }; |
262 | 267 |
| 268 const PPB_Flash_12_2 flash_interface_12_2 = { |
| 269 &SetInstanceAlwaysOnTop, |
| 270 &DrawGlyphs, |
| 271 &GetProxyForURL, |
| 272 &Navigate, |
| 273 &RunMessageLoop, |
| 274 &QuitMessageLoop, |
| 275 &GetLocalTimeZoneOffset, |
| 276 &GetCommandLineArgs, |
| 277 &PreLoadFontWin, |
| 278 &IsRectTopmost, |
| 279 &InvokePrinting, |
| 280 &UpdateActivity, |
| 281 &GetDeviceID |
| 282 }; |
| 283 |
263 } // namespace | 284 } // namespace |
264 | 285 |
265 PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher) | 286 PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher) |
266 : InterfaceProxy(dispatcher), | 287 : InterfaceProxy(dispatcher), |
267 ppb_flash_impl_(NULL) { | 288 ppb_flash_impl_(NULL) { |
268 if (!dispatcher->IsPlugin()) | 289 if (!dispatcher->IsPlugin()) |
269 ppb_flash_impl_ = static_cast<const PPB_Flash*>( | 290 ppb_flash_impl_ = static_cast<const PPB_Flash*>( |
270 dispatcher->local_get_interface()(PPB_FLASH_INTERFACE)); | 291 dispatcher->local_get_interface()(PPB_FLASH_INTERFACE)); |
271 } | 292 } |
272 | 293 |
273 PPB_Flash_Proxy::~PPB_Flash_Proxy() { | 294 PPB_Flash_Proxy::~PPB_Flash_Proxy() { |
274 } | 295 } |
275 | 296 |
276 // static | 297 // static |
277 const PPB_Flash_11* PPB_Flash_Proxy::GetInterface11() { | 298 const PPB_Flash_11* PPB_Flash_Proxy::GetInterface11() { |
278 return &flash_interface_11; | 299 return &flash_interface_11; |
279 } | 300 } |
280 | 301 |
281 // static | 302 // static |
282 const PPB_Flash_12_0* PPB_Flash_Proxy::GetInterface12_0() { | 303 const PPB_Flash_12_0* PPB_Flash_Proxy::GetInterface12_0() { |
283 return &flash_interface_12_0; | 304 return &flash_interface_12_0; |
284 } | 305 } |
285 | 306 |
286 // static | 307 // static |
287 const PPB_Flash_12_1* PPB_Flash_Proxy::GetInterface12_1() { | 308 const PPB_Flash_12_1* PPB_Flash_Proxy::GetInterface12_1() { |
288 return &flash_interface_12_1; | 309 return &flash_interface_12_1; |
289 } | 310 } |
290 | 311 |
| 312 // static |
| 313 const PPB_Flash_12_2* PPB_Flash_Proxy::GetInterface12_2() { |
| 314 return &flash_interface_12_2; |
| 315 } |
| 316 |
291 bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { | 317 bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { |
292 // Prevent the dispatcher from going away during a call to Navigate. | 318 // Prevent the dispatcher from going away during a call to Navigate. |
293 // This must happen OUTSIDE of OnMsgNavigate since the handling code use | 319 // This must happen OUTSIDE of OnMsgNavigate since the handling code use |
294 // the dispatcher upon return of the function (sending the reply message). | 320 // the dispatcher upon return of the function (sending the reply message). |
295 ScopedModuleReference death_grip(dispatcher()); | 321 ScopedModuleReference death_grip(dispatcher()); |
296 | 322 |
297 bool handled = true; | 323 bool handled = true; |
298 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) | 324 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) |
299 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, | 325 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, |
300 OnMsgSetInstanceAlwaysOnTop) | 326 OnMsgSetInstanceAlwaysOnTop) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 } | 431 } |
406 | 432 |
407 void PPB_Flash_Proxy::OnMsgIsRectTopmost(PP_Instance instance, | 433 void PPB_Flash_Proxy::OnMsgIsRectTopmost(PP_Instance instance, |
408 PP_Rect rect, | 434 PP_Rect rect, |
409 PP_Bool* result) { | 435 PP_Bool* result) { |
410 *result = ppb_flash_impl_->IsRectTopmost(instance, &rect); | 436 *result = ppb_flash_impl_->IsRectTopmost(instance, &rect); |
411 } | 437 } |
412 | 438 |
413 } // namespace proxy | 439 } // namespace proxy |
414 } // namespace ppapi | 440 } // namespace ppapi |
OLD | NEW |