| 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 #include "media/base/user_input_monitor.h" | 5 #include "media/base/user_input_monitor.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| 11 #ifdef DISABLE_USER_INPUT_MONITOR | 11 #ifdef DISABLE_USER_INPUT_MONITOR |
| 12 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( | 12 std::unique_ptr<UserInputMonitor> UserInputMonitor::Create( |
| 13 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 13 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| 14 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { | 14 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { |
| 15 return scoped_ptr<UserInputMonitor>(); | 15 return nullptr; |
| 16 } | 16 } |
| 17 #endif // DISABLE_USER_INPUT_MONITOR | 17 #endif // DISABLE_USER_INPUT_MONITOR |
| 18 | 18 |
| 19 UserInputMonitor::UserInputMonitor() | 19 UserInputMonitor::UserInputMonitor() |
| 20 : key_press_counter_references_(0), | 20 : key_press_counter_references_(0), |
| 21 mouse_listeners_count_(0), | 21 mouse_listeners_count_(0), |
| 22 mouse_listeners_(new MouseListenerList()) {} | 22 mouse_listeners_(new MouseListenerList()) {} |
| 23 | 23 |
| 24 UserInputMonitor::~UserInputMonitor() { | 24 UserInputMonitor::~UserInputMonitor() { |
| 25 DCHECK_EQ(0u, key_press_counter_references_); | 25 DCHECK_EQ(0u, key_press_counter_references_); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 base::AutoLock auto_lock(lock_); | 64 base::AutoLock auto_lock(lock_); |
| 65 DCHECK_NE(key_press_counter_references_, 0u); | 65 DCHECK_NE(key_press_counter_references_, 0u); |
| 66 --key_press_counter_references_; | 66 --key_press_counter_references_; |
| 67 if (key_press_counter_references_ == 0) { | 67 if (key_press_counter_references_ == 0) { |
| 68 StopKeyboardMonitoring(); | 68 StopKeyboardMonitoring(); |
| 69 DVLOG(2) << "Stopped keyboard monitoring."; | 69 DVLOG(2) << "Stopped keyboard monitoring."; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace media | 73 } // namespace media |
| OLD | NEW |