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

Unified Diff: media/audio/key_press_monitor.cc

Issue 21183002: Adding key press detection in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
Index: media/audio/key_press_monitor.cc
diff --git a/media/audio/key_press_monitor.cc b/media/audio/key_press_monitor.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2a84aa2d48046cf042b755b85a44a9e9c9d21fab
--- /dev/null
+++ b/media/audio/key_press_monitor.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/audio/key_press_monitor.h"
+
+#include "base/message_loop/message_loop_proxy.h"
+
+namespace media {
+
+KeyPressMonitor::KeyPressMonitor(base::MessageLoopProxy* message_loop)
DaleCurtis 2013/08/02 21:04:47 const scoped_refptr<base::MessageLoopProxy>&
jiayl 2013/08/02 21:45:45 Done.
+ : message_loop_(message_loop) {}
+
+KeyPressMonitor::~KeyPressMonitor() {}
+
+void KeyPressMonitor::AddKeyPressListener(KeyPressListener* listener) {
+ DCHECK(message_loop_->BelongsToCurrentThread());
+ listeners_.AddObserver(listener);
+}
+
+void KeyPressMonitor::RemoveKeyPressListener(KeyPressListener* listener) {
+ DCHECK(message_loop_->BelongsToCurrentThread());
+ listeners_.RemoveObserver(listener);
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698