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

Unified Diff: media/base/user_input_monitor.h

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/keyboard_event_counter_unittest.cc ('k') | media/base/user_input_monitor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/user_input_monitor.h
diff --git a/media/base/user_input_monitor.h b/media/base/user_input_monitor.h
index 4a8777dc6c336240917a735a770c80129284159c..4c27021d37ae4a28a9dc3de8529d5fe7526a4dbe 100644
--- a/media/base/user_input_monitor.h
+++ b/media/base/user_input_monitor.h
@@ -11,35 +11,19 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/observer_list_threadsafe.h"
#include "base/synchronization/lock.h"
#include "media/base/media_export.h"
-struct SkIPoint;
-
namespace base {
class SingleThreadTaskRunner;
} // namespace base
namespace media {
-// Monitors and notifies about mouse movements and keyboard events.
-// Thread safe. The listeners are called on the thread where the listeners are
-// added.
+// Monitors and notifies about keyboard events.
+// Thread safe.
class MEDIA_EXPORT UserInputMonitor {
public:
- // The interface to receive mouse movement events.
- class MEDIA_EXPORT MouseEventListener {
- public:
- // |position| is the new mouse position.
- virtual void OnMouseMoved(const SkIPoint& position) = 0;
-
- protected:
- virtual ~MouseEventListener() {}
- };
- typedef base::ObserverListThreadSafe<UserInputMonitor::MouseEventListener>
- MouseListenerList;
-
UserInputMonitor();
virtual ~UserInputMonitor();
@@ -50,12 +34,6 @@ class MEDIA_EXPORT UserInputMonitor {
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner);
- // The same |listener| should only be added once.
- // The clients should make sure to call Remove*Listener before |listener| is
- // destroyed.
- void AddMouseListener(MouseEventListener* listener);
- void RemoveMouseListener(MouseEventListener* listener);
-
// A caller must call EnableKeyPressMonitoring and
// DisableKeyPressMonitoring in pair.
void EnableKeyPressMonitoring();
@@ -69,21 +47,12 @@ class MEDIA_EXPORT UserInputMonitor {
// any assumption on the initial value.
virtual size_t GetKeyPressCount() const = 0;
- protected:
- scoped_refptr<MouseListenerList> mouse_listeners() {
- return mouse_listeners_;
- }
-
private:
virtual void StartKeyboardMonitoring() = 0;
virtual void StopKeyboardMonitoring() = 0;
- virtual void StartMouseMonitoring() = 0;
- virtual void StopMouseMonitoring() = 0;
base::Lock lock_;
size_t key_press_counter_references_;
- size_t mouse_listeners_count_;
- scoped_refptr<MouseListenerList> mouse_listeners_;
DISALLOW_COPY_AND_ASSIGN(UserInputMonitor);
};
« no previous file with comments | « media/base/keyboard_event_counter_unittest.cc ('k') | media/base/user_input_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698