summaryrefslogtreecommitdiffstats
path: root/ppapi/examples/file_chooser
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 16:03:38 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 16:03:38 +0000
commit61e3ef3a32dd7b5bd4c8c6b1b3a68ed081101a97 (patch)
treee3e36bb4af1681c01d613cd290e9f13e5308f3f3 /ppapi/examples/file_chooser
parent8d5f3ace1907853bd6e838d4f061c23a526b5384 (diff)
downloadchromium_src-61e3ef3a32dd7b5bd4c8c6b1b3a68ed081101a97.zip
chromium_src-61e3ef3a32dd7b5bd4c8c6b1b3a68ed081101a97.tar.gz
chromium_src-61e3ef3a32dd7b5bd4c8c6b1b3a68ed081101a97.tar.bz2
Remove HandleInputEvent from PPP_Instance and freeze to 1.0.
Note I'm leaving in temporary backwards-compatibility. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2035 TEST=ppapi tests Review URL: http://codereview.chromium.org/7452002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93202 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples/file_chooser')
-rw-r--r--ppapi/examples/file_chooser/file_chooser.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/ppapi/examples/file_chooser/file_chooser.cc b/ppapi/examples/file_chooser/file_chooser.cc
index 598095f..e1eb6bd 100644
--- a/ppapi/examples/file_chooser/file_chooser.cc
+++ b/ppapi/examples/file_chooser/file_chooser.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,7 @@
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/dev/file_chooser_dev.h"
#include "ppapi/cpp/file_ref.h"
+#include "ppapi/cpp/input_event.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/private/instance_private.h"
#include "ppapi/cpp/private/var_private.h"
@@ -16,15 +17,17 @@ class MyInstance : public pp::InstancePrivate {
MyInstance(PP_Instance instance)
: pp::InstancePrivate(instance) {
callback_factory_.Initialize(this);
+ RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
}
- 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: {
- const PP_InputEvent_Mouse& mouse_event = event.u.mouse;
- if (mouse_event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT)
+ pp::MouseInputEvent mouse_event(event);
+ if (mouse_event.GetMouseButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT)
ShowFileChooser(false);
- else if (mouse_event.button == PP_INPUTEVENT_MOUSEBUTTON_RIGHT)
+ else if (mouse_event.GetMouseButton()
+ == PP_INPUTEVENT_MOUSEBUTTON_RIGHT)
ShowFileChooser(true);
else
return false;