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

Unified Diff: base/message_loop.cc

Issue 159046: Implementing accelerators for Linux toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « base/message_loop.h ('k') | base/message_pump_glib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.cc
===================================================================
--- base/message_loop.cc (revision 22100)
+++ base/message_loop.cc (working copy)
@@ -188,9 +188,10 @@
StartHistogrammer();
-#if defined(OS_WIN)
- if (state_->dispatcher) {
- pump_win()->RunWithDispatcher(this, state_->dispatcher);
+#if defined(OS_WIN) || defined(OS_LINUX)
+ if (state_->dispatcher && type() == TYPE_UI) {
+ static_cast<base::MessagePumpForUI*>(pump_.get())->
+ RunWithDispatcher(this, state_->dispatcher);
return;
}
#endif
@@ -480,7 +481,7 @@
// Initialize the other fields:
quit_received = false;
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
dispatcher = NULL;
#endif
}
@@ -570,8 +571,20 @@
//------------------------------------------------------------------------------
// MessageLoopForUI
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if defined(OS_WIN)
+void MessageLoopForUI::WillProcessMessage(const MSG& message) {
+ pump_win()->WillProcessMessage(message);
+}
+void MessageLoopForUI::DidProcessMessage(const MSG& message) {
+ pump_win()->DidProcessMessage(message);
+}
+void MessageLoopForUI::PumpOutPendingPaintMessages() {
+ pump_ui()->PumpOutPendingPaintMessages();
+}
+#endif // defined(OS_WIN)
+
+#if defined(OS_LINUX) || defined(OS_WIN)
void MessageLoopForUI::AddObserver(Observer* observer) {
pump_ui()->AddObserver(observer);
}
@@ -580,28 +593,13 @@
pump_ui()->RemoveObserver(observer);
}
-#endif
-
-#if defined(OS_WIN)
-
void MessageLoopForUI::Run(Dispatcher* dispatcher) {
AutoRunState save_state(this);
state_->dispatcher = dispatcher;
RunHandler();
}
+#endif // defined(OS_LINUX) || defined(OS_WIN)
-void MessageLoopForUI::WillProcessMessage(const MSG& message) {
- pump_win()->WillProcessMessage(message);
-}
-void MessageLoopForUI::DidProcessMessage(const MSG& message) {
- pump_win()->DidProcessMessage(message);
-}
-void MessageLoopForUI::PumpOutPendingPaintMessages() {
- pump_ui()->PumpOutPendingPaintMessages();
-}
-
-#endif // defined(OS_WIN)
-
//------------------------------------------------------------------------------
// MessageLoopForIO
« no previous file with comments | « base/message_loop.h ('k') | base/message_pump_glib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698