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

Side by Side Diff: content/browser/browser_main_loop.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, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "content/public/browser/browser_shutdown.h" 43 #include "content/public/browser/browser_shutdown.h"
44 #include "content/public/browser/compositor_util.h" 44 #include "content/public/browser/compositor_util.h"
45 #include "content/public/browser/content_browser_client.h" 45 #include "content/public/browser/content_browser_client.h"
46 #include "content/public/browser/render_process_host.h" 46 #include "content/public/browser/render_process_host.h"
47 #include "content/public/common/content_switches.h" 47 #include "content/public/common/content_switches.h"
48 #include "content/public/common/main_function_params.h" 48 #include "content/public/common/main_function_params.h"
49 #include "content/public/common/result_codes.h" 49 #include "content/public/common/result_codes.h"
50 #include "crypto/nss_util.h" 50 #include "crypto/nss_util.h"
51 #include "media/audio/audio_manager.h" 51 #include "media/audio/audio_manager.h"
52 #include "media/base/media.h" 52 #include "media/base/media.h"
53 #include "media/base/user_input_monitor.h"
53 #include "media/midi/midi_manager.h" 54 #include "media/midi/midi_manager.h"
54 #include "net/base/network_change_notifier.h" 55 #include "net/base/network_change_notifier.h"
55 #include "net/socket/client_socket_factory.h" 56 #include "net/socket/client_socket_factory.h"
56 #include "net/ssl/ssl_config_service.h" 57 #include "net/ssl/ssl_config_service.h"
57 #include "ui/base/clipboard/clipboard.h" 58 #include "ui/base/clipboard/clipboard.h"
58 59
59 #if defined(USE_AURA) 60 #if defined(USE_AURA)
60 #include "content/browser/aura/image_transport_factory.h" 61 #include "content/browser/aura/image_transport_factory.h"
61 #endif 62 #endif
62 63
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 // otherwise we'll trigger the assertion about doing IO on the UI thread. 858 // otherwise we'll trigger the assertion about doing IO on the UI thread.
858 GpuDataManagerImpl::GetInstance()->Initialize(); 859 GpuDataManagerImpl::GetInstance()->Initialize();
859 860
860 { 861 {
861 TRACE_EVENT0("startup", 862 TRACE_EVENT0("startup",
862 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); 863 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition");
863 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl( 864 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl(
864 audio_manager_.get(), media_stream_manager_.get())); 865 audio_manager_.get(), media_stream_manager_.get()));
865 } 866 }
866 867
868 {
869 TRACE_EVENT0(
870 "startup",
871 "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor");
872 user_input_monitor_ = media::UserInputMonitor::Create(
873 io_thread_->message_loop_proxy(), main_thread_->message_loop_proxy());
874 }
875
867 // Alert the clipboard class to which threads are allowed to access the 876 // Alert the clipboard class to which threads are allowed to access the
868 // clipboard: 877 // clipboard:
869 std::vector<base::PlatformThreadId> allowed_clipboard_threads; 878 std::vector<base::PlatformThreadId> allowed_clipboard_threads;
870 // The current thread is the UI thread. 879 // The current thread is the UI thread.
871 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); 880 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId());
872 #if defined(OS_WIN) 881 #if defined(OS_WIN)
873 // On Windows, clipboards are also used on the File or IO threads. 882 // On Windows, clipboards are also used on the File or IO threads.
874 allowed_clipboard_threads.push_back(file_thread_->thread_id()); 883 allowed_clipboard_threads.push_back(file_thread_->thread_id());
875 allowed_clipboard_threads.push_back(io_thread_->thread_id()); 884 allowed_clipboard_threads.push_back(io_thread_->thread_id());
876 #endif 885 #endif
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 if (parameters_.ui_task) 960 if (parameters_.ui_task)
952 base::MessageLoopForUI::current()->PostTask(FROM_HERE, 961 base::MessageLoopForUI::current()->PostTask(FROM_HERE,
953 *parameters_.ui_task); 962 *parameters_.ui_task);
954 963
955 base::RunLoop run_loop; 964 base::RunLoop run_loop;
956 run_loop.Run(); 965 run_loop.Run();
957 #endif 966 #endif
958 } 967 }
959 968
960 } // namespace content 969 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698