OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_MESSAGE_PUMP_DISPATCHER_H |
| 6 #define BASE_MESSAGE_PUMP_DISPATCHER_H |
| 7 #pragma once |
| 8 |
| 9 #include "base/base_export.h" |
| 10 #include "base/event_types.h" |
| 11 |
| 12 namespace base { |
| 13 |
| 14 // Dispatcher is used during a nested invocation of Run to dispatch |
| 15 // events when |MessageLoop::RunWithDispatcher| is invoked. If |
| 16 // |MessageLoop::Run| is invoked, MessageLoop does not dispatch events |
| 17 // (or invoke TranslateMessage), rather every message is passed to |
| 18 // Dispatcher's Dispatch method for dispatch. It is up to the |
| 19 // Dispatcher whether or not to dispatch the event. |
| 20 // |
| 21 // The nested loop is exited by either posting a quit, or returning false |
| 22 // from Dispatch. |
| 23 class BASE_EXPORT MessagePumpDispatcher { |
| 24 public: |
| 25 virtual ~MessagePumpDispatcher() {} |
| 26 |
| 27 // Dispatches the event. If true is returned processing continues as |
| 28 // normal. If false is returned, the nested loop exits immediately. |
| 29 virtual bool Dispatch(const NativeEvent& event) = 0; |
| 30 }; |
| 31 |
| 32 } // namespace base |
| 33 |
| 34 #endif // BASE_MESSAGE_PUMP_DISPATCHER_H |
OLD | NEW |