OLD | NEW |
---|---|
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 #ifndef BASE_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
563 // On Android, the UI message loop is handled by Java side. So Run() should | 563 // On Android, the UI message loop is handled by Java side. So Run() should |
564 // never be called. Instead use Start(), which will forward all the native UI | 564 // never be called. Instead use Start(), which will forward all the native UI |
565 // events to the Java message loop. | 565 // events to the Java message loop. |
566 void Start(); | 566 void Start(); |
567 #elif !defined(OS_MACOSX) | 567 #elif !defined(OS_MACOSX) |
568 // Please see message_pump_win/message_pump_glib for definitions of these | 568 // Please see message_pump_win/message_pump_glib for definitions of these |
569 // methods. | 569 // methods. |
570 void AddObserver(Observer* observer); | 570 void AddObserver(Observer* observer); |
571 void RemoveObserver(Observer* observer); | 571 void RemoveObserver(Observer* observer); |
572 | 572 |
573 #if defined(OS_WIN) | |
574 // Sets a new MessageFilter which does peek/translate/dispatch message to | |
575 // MessagePumpForUI. MessagePumpForUI takes ownership of |message_filter|. | |
576 void SetMessageFilter(base::MessagePumpForUI::MessageFilter* message_filter) { | |
rvargas (doing something else)
2012/08/31 21:39:49
nit: Please add a typedef for MessageFilter so tha
yoichio
2012/09/03 04:45:08
Done.
| |
577 pump_ui()->SetMessageFilter(message_filter); | |
578 } | |
579 #endif | |
580 | |
573 protected: | 581 protected: |
574 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) | 582 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) |
575 friend class base::MessagePumpAuraX11; | 583 friend class base::MessagePumpAuraX11; |
576 #endif | 584 #endif |
577 | 585 |
578 // TODO(rvargas): Make this platform independent. | 586 // TODO(rvargas): Make this platform independent. |
579 base::MessagePumpForUI* pump_ui() { | 587 base::MessagePumpForUI* pump_ui() { |
580 return static_cast<base::MessagePumpForUI*>(pump_.get()); | 588 return static_cast<base::MessagePumpForUI*>(pump_.get()); |
581 } | 589 } |
582 #endif // !defined(OS_MACOSX) | 590 #endif // !defined(OS_MACOSX) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
660 #endif // defined(OS_POSIX) | 668 #endif // defined(OS_POSIX) |
661 }; | 669 }; |
662 | 670 |
663 // Do not add any member variables to MessageLoopForIO! This is important b/c | 671 // Do not add any member variables to MessageLoopForIO! This is important b/c |
664 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 672 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
665 // data that you need should be stored on the MessageLoop's pump_ instance. | 673 // data that you need should be stored on the MessageLoop's pump_ instance. |
666 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 674 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
667 MessageLoopForIO_should_not_have_extra_member_variables); | 675 MessageLoopForIO_should_not_have_extra_member_variables); |
668 | 676 |
669 #endif // BASE_MESSAGE_LOOP_H_ | 677 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |