| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void AddObserver(Observer* observer); | 81 void AddObserver(Observer* observer); |
| 82 | 82 |
| 83 // Removes an Observer. It is safe to call this method while an Observer is | 83 // Removes an Observer. It is safe to call this method while an Observer is |
| 84 // receiving a notification callback. | 84 // receiving a notification callback. |
| 85 void RemoveObserver(Observer* observer); | 85 void RemoveObserver(Observer* observer); |
| 86 | 86 |
| 87 // Dispatch an available GdkEvent. Essentially this allows a subclass to do | 87 // Dispatch an available GdkEvent. Essentially this allows a subclass to do |
| 88 // some task before/after calling the default handler (EventDispatcher). | 88 // some task before/after calling the default handler (EventDispatcher). |
| 89 virtual void DispatchEvents(GdkEvent* event); | 89 virtual void DispatchEvents(GdkEvent* event); |
| 90 | 90 |
| 91 protected: |
| 92 // Returns the dispatcher for the current run state (|state_->dispatcher|). |
| 93 Dispatcher* GetDispatcher(); |
| 94 |
| 91 private: | 95 private: |
| 92 // We may make recursive calls to Run, so we save state that needs to be | 96 // We may make recursive calls to Run, so we save state that needs to be |
| 93 // separate between them in this structure type. | 97 // separate between them in this structure type. |
| 94 struct RunState; | 98 struct RunState; |
| 95 | 99 |
| 96 // Invoked from EventDispatcher. Notifies all observers we're about to | 100 // Invoked from EventDispatcher. Notifies all observers we're about to |
| 97 // process an event. | 101 // process an event. |
| 98 void WillProcessEvent(GdkEvent* event); | 102 void WillProcessEvent(GdkEvent* event); |
| 99 | 103 |
| 100 // Invoked from EventDispatcher. Notifies all observers we processed an | 104 // Invoked from EventDispatcher. Notifies all observers we processed an |
| (...skipping 28 matching lines...) Expand all Loading... |
| 129 | 133 |
| 130 // List of observers. | 134 // List of observers. |
| 131 ObserverList<Observer> observers_; | 135 ObserverList<Observer> observers_; |
| 132 | 136 |
| 133 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); | 137 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); |
| 134 }; | 138 }; |
| 135 | 139 |
| 136 } // namespace base | 140 } // namespace base |
| 137 | 141 |
| 138 #endif // BASE_MESSAGE_PUMP_GLIB_H_ | 142 #endif // BASE_MESSAGE_PUMP_GLIB_H_ |
| OLD | NEW |