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

Unified Diff: media/base/user_input_monitor.cc

Issue 2577573002: Removes mouse listeners from UserInputMonitor. (Closed)
Patch Set: Fix win by removing std::move. Created 3 years, 11 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
« no previous file with comments | « media/base/user_input_monitor.h ('k') | media/base/user_input_monitor_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/user_input_monitor.cc
diff --git a/media/base/user_input_monitor.cc b/media/base/user_input_monitor.cc
index 60ab0b675cb9cbf4513e1f2ccaf3c9a33d0c250c..40ae87ed94b7b768721ba88893c26ad5929fd38e 100644
--- a/media/base/user_input_monitor.cc
+++ b/media/base/user_input_monitor.cc
@@ -16,39 +16,10 @@ std::unique_ptr<UserInputMonitor> UserInputMonitor::Create(
}
#endif // DISABLE_USER_INPUT_MONITOR
-UserInputMonitor::UserInputMonitor()
- : key_press_counter_references_(0),
- mouse_listeners_count_(0),
- mouse_listeners_(new MouseListenerList()) {}
+UserInputMonitor::UserInputMonitor() : key_press_counter_references_(0) {}
UserInputMonitor::~UserInputMonitor() {
DCHECK_EQ(0u, key_press_counter_references_);
- mouse_listeners_->AssertEmpty();
-}
-
-void UserInputMonitor::AddMouseListener(MouseEventListener* listener) {
- mouse_listeners_->AddObserver(listener);
- {
- base::AutoLock auto_lock(lock_);
- mouse_listeners_count_++;
- if (mouse_listeners_count_ == 1) {
- StartMouseMonitoring();
- DVLOG(2) << "Started mouse monitoring.";
- }
- }
-}
-
-void UserInputMonitor::RemoveMouseListener(MouseEventListener* listener) {
- mouse_listeners_->RemoveObserver(listener);
- {
- base::AutoLock auto_lock(lock_);
- DCHECK_NE(mouse_listeners_count_, 0u);
- mouse_listeners_count_--;
- if (mouse_listeners_count_ == 0) {
- StopMouseMonitoring();
- DVLOG(2) << "Stopped mouse monitoring.";
- }
- }
}
void UserInputMonitor::EnableKeyPressMonitoring() {
« no previous file with comments | « media/base/user_input_monitor.h ('k') | media/base/user_input_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698