summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_main_loop.cc
diff options
context:
space:
mode:
authorjiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-15 07:41:01 +0000
committerjiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-15 07:41:01 +0000
commit781a1daa27f00ccb0749535b037d363618c781cf (patch)
tree9ec40fc06d0f711183ebf9b55d1f3586e97ea797 /content/browser/browser_main_loop.cc
parent84d07c149f8a67a6af8be270d78e9d25718d444c (diff)
downloadchromium_src-781a1daa27f00ccb0749535b037d363618c781cf.zip
chromium_src-781a1daa27f00ccb0749535b037d363618c781cf.tar.gz
chromium_src-781a1daa27f00ccb0749535b037d363618c781cf.tar.bz2
Adding key press detection in the browser process.
It works like this on the browser side: A new object KeyPressMonitor is created on BrowserMainLoop and passed to AudioInputRendererHost to pass to AudioInputController. AudioInputController::DoRecord calls KeyPressMonitor::AddKeyPressListener --> KeyPressMonitor listens to system key events through UserInputMonitor(only implemented on Linux) --> AudioInputController::OnKeyPressed is called and sets key_pressed_ --> When AudioInputController::OnData called, it writes key_pressed_ to shared memory along with the audio data buffer. On the renderer side a new param "key_pressed" is added through the code path of passing the flag to the webrtc voice engine. This CL includes all these changes except the implementation of UserInputMonitor for Windows and Mac. The impl of UserInputMonitor is mostly copied from remoting/host/local_input_monitor_linux.cc BUG= Review URL: https://chromiumcodereview.appspot.com/21183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217768 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_main_loop.cc')
-rw-r--r--content/browser/browser_main_loop.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index c51b5c5..4194aa8 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -52,6 +52,7 @@
#include "crypto/nss_util.h"
#include "media/audio/audio_manager.h"
#include "media/base/media.h"
+#include "media/base/user_input_monitor.h"
#include "media/midi/midi_manager.h"
#include "net/base/network_change_notifier.h"
#include "net/socket/client_socket_factory.h"
@@ -872,6 +873,14 @@ int BrowserMainLoop::BrowserThreadsStarted() {
audio_manager_.get(), media_stream_manager_.get()));
}
+ {
+ TRACE_EVENT0(
+ "startup",
+ "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor");
+ user_input_monitor_ = media::UserInputMonitor::Create(
+ io_thread_->message_loop_proxy(), main_thread_->message_loop_proxy());
+ }
+
// Alert the clipboard class to which threads are allowed to access the
// clipboard:
std::vector<base::PlatformThreadId> allowed_clipboard_threads;