| 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 "webkit/plugins/ppapi/mock_plugin_delegate.h" | 5 #include "webkit/plugins/ppapi/mock_plugin_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/shared_impl/ppapi_permissions.h" | 10 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 11 #include "ppapi/shared_impl/ppapi_preferences.h" | 11 #include "ppapi/shared_impl/ppapi_preferences.h" |
| 12 #include "third_party/WebKit/public/platform/WebGamepads.h" | 12 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 13 #include "webkit/plugins/ppapi/mock_platform_image_2d.h" | 13 #include "webkit/plugins/ppapi/mock_platform_image_2d.h" |
| 14 #include "webkit/plugins/ppapi/plugin_delegate.h" | 14 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 15 #include "webkit/plugins/ppapi/plugin_module.h" | 15 #include "webkit/plugins/ppapi/plugin_module.h" |
| 16 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 16 #include "webkit/plugins/ppapi/ppapi_plugin_instance_impl.h" |
| 17 | 17 |
| 18 namespace webkit { | 18 namespace webkit { |
| 19 namespace ppapi { | 19 namespace ppapi { |
| 20 | 20 |
| 21 MockPluginDelegate::MockPluginDelegate() { | 21 MockPluginDelegate::MockPluginDelegate() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 MockPluginDelegate::~MockPluginDelegate() { | 24 MockPluginDelegate::~MockPluginDelegate() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void MockPluginDelegate::PluginFocusChanged(PluginInstance* instance, | 27 void MockPluginDelegate::PluginFocusChanged(PluginInstanceImpl* instance, |
| 28 bool focused) { | 28 bool focused) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 void MockPluginDelegate::PluginTextInputTypeChanged(PluginInstance* instance) { | 31 void MockPluginDelegate::PluginTextInputTypeChanged( |
| 32 PluginInstanceImpl* instance) { |
| 32 } | 33 } |
| 33 | 34 |
| 34 void MockPluginDelegate::PluginCaretPositionChanged(PluginInstance* instance) { | 35 void MockPluginDelegate::PluginCaretPositionChanged( |
| 36 PluginInstanceImpl* instance) { |
| 35 } | 37 } |
| 36 | 38 |
| 37 void MockPluginDelegate::PluginRequestedCancelComposition( | 39 void MockPluginDelegate::PluginRequestedCancelComposition( |
| 38 PluginInstance* instance) { | 40 PluginInstanceImpl* instance) { |
| 39 } | 41 } |
| 40 | 42 |
| 41 void MockPluginDelegate::PluginSelectionChanged(PluginInstance* instance) { | 43 void MockPluginDelegate::PluginSelectionChanged(PluginInstanceImpl* instance) { |
| 42 } | 44 } |
| 43 | 45 |
| 44 void MockPluginDelegate::SimulateImeSetComposition( | 46 void MockPluginDelegate::SimulateImeSetComposition( |
| 45 const base::string16& text, | 47 const base::string16& text, |
| 46 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 48 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
| 47 int selection_start, | 49 int selection_start, |
| 48 int selection_end) { | 50 int selection_end) { |
| 49 } | 51 } |
| 50 | 52 |
| 51 void MockPluginDelegate::SimulateImeConfirmComposition( | 53 void MockPluginDelegate::SimulateImeConfirmComposition( |
| 52 const base::string16& text) { | 54 const base::string16& text) { |
| 53 } | 55 } |
| 54 | 56 |
| 55 void MockPluginDelegate::PluginCrashed(PluginInstance* instance) { | 57 void MockPluginDelegate::PluginCrashed(PluginInstanceImpl* instance) { |
| 56 } | 58 } |
| 57 | 59 |
| 58 void MockPluginDelegate::InstanceCreated(PluginInstance* instance) { | 60 void MockPluginDelegate::InstanceCreated(PluginInstanceImpl* instance) { |
| 59 } | 61 } |
| 60 | 62 |
| 61 void MockPluginDelegate::InstanceDeleted(PluginInstance* instance) { | 63 void MockPluginDelegate::InstanceDeleted(PluginInstanceImpl* instance) { |
| 62 } | 64 } |
| 63 | 65 |
| 64 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> | 66 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> |
| 65 MockPluginDelegate::CreateResourceCreationAPI(PluginInstance* instance) { | 67 MockPluginDelegate::CreateResourceCreationAPI(PluginInstanceImpl* instance) { |
| 66 return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(); | 68 return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 SkBitmap* MockPluginDelegate::GetSadPluginBitmap() { | 71 SkBitmap* MockPluginDelegate::GetSadPluginBitmap() { |
| 70 return NULL; | 72 return NULL; |
| 71 } | 73 } |
| 72 | 74 |
| 73 WebKit::WebPlugin* MockPluginDelegate::CreatePluginReplacement( | 75 WebKit::WebPlugin* MockPluginDelegate::CreatePluginReplacement( |
| 74 const base::FilePath& file_path) { | 76 const base::FilePath& file_path) { |
| 75 return NULL; | 77 return NULL; |
| 76 } | 78 } |
| 77 | 79 |
| 78 MockPluginDelegate::PlatformImage2D* MockPluginDelegate::CreateImage2D( | 80 MockPluginDelegate::PlatformImage2D* MockPluginDelegate::CreateImage2D( |
| 79 int width, | 81 int width, |
| 80 int height) { | 82 int height) { |
| 81 return new MockPlatformImage2D(width, height); | 83 return new MockPlatformImage2D(width, height); |
| 82 } | 84 } |
| 83 | 85 |
| 84 PluginDelegate::PlatformGraphics2D* MockPluginDelegate::GetGraphics2D( | 86 PluginDelegate::PlatformGraphics2D* MockPluginDelegate::GetGraphics2D( |
| 85 PluginInstance* instance, | 87 PluginInstanceImpl* instance, |
| 86 PP_Resource graphics_2d) { | 88 PP_Resource graphics_2d) { |
| 87 return NULL; | 89 return NULL; |
| 88 } | 90 } |
| 89 | 91 |
| 90 MockPluginDelegate::PlatformContext3D* MockPluginDelegate::CreateContext3D() { | 92 MockPluginDelegate::PlatformContext3D* MockPluginDelegate::CreateContext3D() { |
| 91 return NULL; | 93 return NULL; |
| 92 } | 94 } |
| 93 | 95 |
| 94 MockPluginDelegate::PlatformVideoDecoder* | 96 MockPluginDelegate::PlatformVideoDecoder* |
| 95 MockPluginDelegate::CreateVideoDecoder( | 97 MockPluginDelegate::CreateVideoDecoder( |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 webkit_glue::NetworkListObserver* observer) { | 314 webkit_glue::NetworkListObserver* observer) { |
| 313 } | 315 } |
| 314 | 316 |
| 315 bool MockPluginDelegate::X509CertificateParseDER( | 317 bool MockPluginDelegate::X509CertificateParseDER( |
| 316 const std::vector<char>& der, | 318 const std::vector<char>& der, |
| 317 ::ppapi::PPB_X509Certificate_Fields* fields) { | 319 ::ppapi::PPB_X509Certificate_Fields* fields) { |
| 318 return false; | 320 return false; |
| 319 } | 321 } |
| 320 | 322 |
| 321 FullscreenContainer* MockPluginDelegate::CreateFullscreenContainer( | 323 FullscreenContainer* MockPluginDelegate::CreateFullscreenContainer( |
| 322 PluginInstance* instance) { | 324 PluginInstanceImpl* instance) { |
| 323 return NULL; | 325 return NULL; |
| 324 } | 326 } |
| 325 | 327 |
| 326 gfx::Size MockPluginDelegate::GetScreenSize() { | 328 gfx::Size MockPluginDelegate::GetScreenSize() { |
| 327 return gfx::Size(1024, 768); | 329 return gfx::Size(1024, 768); |
| 328 } | 330 } |
| 329 | 331 |
| 330 std::string MockPluginDelegate::GetDefaultEncoding() { | 332 std::string MockPluginDelegate::GetDefaultEncoding() { |
| 331 return "iso-8859-1"; | 333 return "iso-8859-1"; |
| 332 } | 334 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 349 | 351 |
| 350 base::SharedMemory* MockPluginDelegate::CreateAnonymousSharedMemory( | 352 base::SharedMemory* MockPluginDelegate::CreateAnonymousSharedMemory( |
| 351 size_t size) { | 353 size_t size) { |
| 352 return NULL; | 354 return NULL; |
| 353 } | 355 } |
| 354 | 356 |
| 355 ::ppapi::Preferences MockPluginDelegate::GetPreferences() { | 357 ::ppapi::Preferences MockPluginDelegate::GetPreferences() { |
| 356 return ::ppapi::Preferences(); | 358 return ::ppapi::Preferences(); |
| 357 } | 359 } |
| 358 | 360 |
| 359 bool MockPluginDelegate::LockMouse(PluginInstance* instance) { | 361 bool MockPluginDelegate::LockMouse(PluginInstanceImpl* instance) { |
| 360 return false; | 362 return false; |
| 361 } | 363 } |
| 362 | 364 |
| 363 void MockPluginDelegate::UnlockMouse(PluginInstance* instance) { | 365 void MockPluginDelegate::UnlockMouse(PluginInstanceImpl* instance) { |
| 364 } | 366 } |
| 365 | 367 |
| 366 bool MockPluginDelegate::IsMouseLocked(PluginInstance* instance) { | 368 bool MockPluginDelegate::IsMouseLocked(PluginInstanceImpl* instance) { |
| 367 return false; | 369 return false; |
| 368 } | 370 } |
| 369 | 371 |
| 370 void MockPluginDelegate::DidChangeCursor(PluginInstance* instance, | 372 void MockPluginDelegate::DidChangeCursor(PluginInstanceImpl* instance, |
| 371 const WebKit::WebCursorInfo& cursor) { | 373 const WebKit::WebCursorInfo& cursor) { |
| 372 } | 374 } |
| 373 | 375 |
| 374 void MockPluginDelegate::DidReceiveMouseEvent(PluginInstance* instance) { | 376 void MockPluginDelegate::DidReceiveMouseEvent(PluginInstanceImpl* instance) { |
| 375 } | 377 } |
| 376 | 378 |
| 377 void MockPluginDelegate::SampleGamepads(WebKit::WebGamepads* data) { | 379 void MockPluginDelegate::SampleGamepads(WebKit::WebGamepads* data) { |
| 378 data->length = 0; | 380 data->length = 0; |
| 379 } | 381 } |
| 380 | 382 |
| 381 bool MockPluginDelegate::IsInFullscreenMode() { | 383 bool MockPluginDelegate::IsInFullscreenMode() { |
| 382 return false; | 384 return false; |
| 383 } | 385 } |
| 384 | 386 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 400 base::ProcessId target_process_id, | 402 base::ProcessId target_process_id, |
| 401 bool should_close_source) const { | 403 bool should_close_source) const { |
| 402 return IPC::InvalidPlatformFileForTransit(); | 404 return IPC::InvalidPlatformFileForTransit(); |
| 403 } | 405 } |
| 404 | 406 |
| 405 bool MockPluginDelegate::IsRunningInProcess(PP_Instance instance) const { | 407 bool MockPluginDelegate::IsRunningInProcess(PP_Instance instance) const { |
| 406 return false; | 408 return false; |
| 407 } | 409 } |
| 408 | 410 |
| 409 void MockPluginDelegate::HandleDocumentLoad( | 411 void MockPluginDelegate::HandleDocumentLoad( |
| 410 PluginInstance* instance, | 412 PluginInstanceImpl* instance, |
| 411 const WebKit::WebURLResponse& response) { | 413 const WebKit::WebURLResponse& response) { |
| 412 } | 414 } |
| 413 | 415 |
| 414 content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule( | 416 content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule( |
| 415 scoped_refptr<PluginModule> module, | 417 scoped_refptr<PluginModule> module, |
| 416 const base::FilePath& path, | 418 const base::FilePath& path, |
| 417 ::ppapi::PpapiPermissions permissions, | 419 ::ppapi::PpapiPermissions permissions, |
| 418 const IPC::ChannelHandle& channel_handle, | 420 const IPC::ChannelHandle& channel_handle, |
| 419 base::ProcessId plugin_pid, | 421 base::ProcessId plugin_pid, |
| 420 int plugin_child_id) { | 422 int plugin_child_id) { |
| 421 return NULL; | 423 return NULL; |
| 422 } | 424 } |
| 423 | 425 |
| 424 } // namespace ppapi | 426 } // namespace ppapi |
| 425 } // namespace webkit | 427 } // namespace webkit |
| OLD | NEW |