| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 #ifndef BASE_MESSAGE_PUMP_GLIB_H_ | 5 #ifndef BASE_MESSAGE_PUMP_GLIB_H_ |
| 6 #define BASE_MESSAGE_PUMP_GLIB_H_ | 6 #define BASE_MESSAGE_PUMP_GLIB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/message_pump.h" | 9 #include "base/message_pump.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 virtual ~MessagePumpForUI(); | 55 virtual ~MessagePumpForUI(); |
| 56 | 56 |
| 57 // Like MessagePump::Run, but GdkEvent objects are routed through dispatcher. | 57 // Like MessagePump::Run, but GdkEvent objects are routed through dispatcher. |
| 58 virtual void RunWithDispatcher(Delegate* delegate, Dispatcher* dispatcher); | 58 virtual void RunWithDispatcher(Delegate* delegate, Dispatcher* dispatcher); |
| 59 | 59 |
| 60 // Run a single iteration of the mainloop. A return value of true indicates | 60 // Run a single iteration of the mainloop. A return value of true indicates |
| 61 // that an event was handled. |block| indicates if it should wait if no event | 61 // that an event was handled. |block| indicates if it should wait if no event |
| 62 // is ready for processing. | 62 // is ready for processing. |
| 63 virtual bool RunOnce(GMainContext* context, bool block); | 63 virtual bool RunOnce(GMainContext* context, bool block); |
| 64 | 64 |
| 65 virtual void Run(Delegate* delegate) { RunWithDispatcher(delegate, NULL); } | 65 virtual void Run(Delegate* delegate); |
| 66 virtual void Quit(); | 66 virtual void Quit(); |
| 67 virtual void ScheduleWork(); | 67 virtual void ScheduleWork(); |
| 68 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time); | 68 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time); |
| 69 | 69 |
| 70 // Internal methods used for processing the pump callbacks. They are | 70 // Internal methods used for processing the pump callbacks. They are |
| 71 // public for simplicity but should not be used directly. HandlePrepare | 71 // public for simplicity but should not be used directly. HandlePrepare |
| 72 // is called during the prepare step of glib, and returns a timeout that | 72 // is called during the prepare step of glib, and returns a timeout that |
| 73 // will be passed to the poll. HandleCheck is called after the poll | 73 // will be passed to the poll. HandleCheck is called after the poll |
| 74 // has completed, and returns whether or not HandleDispatch should be called. | 74 // has completed, and returns whether or not HandleDispatch should be called. |
| 75 // HandleDispatch is called if HandleCheck returned true. | 75 // HandleDispatch is called if HandleCheck returned true. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 // List of observers. | 134 // List of observers. |
| 135 ObserverList<Observer> observers_; | 135 ObserverList<Observer> observers_; |
| 136 | 136 |
| 137 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); | 137 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace base | 140 } // namespace base |
| 141 | 141 |
| 142 #endif // BASE_MESSAGE_PUMP_GLIB_H_ | 142 #endif // BASE_MESSAGE_PUMP_GLIB_H_ |
| OLD | NEW |