| 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 #include "webkit/plugins/ppapi/mock_plugin_delegate.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/message_loop/message_loop_proxy.h" | |
| 9 #include "ppapi/c/pp_errors.h" | |
| 10 #include "ppapi/shared_impl/ppapi_permissions.h" | |
| 11 #include "ppapi/shared_impl/ppapi_preferences.h" | |
| 12 #include "third_party/WebKit/public/platform/WebGamepads.h" | |
| 13 #include "webkit/plugins/ppapi/mock_platform_image_2d.h" | |
| 14 #include "webkit/plugins/ppapi/plugin_delegate.h" | |
| 15 #include "webkit/plugins/ppapi/plugin_module.h" | |
| 16 #include "webkit/plugins/ppapi/ppapi_plugin_instance_impl.h" | |
| 17 | |
| 18 namespace webkit { | |
| 19 namespace ppapi { | |
| 20 | |
| 21 MockPluginDelegate::MockPluginDelegate() { | |
| 22 } | |
| 23 | |
| 24 MockPluginDelegate::~MockPluginDelegate() { | |
| 25 } | |
| 26 | |
| 27 void MockPluginDelegate::PluginFocusChanged(PluginInstanceImpl* instance, | |
| 28 bool focused) { | |
| 29 } | |
| 30 | |
| 31 void MockPluginDelegate::PluginTextInputTypeChanged( | |
| 32 PluginInstanceImpl* instance) { | |
| 33 } | |
| 34 | |
| 35 void MockPluginDelegate::PluginCaretPositionChanged( | |
| 36 PluginInstanceImpl* instance) { | |
| 37 } | |
| 38 | |
| 39 void MockPluginDelegate::PluginRequestedCancelComposition( | |
| 40 PluginInstanceImpl* instance) { | |
| 41 } | |
| 42 | |
| 43 void MockPluginDelegate::PluginSelectionChanged(PluginInstanceImpl* instance) { | |
| 44 } | |
| 45 | |
| 46 void MockPluginDelegate::SimulateImeSetComposition( | |
| 47 const base::string16& text, | |
| 48 const std::vector<WebKit::WebCompositionUnderline>& underlines, | |
| 49 int selection_start, | |
| 50 int selection_end) { | |
| 51 } | |
| 52 | |
| 53 void MockPluginDelegate::SimulateImeConfirmComposition( | |
| 54 const base::string16& text) { | |
| 55 } | |
| 56 | |
| 57 void MockPluginDelegate::PluginCrashed(PluginInstanceImpl* instance) { | |
| 58 } | |
| 59 | |
| 60 void MockPluginDelegate::InstanceCreated(PluginInstanceImpl* instance) { | |
| 61 } | |
| 62 | |
| 63 void MockPluginDelegate::InstanceDeleted(PluginInstanceImpl* instance) { | |
| 64 } | |
| 65 | |
| 66 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> | |
| 67 MockPluginDelegate::CreateResourceCreationAPI(PluginInstanceImpl* instance) { | |
| 68 return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(); | |
| 69 } | |
| 70 | |
| 71 SkBitmap* MockPluginDelegate::GetSadPluginBitmap() { | |
| 72 return NULL; | |
| 73 } | |
| 74 | |
| 75 WebKit::WebPlugin* MockPluginDelegate::CreatePluginReplacement( | |
| 76 const base::FilePath& file_path) { | |
| 77 return NULL; | |
| 78 } | |
| 79 | |
| 80 MockPluginDelegate::PlatformImage2D* MockPluginDelegate::CreateImage2D( | |
| 81 int width, | |
| 82 int height) { | |
| 83 return new MockPlatformImage2D(width, height); | |
| 84 } | |
| 85 | |
| 86 PluginDelegate::PlatformGraphics2D* MockPluginDelegate::GetGraphics2D( | |
| 87 PluginInstanceImpl* instance, | |
| 88 PP_Resource graphics_2d) { | |
| 89 return NULL; | |
| 90 } | |
| 91 | |
| 92 MockPluginDelegate::PlatformContext3D* MockPluginDelegate::CreateContext3D() { | |
| 93 return NULL; | |
| 94 } | |
| 95 | |
| 96 MockPluginDelegate::PlatformVideoDecoder* | |
| 97 MockPluginDelegate::CreateVideoDecoder( | |
| 98 media::VideoDecodeAccelerator::Client* client, | |
| 99 int32 command_buffer_route_id) { | |
| 100 return NULL; | |
| 101 } | |
| 102 | |
| 103 MockPluginDelegate::PlatformVideoCapture* | |
| 104 MockPluginDelegate::CreateVideoCapture( | |
| 105 const std::string& device_id, | |
| 106 const GURL& document_url, | |
| 107 PlatformVideoCaptureEventHandler* handler){ | |
| 108 return NULL; | |
| 109 } | |
| 110 | |
| 111 uint32_t MockPluginDelegate::GetAudioHardwareOutputSampleRate() { | |
| 112 return 0; | |
| 113 } | |
| 114 | |
| 115 uint32_t MockPluginDelegate::GetAudioHardwareOutputBufferSize() { | |
| 116 return 0; | |
| 117 } | |
| 118 | |
| 119 MockPluginDelegate::PlatformAudioOutput* MockPluginDelegate::CreateAudioOutput( | |
| 120 uint32_t sample_rate, | |
| 121 uint32_t sample_count, | |
| 122 PlatformAudioOutputClient* client) { | |
| 123 return NULL; | |
| 124 } | |
| 125 | |
| 126 MockPluginDelegate::PlatformAudioInput* MockPluginDelegate::CreateAudioInput( | |
| 127 const std::string& device_id, | |
| 128 const GURL& document_url, | |
| 129 uint32_t sample_rate, | |
| 130 uint32_t sample_count, | |
| 131 PlatformAudioInputClient* client) { | |
| 132 return NULL; | |
| 133 } | |
| 134 | |
| 135 MockPluginDelegate::Broker* MockPluginDelegate::ConnectToBroker( | |
| 136 PPB_Broker_Impl* client) { | |
| 137 return NULL; | |
| 138 } | |
| 139 | |
| 140 void MockPluginDelegate::NumberOfFindResultsChanged(int identifier, | |
| 141 int total, | |
| 142 bool final_result) { | |
| 143 } | |
| 144 | |
| 145 void MockPluginDelegate::SelectedFindResultChanged(int identifier, int index) { | |
| 146 } | |
| 147 | |
| 148 bool MockPluginDelegate::AsyncOpenFile(const base::FilePath& path, | |
| 149 int flags, | |
| 150 const AsyncOpenFileCallback& callback) { | |
| 151 return false; | |
| 152 } | |
| 153 | |
| 154 void MockPluginDelegate::AsyncOpenFileSystemURL( | |
| 155 const GURL& path, | |
| 156 int flags, | |
| 157 const AsyncOpenFileSystemURLCallback& callback) { | |
| 158 } | |
| 159 | |
| 160 bool MockPluginDelegate::IsFileSystemOpened( | |
| 161 PP_Instance instance, | |
| 162 PP_Resource resource) const { | |
| 163 return false; | |
| 164 } | |
| 165 | |
| 166 PP_FileSystemType MockPluginDelegate::GetFileSystemType( | |
| 167 PP_Instance instance, | |
| 168 PP_Resource resource) const { | |
| 169 return PP_FILESYSTEMTYPE_INVALID; | |
| 170 } | |
| 171 | |
| 172 GURL MockPluginDelegate::GetFileSystemRootUrl( | |
| 173 PP_Instance instance, | |
| 174 PP_Resource resource) const { | |
| 175 return GURL(); | |
| 176 } | |
| 177 | |
| 178 void MockPluginDelegate::MakeDirectory( | |
| 179 const GURL& path, | |
| 180 bool recursive, | |
| 181 const StatusCallback& callback) { | |
| 182 } | |
| 183 | |
| 184 void MockPluginDelegate::Query( | |
| 185 const GURL& path, | |
| 186 const MetadataCallback& success_callback, | |
| 187 const StatusCallback& error_callback) { | |
| 188 } | |
| 189 | |
| 190 void MockPluginDelegate::ReadDirectoryEntries( | |
| 191 const GURL& path, | |
| 192 const ReadDirectoryCallback& success_callback, | |
| 193 const StatusCallback& error_callback) { | |
| 194 } | |
| 195 | |
| 196 void MockPluginDelegate::Touch( | |
| 197 const GURL& path, | |
| 198 const base::Time& last_access_time, | |
| 199 const base::Time& last_modified_time, | |
| 200 const StatusCallback& callback) { | |
| 201 } | |
| 202 | |
| 203 void MockPluginDelegate::SetLength( | |
| 204 const GURL& path, | |
| 205 int64_t length, | |
| 206 const StatusCallback& callback) { | |
| 207 } | |
| 208 | |
| 209 void MockPluginDelegate::Delete( | |
| 210 const GURL& path, | |
| 211 const StatusCallback& callback) { | |
| 212 } | |
| 213 | |
| 214 void MockPluginDelegate::Rename( | |
| 215 const GURL& file_path, | |
| 216 const GURL& new_file_path, | |
| 217 const StatusCallback& callback) { | |
| 218 } | |
| 219 | |
| 220 void MockPluginDelegate::ReadDirectory( | |
| 221 const GURL& directory_path, | |
| 222 const ReadDirectoryCallback& success_callback, | |
| 223 const StatusCallback& error_callback) { | |
| 224 } | |
| 225 | |
| 226 void MockPluginDelegate::QueryAvailableSpace( | |
| 227 const GURL& origin, quota::StorageType type, | |
| 228 const AvailableSpaceCallback& callback) { | |
| 229 } | |
| 230 | |
| 231 void MockPluginDelegate::WillUpdateFile(const GURL& file_path) { | |
| 232 } | |
| 233 | |
| 234 void MockPluginDelegate::DidUpdateFile(const GURL& file_path, int64_t delta) { | |
| 235 } | |
| 236 | |
| 237 void MockPluginDelegate::SyncGetFileSystemPlatformPath( | |
| 238 const GURL& url, | |
| 239 base::FilePath* platform_path) { | |
| 240 DCHECK(platform_path); | |
| 241 *platform_path = base::FilePath(); | |
| 242 } | |
| 243 | |
| 244 scoped_refptr<base::MessageLoopProxy> | |
| 245 MockPluginDelegate::GetFileThreadMessageLoopProxy() { | |
| 246 return scoped_refptr<base::MessageLoopProxy>(); | |
| 247 } | |
| 248 | |
| 249 uint32 MockPluginDelegate::TCPSocketCreate() { | |
| 250 return 0; | |
| 251 } | |
| 252 | |
| 253 void MockPluginDelegate::TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket, | |
| 254 uint32 socket_id, | |
| 255 const std::string& host, | |
| 256 uint16_t port) { | |
| 257 } | |
| 258 | |
| 259 void MockPluginDelegate::TCPSocketConnectWithNetAddress( | |
| 260 PPB_TCPSocket_Private_Impl* socket, | |
| 261 uint32 socket_id, | |
| 262 const PP_NetAddress_Private& addr) { | |
| 263 } | |
| 264 | |
| 265 void MockPluginDelegate::TCPSocketSSLHandshake( | |
| 266 uint32 socket_id, | |
| 267 const std::string& server_name, | |
| 268 uint16_t server_port, | |
| 269 const std::vector<std::vector<char> >& trusted_certs, | |
| 270 const std::vector<std::vector<char> >& untrusted_certs) { | |
| 271 } | |
| 272 | |
| 273 void MockPluginDelegate::TCPSocketRead(uint32 socket_id, | |
| 274 int32_t bytes_to_read) { | |
| 275 } | |
| 276 | |
| 277 void MockPluginDelegate::TCPSocketWrite(uint32 socket_id, | |
| 278 const std::string& buffer) { | |
| 279 } | |
| 280 | |
| 281 void MockPluginDelegate::TCPSocketSetOption( | |
| 282 uint32 socket_id, | |
| 283 PP_TCPSocket_Option name, | |
| 284 const ::ppapi::SocketOptionData& value) { | |
| 285 } | |
| 286 | |
| 287 void MockPluginDelegate::TCPSocketDisconnect(uint32 socket_id) { | |
| 288 } | |
| 289 | |
| 290 void MockPluginDelegate::RegisterTCPSocket(PPB_TCPSocket_Private_Impl* socket, | |
| 291 uint32 socket_id) { | |
| 292 } | |
| 293 | |
| 294 void MockPluginDelegate::TCPServerSocketListen( | |
| 295 PP_Resource socket_resource, | |
| 296 const PP_NetAddress_Private& addr, | |
| 297 int32_t backlog) { | |
| 298 } | |
| 299 | |
| 300 void MockPluginDelegate::TCPServerSocketAccept(uint32 server_socket_id) { | |
| 301 } | |
| 302 | |
| 303 void MockPluginDelegate::TCPServerSocketStopListening( | |
| 304 PP_Resource socket_resource, | |
| 305 uint32 socket_id) { | |
| 306 } | |
| 307 | |
| 308 bool MockPluginDelegate::AddNetworkListObserver( | |
| 309 webkit_glue::NetworkListObserver* observer) { | |
| 310 return false; | |
| 311 } | |
| 312 | |
| 313 void MockPluginDelegate::RemoveNetworkListObserver( | |
| 314 webkit_glue::NetworkListObserver* observer) { | |
| 315 } | |
| 316 | |
| 317 bool MockPluginDelegate::X509CertificateParseDER( | |
| 318 const std::vector<char>& der, | |
| 319 ::ppapi::PPB_X509Certificate_Fields* fields) { | |
| 320 return false; | |
| 321 } | |
| 322 | |
| 323 FullscreenContainer* MockPluginDelegate::CreateFullscreenContainer( | |
| 324 PluginInstanceImpl* instance) { | |
| 325 return NULL; | |
| 326 } | |
| 327 | |
| 328 gfx::Size MockPluginDelegate::GetScreenSize() { | |
| 329 return gfx::Size(1024, 768); | |
| 330 } | |
| 331 | |
| 332 std::string MockPluginDelegate::GetDefaultEncoding() { | |
| 333 return "iso-8859-1"; | |
| 334 } | |
| 335 | |
| 336 void MockPluginDelegate::ZoomLimitsChanged(double minimum_factor, | |
| 337 double maximum_factor) { | |
| 338 } | |
| 339 | |
| 340 void MockPluginDelegate::DidStartLoading() { | |
| 341 } | |
| 342 | |
| 343 void MockPluginDelegate::DidStopLoading() { | |
| 344 } | |
| 345 | |
| 346 void MockPluginDelegate::SetContentRestriction(int restrictions) { | |
| 347 } | |
| 348 | |
| 349 void MockPluginDelegate::SaveURLAs(const GURL& url) { | |
| 350 } | |
| 351 | |
| 352 base::SharedMemory* MockPluginDelegate::CreateAnonymousSharedMemory( | |
| 353 size_t size) { | |
| 354 return NULL; | |
| 355 } | |
| 356 | |
| 357 ::ppapi::Preferences MockPluginDelegate::GetPreferences() { | |
| 358 return ::ppapi::Preferences(); | |
| 359 } | |
| 360 | |
| 361 bool MockPluginDelegate::LockMouse(PluginInstanceImpl* instance) { | |
| 362 return false; | |
| 363 } | |
| 364 | |
| 365 void MockPluginDelegate::UnlockMouse(PluginInstanceImpl* instance) { | |
| 366 } | |
| 367 | |
| 368 bool MockPluginDelegate::IsMouseLocked(PluginInstanceImpl* instance) { | |
| 369 return false; | |
| 370 } | |
| 371 | |
| 372 void MockPluginDelegate::DidChangeCursor(PluginInstanceImpl* instance, | |
| 373 const WebKit::WebCursorInfo& cursor) { | |
| 374 } | |
| 375 | |
| 376 void MockPluginDelegate::DidReceiveMouseEvent(PluginInstanceImpl* instance) { | |
| 377 } | |
| 378 | |
| 379 void MockPluginDelegate::SampleGamepads(WebKit::WebGamepads* data) { | |
| 380 data->length = 0; | |
| 381 } | |
| 382 | |
| 383 bool MockPluginDelegate::IsInFullscreenMode() { | |
| 384 return false; | |
| 385 } | |
| 386 | |
| 387 bool MockPluginDelegate::IsPageVisible() const { | |
| 388 return true; | |
| 389 } | |
| 390 | |
| 391 int MockPluginDelegate::EnumerateDevices( | |
| 392 PP_DeviceType_Dev type, | |
| 393 const EnumerateDevicesCallback& callback) { | |
| 394 return -1; | |
| 395 } | |
| 396 | |
| 397 void MockPluginDelegate::StopEnumerateDevices(int request_id) { | |
| 398 } | |
| 399 | |
| 400 IPC::PlatformFileForTransit MockPluginDelegate::ShareHandleWithRemote( | |
| 401 base::PlatformFile handle, | |
| 402 base::ProcessId target_process_id, | |
| 403 bool should_close_source) const { | |
| 404 return IPC::InvalidPlatformFileForTransit(); | |
| 405 } | |
| 406 | |
| 407 bool MockPluginDelegate::IsRunningInProcess(PP_Instance instance) const { | |
| 408 return false; | |
| 409 } | |
| 410 | |
| 411 void MockPluginDelegate::HandleDocumentLoad( | |
| 412 PluginInstanceImpl* instance, | |
| 413 const WebKit::WebURLResponse& response) { | |
| 414 } | |
| 415 | |
| 416 content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule( | |
| 417 scoped_refptr<PluginModule> module, | |
| 418 const base::FilePath& path, | |
| 419 ::ppapi::PpapiPermissions permissions, | |
| 420 const IPC::ChannelHandle& channel_handle, | |
| 421 base::ProcessId plugin_pid, | |
| 422 int plugin_child_id) { | |
| 423 return NULL; | |
| 424 } | |
| 425 | |
| 426 } // namespace ppapi | |
| 427 } // namespace webkit | |
| OLD | NEW |