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 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 // necessary. | 483 // necessary. |
484 virtual std::string GetFlashCommandLineArgs() = 0; | 484 virtual std::string GetFlashCommandLineArgs() = 0; |
485 | 485 |
486 // Create an anonymous shared memory segment of size |size| bytes, and return | 486 // Create an anonymous shared memory segment of size |size| bytes, and return |
487 // a pointer to it, or NULL on error. Caller owns the returned pointer. | 487 // a pointer to it, or NULL on error. Caller owns the returned pointer. |
488 virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size) = 0; | 488 virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size) = 0; |
489 | 489 |
490 // Returns the current preferences. | 490 // Returns the current preferences. |
491 virtual ::ppapi::Preferences GetPreferences() = 0; | 491 virtual ::ppapi::Preferences GetPreferences() = 0; |
492 | 492 |
493 // Locks the mouse for |instance|. It will call | 493 // Locks the mouse for |instance|. If false is returned, the lock is not |
494 // PluginInstance::OnLockMouseACK() to notify the instance when the operation | 494 // possible. If true is returned then the lock is pending. Success or |
495 // is completed. The call to OnLockMouseACK() may be synchronous (i.e., it may | 495 // failure will be delivered asynchronously via |
496 // be called when LockMouse() is still on the stack). | 496 // PluginInstance::OnLockMouseACK(). |
497 virtual void LockMouse(PluginInstance* instance) = 0; | 497 virtual bool LockMouse(PluginInstance* instance) = 0; |
498 | 498 |
499 // Unlocks the mouse if |instance| currently owns the mouse lock. Whenever an | 499 // Unlocks the mouse if |instance| currently owns the mouse lock. Whenever an |
500 // plugin instance has lost the mouse lock, it will be notified by | 500 // plugin instance has lost the mouse lock, it will be notified by |
501 // PluginInstance::OnMouseLockLost(). Please note that UnlockMouse() is not | 501 // PluginInstance::OnMouseLockLost(). Please note that UnlockMouse() is not |
502 // the only cause of losing mouse lock. For example, a user may press the Esc | 502 // the only cause of losing mouse lock. For example, a user may press the Esc |
503 // key to quit the mouse lock mode, which also results in an OnMouseLockLost() | 503 // key to quit the mouse lock mode, which also results in an OnMouseLockLost() |
504 // call to the current mouse lock owner. | 504 // call to the current mouse lock owner. |
505 virtual void UnlockMouse(PluginInstance* instance) = 0; | 505 virtual void UnlockMouse(PluginInstance* instance) = 0; |
506 | 506 |
| 507 // Returns true iif |instance| currently owns the mouse lock. |
| 508 virtual bool IsMouseLocked(PluginInstance* instance) = 0; |
| 509 |
507 // Notifies that |instance| has changed the cursor. | 510 // Notifies that |instance| has changed the cursor. |
508 // This will update the cursor appearance if it is currently over the plugin | 511 // This will update the cursor appearance if it is currently over the plugin |
509 // instance. | 512 // instance. |
510 virtual void DidChangeCursor(PluginInstance* instance, | 513 virtual void DidChangeCursor(PluginInstance* instance, |
511 const WebKit::WebCursorInfo& cursor) = 0; | 514 const WebKit::WebCursorInfo& cursor) = 0; |
512 | 515 |
513 // Notifies that |instance| has received a mouse event. | 516 // Notifies that |instance| has received a mouse event. |
514 virtual void DidReceiveMouseEvent(PluginInstance* instance) = 0; | 517 virtual void DidReceiveMouseEvent(PluginInstance* instance) = 0; |
515 | 518 |
516 // Determines if the browser entered fullscreen mode. | 519 // Determines if the browser entered fullscreen mode. |
517 virtual bool IsInFullscreenMode() = 0; | 520 virtual bool IsInFullscreenMode() = 0; |
518 | 521 |
519 // Retrieve current gamepad data. | 522 // Retrieve current gamepad data. |
520 virtual void SampleGamepads(WebKit::WebGamepads* data) = 0; | 523 virtual void SampleGamepads(WebKit::WebGamepads* data) = 0; |
521 | 524 |
522 // Returns true if the containing page is visible. | 525 // Returns true if the containing page is visible. |
523 virtual bool IsPageVisible() const = 0; | 526 virtual bool IsPageVisible() const = 0; |
524 }; | 527 }; |
525 | 528 |
526 } // namespace ppapi | 529 } // namespace ppapi |
527 } // namespace webkit | 530 } // namespace webkit |
528 | 531 |
529 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 532 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
OLD | NEW |