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

Side by Side Diff: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h

Issue 313913004: Block internal PlatformEvents before they are dispatched in touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Block events from disabled devices through DeviceDataManager. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_
6 #define ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_
7
8 #include <vector>
9
10 #include "ash/ash_export.h"
11 #include "base/macros.h"
12 #include "ui/events/platform/platform_event_observer.h"
13 #include "ui/gfx/point.h"
14
15 namespace ash {
16
17 class ScopedDisableInternalMouseAndKeyboard {
18 public:
19 virtual ~ScopedDisableInternalMouseAndKeyboard() {}
20 };
21
22 // Identifies which input devices are internal and provides a helper function to
23 // test if an input event came from an internal device.
24 class ScopedDisableInternalMouseAndKeyboardX11
25 : public ScopedDisableInternalMouseAndKeyboard,
26 public ui::PlatformEventObserver {
27 public:
28 ScopedDisableInternalMouseAndKeyboardX11();
29 virtual ~ScopedDisableInternalMouseAndKeyboardX11();
30
31 // ui::PlatformEventObserver:
32 virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
33 virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
34 private:
35 int touchpad_device_id_;
36 int keyboard_device_id_;
37
38 // Tracks the last known mouse cursor location caused before blocking the
39 // internal touchpad or caused by an external mouse.
40 gfx::Point last_mouse_location_;
41
42 DISALLOW_COPY_AND_ASSIGN(ScopedDisableInternalMouseAndKeyboardX11);
43 };
44
45 } // namespace ash
46
47 #endif // ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698