diff options
author | sehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-08 04:35:22 +0000 |
---|---|---|
committer | sehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-08 04:35:22 +0000 |
commit | afa09a4f216d897dc2f651f9a7053ffd81a29753 (patch) | |
tree | 21287b3a4de2dd3d7951a0cc0fdad60ea4ae5e25 /webkit/tools/pepper_test_plugin/plugin_object.cc | |
parent | bf7e9637d7935075e56bd3d15df864f78312df53 (diff) | |
download | chromium_src-afa09a4f216d897dc2f651f9a7053ffd81a29753.zip chromium_src-afa09a4f216d897dc2f651f9a7053ffd81a29753.tar.gz chromium_src-afa09a4f216d897dc2f651f9a7053ffd81a29753.tar.bz2 |
Enable pepper events to flow to the plugin. Also enable printing of the event
types observed at NPP_HandleEvent.
Review URL: http://codereview.chromium.org/465110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/pepper_test_plugin/plugin_object.cc')
-rw-r--r-- | webkit/tools/pepper_test_plugin/plugin_object.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webkit/tools/pepper_test_plugin/plugin_object.cc b/webkit/tools/pepper_test_plugin/plugin_object.cc index 432bfc4..5b001da 100644 --- a/webkit/tools/pepper_test_plugin/plugin_object.cc +++ b/webkit/tools/pepper_test_plugin/plugin_object.cc @@ -32,6 +32,7 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/effects/SkGradientShader.h" +#include "webkit/tools/pepper_test_plugin/event_handler.h" #include "webkit/tools/pepper_test_plugin/test_object.h" NPNetscapeFuncs* browser; @@ -56,12 +57,14 @@ static const NPUTF8* plugin_property_identifier_names[NUM_PROPERTY_IDENTIFIERS] enum { ID_TEST_GET_PROPERTY = 0, + ID_SET_TEXT_BOX, NUM_METHOD_IDENTIFIERS }; static NPIdentifier plugin_method_identifiers[NUM_METHOD_IDENTIFIERS]; static const NPUTF8* plugin_method_identifier_names[NUM_METHOD_IDENTIFIERS] = { "testGetProperty", + "setTextBox", }; void EnsureIdentifiersInitialized() { @@ -150,8 +153,13 @@ bool PluginInvoke(NPObject* header, const NPVariant* args, uint32 arg_count, NPVariant* result) { PluginObject* plugin = reinterpret_cast<PluginObject*>(header); - if (name == plugin_method_identifiers[ID_TEST_GET_PROPERTY]) + if (name == plugin_method_identifiers[ID_TEST_GET_PROPERTY]) { return TestGetProperty(plugin, args, arg_count, result); + } else if (name == plugin_method_identifiers[ID_SET_TEXT_BOX]) { + if (1 == arg_count && NPVARIANT_IS_OBJECT(args[0])) { + return event_handler->set_text_box(NPVARIANT_TO_OBJECT(args[0])); + } + } return false; } |