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

Unified Diff: ui/events/device_util_linux.cc

Issue 685793002: Move all event related devices from ui/events/ to ui/events/devices/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@internal-touchscreens
Patch Set: fix ozone Created 6 years, 1 month 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 | « ui/events/device_util_linux.h ('k') | ui/events/devices/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/device_util_linux.cc
diff --git a/ui/events/device_util_linux.cc b/ui/events/device_util_linux.cc
deleted file mode 100644
index b00158f66d1fe8fde2d97186f99f6f1d92c131f6..0000000000000000000000000000000000000000
--- a/ui/events/device_util_linux.cc
+++ /dev/null
@@ -1,46 +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 "ui/events/device_util_linux.h"
-
-#include <string>
-
-#include "base/files/file_enumerator.h"
-#include "base/files/file_path.h"
-#include "base/strings/string_util.h"
-
-namespace ui {
-
-bool IsTouchscreenInternal(const base::FilePath& path) {
- std::string event_node = path.BaseName().value();
- if (event_node.empty() || !StartsWithASCII(event_node, "event", false))
- return false;
-
- // Extract id "XXX" from "eventXXX"
- std::string event_node_id = event_node.substr(5);
-
- // I2C input device registers its dev input node at
- // /sys/bus/i2c/devices/*/input/inputXXX/eventXXX
- base::FileEnumerator i2c_enum(
- base::FilePath(FILE_PATH_LITERAL("/sys/bus/i2c/devices/")),
- false,
- base::FileEnumerator::DIRECTORIES);
- for (base::FilePath i2c_name = i2c_enum.Next(); !i2c_name.empty();
- i2c_name = i2c_enum.Next()) {
- base::FileEnumerator input_enum(
- i2c_name.Append(FILE_PATH_LITERAL("input")),
- false,
- base::FileEnumerator::DIRECTORIES,
- FILE_PATH_LITERAL("input*"));
- for (base::FilePath input = input_enum.Next(); !input.empty();
- input = input_enum.Next()) {
- if (input.BaseName().value().substr(5) == event_node_id)
- return true;
- }
- }
-
- return false;
-}
-
-} // namespace
« no previous file with comments | « ui/events/device_util_linux.h ('k') | ui/events/devices/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698