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

Unified Diff: ash/wm/maximize_mode/internal_input_device_list_x11.cc

Issue 313913004: Block internal PlatformEvents before they are dispatched in touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix updating cursor on enter notify. 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/maximize_mode/internal_input_device_list_x11.cc
diff --git a/ash/wm/maximize_mode/internal_input_device_list_x11.cc b/ash/wm/maximize_mode/internal_input_device_list_x11.cc
deleted file mode 100644
index 93727ecf968f77b96dfa6f5b288f9d4e85875271..0000000000000000000000000000000000000000
--- a/ash/wm/maximize_mode/internal_input_device_list_x11.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 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 "ash/wm/maximize_mode/internal_input_device_list_x11.h"
-
-#include <X11/extensions/XInput2.h>
-#include <X11/Xlib.h>
-
-#include "base/strings/string_util.h"
-#include "ui/events/event.h"
-#include "ui/events/x/device_data_manager_x11.h"
-#include "ui/events/x/device_list_cache_x.h"
-#include "ui/gfx/x/x11_types.h"
-
-namespace ash {
-
-namespace {
-
-// The name of the xinput device corresponding to the internal touchpad.
-const char kInternalTouchpadName[] = "Elan Touchpad";
-
-// The name of the xinput device corresponding to the internal keyboard.
-const char kInternalKeyboardName[] = "AT Translated Set 2 keyboard";
-
-} // namespace
-
-InternalInputDeviceListX11::InternalInputDeviceListX11() {
- if (ui::DeviceDataManagerX11::GetInstance()->IsXInput2Available()) {
- XIDeviceList xi_dev_list = ui::DeviceListCacheX::GetInstance()->
- GetXI2DeviceList(gfx::GetXDisplay());
- for (int i = 0; i < xi_dev_list.count; ++i) {
- std::string device_name(xi_dev_list[i].name);
- base::TrimWhitespaceASCII(device_name, base::TRIM_TRAILING, &device_name);
- if (device_name == kInternalTouchpadName ||
- device_name == kInternalKeyboardName)
- internal_device_ids_.insert(xi_dev_list[i].deviceid);
- }
- }
-}
-
-InternalInputDeviceListX11::~InternalInputDeviceListX11() {
-}
-
-bool InternalInputDeviceListX11::IsEventFromInternalDevice(
- const ui::Event* event) {
- if (!event->HasNativeEvent() ||
- event->native_event()->type != GenericEvent) {
- return false;
- }
-
- XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(
- event->native_event()->xcookie.data);
- return internal_device_ids_.find(xiev->sourceid) !=
- internal_device_ids_.end();
-}
-
-} // namespace ash
« no previous file with comments | « ash/wm/maximize_mode/internal_input_device_list_x11.h ('k') | ash/wm/maximize_mode/maximize_mode_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698