| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_USER_INPUT_MONITOR_H_ | 5 #ifndef MEDIA_BASE_USER_INPUT_MONITOR_H_ |
| 6 #define MEDIA_BASE_USER_INPUT_MONITOR_H_ | 6 #define MEDIA_BASE_USER_INPUT_MONITOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/observer_list_threadsafe.h" | 10 #include "base/observer_list_threadsafe.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 public: | 26 public: |
| 27 // The interface to receive mouse movement events. | 27 // The interface to receive mouse movement events. |
| 28 class MEDIA_EXPORT MouseEventListener { | 28 class MEDIA_EXPORT MouseEventListener { |
| 29 public: | 29 public: |
| 30 // |position| is the new mouse position. | 30 // |position| is the new mouse position. |
| 31 virtual void OnMouseMoved(const SkIPoint& position) = 0; | 31 virtual void OnMouseMoved(const SkIPoint& position) = 0; |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 virtual ~MouseEventListener() {} | 34 virtual ~MouseEventListener() {} |
| 35 }; | 35 }; |
| 36 typedef ObserverListThreadSafe<UserInputMonitor::MouseEventListener> | 36 typedef base::ObserverListThreadSafe<UserInputMonitor::MouseEventListener> |
| 37 MouseListenerList; | 37 MouseListenerList; |
| 38 | 38 |
| 39 UserInputMonitor(); | 39 UserInputMonitor(); |
| 40 virtual ~UserInputMonitor(); | 40 virtual ~UserInputMonitor(); |
| 41 | 41 |
| 42 // Creates a platform-specific instance of UserInputMonitor. | 42 // Creates a platform-specific instance of UserInputMonitor. |
| 43 // |io_task_runner| is the task runner for an IO thread. | 43 // |io_task_runner| is the task runner for an IO thread. |
| 44 // |ui_task_runner| is the task runner for a UI thread. | 44 // |ui_task_runner| is the task runner for a UI thread. |
| 45 static scoped_ptr<UserInputMonitor> Create( | 45 static scoped_ptr<UserInputMonitor> Create( |
| 46 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 46 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 size_t key_press_counter_references_; | 80 size_t key_press_counter_references_; |
| 81 size_t mouse_listeners_count_; | 81 size_t mouse_listeners_count_; |
| 82 scoped_refptr<MouseListenerList> mouse_listeners_; | 82 scoped_refptr<MouseListenerList> mouse_listeners_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(UserInputMonitor); | 84 DISALLOW_COPY_AND_ASSIGN(UserInputMonitor); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace media | 87 } // namespace media |
| 88 | 88 |
| 89 #endif // MEDIA_BASE_USER_INPUT_MONITOR_H_ | 89 #endif // MEDIA_BASE_USER_INPUT_MONITOR_H_ |
| OLD | NEW |