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

Side by Side Diff: media/base/user_input_monitor_mac.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 unified diff | Download patch
« no previous file with comments | « media/base/user_input_monitor_linux.cc ('k') | media/base/user_input_monitor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 12
13 namespace media { 13 namespace media {
14 namespace { 14 namespace {
15 15
16 class UserInputMonitorMac : public UserInputMonitor { 16 class UserInputMonitorMac : public UserInputMonitor {
17 public: 17 public:
18 UserInputMonitorMac(); 18 UserInputMonitorMac();
19 ~UserInputMonitorMac() override; 19 ~UserInputMonitorMac() override;
20 20
21 size_t GetKeyPressCount() const override; 21 size_t GetKeyPressCount() const override;
22 22
23 private: 23 private:
24 void StartKeyboardMonitoring() override; 24 void StartKeyboardMonitoring() override;
25 void StopKeyboardMonitoring() override; 25 void StopKeyboardMonitoring() override;
26 void StartMouseMonitoring() override;
27 void StopMouseMonitoring() override;
28 26
29 DISALLOW_COPY_AND_ASSIGN(UserInputMonitorMac); 27 DISALLOW_COPY_AND_ASSIGN(UserInputMonitorMac);
30 }; 28 };
31 29
32 UserInputMonitorMac::UserInputMonitorMac() {} 30 UserInputMonitorMac::UserInputMonitorMac() {}
33 31
34 UserInputMonitorMac::~UserInputMonitorMac() {} 32 UserInputMonitorMac::~UserInputMonitorMac() {}
35 33
36 size_t UserInputMonitorMac::GetKeyPressCount() const { 34 size_t UserInputMonitorMac::GetKeyPressCount() const {
37 // Use |kCGEventSourceStateHIDSystemState| since we only want to count 35 // Use |kCGEventSourceStateHIDSystemState| since we only want to count
38 // hardware generated events. 36 // hardware generated events.
39 return CGEventSourceCounterForEventType(kCGEventSourceStateHIDSystemState, 37 return CGEventSourceCounterForEventType(kCGEventSourceStateHIDSystemState,
40 kCGEventKeyDown); 38 kCGEventKeyDown);
41 } 39 }
42 40
43 void UserInputMonitorMac::StartKeyboardMonitoring() {} 41 void UserInputMonitorMac::StartKeyboardMonitoring() {}
44 42
45 void UserInputMonitorMac::StopKeyboardMonitoring() {} 43 void UserInputMonitorMac::StopKeyboardMonitoring() {}
46 44
47 // TODO(jiayl): add the impl.
48 void UserInputMonitorMac::StartMouseMonitoring() { NOTIMPLEMENTED(); }
49
50 // TODO(jiayl): add the impl.
51 void UserInputMonitorMac::StopMouseMonitoring() { NOTIMPLEMENTED(); }
52
53 } // namespace 45 } // namespace
54 46
55 std::unique_ptr<UserInputMonitor> UserInputMonitor::Create( 47 std::unique_ptr<UserInputMonitor> UserInputMonitor::Create(
56 const scoped_refptr<base::SingleThreadTaskRunner>& input_task_runner, 48 const scoped_refptr<base::SingleThreadTaskRunner>& input_task_runner,
57 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { 49 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) {
58 return base::WrapUnique(new UserInputMonitorMac); 50 return base::MakeUnique<UserInputMonitorMac>();
59 } 51 }
60 52
61 } // namespace media 53 } // namespace media
OLDNEW
« no previous file with comments | « media/base/user_input_monitor_linux.cc ('k') | media/base/user_input_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698