diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 15:38:48 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 15:38:48 +0000 |
commit | 493d1421853518d3b16a7b103311ea4fa1988341 (patch) | |
tree | abc9bd73da85786a933666c8c6042a62aabd7c4b /ppapi/example/example.cc | |
parent | b18d98d7de474db2a2057d0e3aaaac9bd87a2f41 (diff) | |
download | chromium_src-493d1421853518d3b16a7b103311ea4fa1988341.zip chromium_src-493d1421853518d3b16a7b103311ea4fa1988341.tar.gz chromium_src-493d1421853518d3b16a7b103311ea4fa1988341.tar.bz2 |
Add interfaces for requesting and receiving input event resources.
This converts the input event from a C struct to a resource to give us more
ability to change over time. This patch includes a proxy and a C++ wrapper for
this resource.
You now have to register for classes of input events. No events are sent by
default. This also allows us to specify whether the events support bubbling
or not, which allows us to better-optimize IPC.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/7285010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/example/example.cc')
-rw-r--r-- | ppapi/example/example.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ppapi/example/example.cc b/ppapi/example/example.cc index 93696f0..6ef0640 100644 --- a/ppapi/example/example.cc +++ b/ppapi/example/example.cc @@ -17,12 +17,12 @@ #include "ppapi/c/dev/ppb_cursor_control_dev.h" #include "ppapi/c/dev/ppp_printing_dev.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/c/pp_input_event.h" #include "ppapi/c/pp_rect.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/scriptable_object_deprecated.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/image_data.h" +#include "ppapi/cpp/input_event.h" #include "ppapi/cpp/private/instance_private.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/private/var_private.h" @@ -169,7 +169,9 @@ class MyInstance : public pp::InstancePrivate, public MyFetcherClient { height_(0), animation_counter_(0), print_settings_valid_(false), - showing_custom_cursor_(false) {} + showing_custom_cursor_(false) { + RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); + } virtual ~MyInstance() { if (fetcher_) { @@ -196,8 +198,8 @@ class MyInstance : public pp::InstancePrivate, public MyFetcherClient { return true; } - virtual bool HandleInputEvent(const PP_InputEvent& event) { - switch (event.type) { + virtual bool HandleInputEvent(const pp::InputEvent& event) { + switch (event.GetType()) { case PP_INPUTEVENT_TYPE_MOUSEDOWN: SayHello(); ToggleCursor(); |