Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: ppapi/examples/2d/paint_manager_example.cc

Issue 7471006: Revert 93223 - Reland http://codereview.chromium.org/7452002/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/examples/2d/graphics_2d_example.c ('k') | ppapi/examples/file_chooser/file_chooser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/examples/2d/paint_manager_example.cc
===================================================================
--- ppapi/examples/2d/paint_manager_example.cc (revision 93228)
+++ ppapi/examples/2d/paint_manager_example.cc (working copy)
@@ -5,7 +5,6 @@
#include "ppapi/c/pp_input_event.h"
#include "ppapi/cpp/graphics_2d.h"
#include "ppapi/cpp/image_data.h"
-#include "ppapi/cpp/input_event.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/paint_manager.h"
@@ -42,26 +41,25 @@
last_x_(0),
last_y_(0) {
paint_manager_.Initialize(this, this, false);
- RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
}
- virtual bool HandleInputEvent(const pp::InputEvent& event) {
- switch (event.GetType()) {
+ virtual bool HandleInputEvent(const PP_InputEvent& event) {
+ switch (event.type) {
case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
- pp::MouseInputEvent mouse_event(event);
+ const PP_InputEvent_Mouse& mouse_event = event.u.mouse;
// Update the square on a mouse down.
- if (mouse_event.GetMouseButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
- UpdateSquare(static_cast<int>(mouse_event.GetMousePosition().x()),
- static_cast<int>(mouse_event.GetMousePosition().y()));
+ if (mouse_event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
+ UpdateSquare(static_cast<int>(mouse_event.x),
+ static_cast<int>(mouse_event.y));
}
return true;
}
case PP_INPUTEVENT_TYPE_MOUSEMOVE: {
- pp::MouseInputEvent mouse_event(event);
+ const PP_InputEvent_Mouse& mouse_event = event.u.mouse;
// Update the square on a drag.
- if (mouse_event.GetMouseButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
- UpdateSquare(static_cast<int>(mouse_event.GetMousePosition().x()),
- static_cast<int>(mouse_event.GetMousePosition().y()));
+ if (mouse_event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
+ UpdateSquare(static_cast<int>(mouse_event.x),
+ static_cast<int>(mouse_event.y));
}
return true;
}
« no previous file with comments | « ppapi/examples/2d/graphics_2d_example.c ('k') | ppapi/examples/file_chooser/file_chooser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698