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

Unified Diff: ppapi/examples/file_chooser/file_chooser.cc

Issue 7466002: Reland http://codereview.chromium.org/7452002/, update chromoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright 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/paint_manager_example.cc ('k') | ppapi/proxy/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/examples/file_chooser/file_chooser.cc
diff --git a/ppapi/examples/file_chooser/file_chooser.cc b/ppapi/examples/file_chooser/file_chooser.cc
index 598095fdf5361610d31c1f0448f9ced43822d660..e1eb6bdfe298cfe341ec21f88ecc9a2b9027fe65 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;
« no previous file with comments | « ppapi/examples/2d/paint_manager_example.cc ('k') | ppapi/proxy/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698