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

Unified Diff: ppapi/shared_impl/instance_impl.cc

Issue 7285010: Implement an input event resource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
Index: ppapi/shared_impl/instance_impl.cc
===================================================================
--- ppapi/shared_impl/instance_impl.cc (revision 0)
+++ ppapi/shared_impl/instance_impl.cc (revision 0)
@@ -0,0 +1,32 @@
+// 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.
+
+#include "ppapi/shared_impl/instance_impl.h"
+
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/ppb_input_event.h"
+
+namespace ppapi {
+
+InstanceImpl::~InstanceImpl() {
+}
+
+int32_t InstanceImpl::ValidateRequestInputEvents(bool is_filtering,
+ uint32_t event_classes) {
+ // See if any bits are set we don't know about.
+ if (event_classes &
+ ~int32_t(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_KEYBOARD |
dmichael (off chromium) 2011/07/01 20:04:19 uint32_t, static_cast instead of C-style cast
brettw 2011/07/01 21:14:52 I changed it since it isn't normal for us to do th
+ PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_TOUCH |
+ PP_INPUTEVENT_CLASS_IME))
+ return PP_ERROR_NOTSUPPORTED;
+
+ // See if the keyboard is requested in non-filtering mode.
+ if (!is_filtering && (event_classes & PP_INPUTEVENT_CLASS_KEYBOARD))
+ return PP_ERROR_NOTSUPPORTED;
+
+ // Everything else is valid.
+ return PP_OK;
+}
+
+} // namespace ppapi
Property changes on: ppapi/shared_impl/instance_impl.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698