platformKeys: Add per-extension sign permissions.
[chromium-blink-merge.git] / ash / wm / maximize_mode / scoped_disable_internal_mouse_and_keyboard_x11.h
blob199f4d505c8a5496e93311308d40bc1f13ed5651
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.
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_
8 #include <vector>
10 #include "ash/ash_export.h"
11 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h"
12 #include "base/macros.h"
13 #include "ui/events/platform/platform_event_observer.h"
14 #include "ui/gfx/geometry/point.h"
16 namespace ash {
18 // Identifies which input devices are internal and provides a helper function to
19 // test if an input event came from an internal device.
20 class ScopedDisableInternalMouseAndKeyboardX11
21 : public ScopedDisableInternalMouseAndKeyboard,
22 public ui::PlatformEventObserver {
23 public:
24 ScopedDisableInternalMouseAndKeyboardX11();
25 ~ScopedDisableInternalMouseAndKeyboardX11() override;
27 // ui::PlatformEventObserver:
28 void WillProcessEvent(const ui::PlatformEvent& event) override;
29 void DidProcessEvent(const ui::PlatformEvent& event) override;
31 private:
32 int touchpad_device_id_;
33 int keyboard_device_id_;
34 int core_keyboard_device_id_;
36 // Tracks the last known mouse cursor location caused before blocking the
37 // internal touchpad or caused by an external mouse.
38 gfx::Point last_mouse_location_;
40 DISALLOW_COPY_AND_ASSIGN(ScopedDisableInternalMouseAndKeyboardX11);
43 } // namespace ash
45 #endif // ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_