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

Unified Diff: media/base/user_input_monitor_linux.cc

Issue 2577573002: Removes mouse listeners from UserInputMonitor. (Closed)
Patch Set: Created 4 years 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: media/base/user_input_monitor_linux.cc
diff --git a/media/base/user_input_monitor_linux.cc b/media/base/user_input_monitor_linux.cc
index 471deeacc4e7bcccb831bccfebf040f7997fc9a5..d4444c69bfbba0900f75c0a0817816ce6b51c44b 100644
--- a/media/base/user_input_monitor_linux.cc
+++ b/media/base/user_input_monitor_linux.cc
@@ -47,9 +47,7 @@ class UserInputMonitorLinuxCore
};
explicit UserInputMonitorLinuxCore(
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const scoped_refptr<UserInputMonitor::MouseListenerList>&
- mouse_listeners);
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
~UserInputMonitorLinuxCore() override;
// DestructionObserver overrides.
@@ -62,13 +60,11 @@ class UserInputMonitorLinuxCore
private:
void OnXEvent();
- // Processes key and mouse events.
+ // Processes key events.
void ProcessXEvent(xEvent* event);
static void ProcessReply(XPointer self, XRecordInterceptData* data);
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
- scoped_refptr<base::ObserverListThreadSafe<
- UserInputMonitor::MouseEventListener>> mouse_listeners_;
//
// The following members should only be accessed on the IO thread.
@@ -96,8 +92,6 @@ class UserInputMonitorLinux : public UserInputMonitor {
// Private UserInputMonitor overrides.
void StartKeyboardMonitoring() override;
void StopKeyboardMonitoring() override;
- void StartMouseMonitoring() override;
- void StopMouseMonitoring() override;
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
UserInputMonitorLinuxCore* core_;
@@ -106,10 +100,8 @@ class UserInputMonitorLinux : public UserInputMonitor {
};
UserInputMonitorLinuxCore::UserInputMonitorLinuxCore(
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const scoped_refptr<UserInputMonitor::MouseListenerList>& mouse_listeners)
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
: io_task_runner_(io_task_runner),
- mouse_listeners_(mouse_listeners),
x_control_display_(NULL),
x_record_display_(NULL),
x_record_context_(0) {
@@ -277,13 +269,7 @@ void UserInputMonitorLinuxCore::OnXEvent() {
void UserInputMonitorLinuxCore::ProcessXEvent(xEvent* event) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
- if (event->u.u.type == MotionNotify) {
- SkIPoint position(SkIPoint::Make(event->u.keyButtonPointer.rootX,
- event->u.keyButtonPointer.rootY));
- mouse_listeners_->Notify(
- FROM_HERE, &UserInputMonitor::MouseEventListener::OnMouseMoved,
- position);
- } else {
+ if (event->u.u.type != MotionNotify) {
Wez 2016/12/16 02:06:43 nit: Looks like you don't need this at all - just
CJ 2016/12/22 22:42:58 Done.
ui::EventType type;
if (event->u.u.type == KeyPress) {
type = ui::ET_KEY_PRESSED;
@@ -318,7 +304,7 @@ void UserInputMonitorLinuxCore::ProcessReply(XPointer self,
UserInputMonitorLinux::UserInputMonitorLinux(
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
: io_task_runner_(io_task_runner),
- core_(new UserInputMonitorLinuxCore(io_task_runner, mouse_listeners())) {}
+ core_(new UserInputMonitorLinuxCore(io_task_runner)) {}
UserInputMonitorLinux::~UserInputMonitorLinux() {
if (!io_task_runner_->DeleteSoon(FROM_HERE, core_))
@@ -345,20 +331,6 @@ void UserInputMonitorLinux::StopKeyboardMonitoring() {
UserInputMonitorLinuxCore::KEYBOARD_EVENT));
}
-void UserInputMonitorLinux::StartMouseMonitoring() {
- io_task_runner_->PostTask(FROM_HERE,
- base::Bind(&UserInputMonitorLinuxCore::StartMonitor,
- core_->AsWeakPtr(),
- UserInputMonitorLinuxCore::MOUSE_EVENT));
-}
-
-void UserInputMonitorLinux::StopMouseMonitoring() {
- io_task_runner_->PostTask(FROM_HERE,
- base::Bind(&UserInputMonitorLinuxCore::StopMonitor,
- core_->AsWeakPtr(),
- UserInputMonitorLinuxCore::MOUSE_EVENT));
-}
-
} // namespace
std::unique_ptr<UserInputMonitor> UserInputMonitor::Create(

Powered by Google App Engine
This is Rietveld 408576698