| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 8 #include <gdk/gdkx.h> |
| 9 #endif |
| 10 |
| 7 #include <algorithm> | 11 #include <algorithm> |
| 8 | 12 |
| 9 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 10 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 11 #include "base/logging.h" | 15 #include "base/logging.h" |
| 12 #include "base/message_pump_default.h" | 16 #include "base/message_pump_default.h" |
| 13 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 14 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 18 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 15 #include "base/threading/thread_local.h" | 19 #include "base/threading/thread_local.h" |
| 16 | 20 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 | 661 |
| 658 //------------------------------------------------------------------------------ | 662 //------------------------------------------------------------------------------ |
| 659 // MessageLoopForUI | 663 // MessageLoopForUI |
| 660 | 664 |
| 661 #if defined(OS_WIN) | 665 #if defined(OS_WIN) |
| 662 void MessageLoopForUI::DidProcessMessage(const MSG& message) { | 666 void MessageLoopForUI::DidProcessMessage(const MSG& message) { |
| 663 pump_win()->DidProcessMessage(message); | 667 pump_win()->DidProcessMessage(message); |
| 664 } | 668 } |
| 665 #endif // defined(OS_WIN) | 669 #endif // defined(OS_WIN) |
| 666 | 670 |
| 671 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 672 Display* MessageLoopForUI::get_display() |
| 673 { |
| 674 return GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); |
| 675 } |
| 676 #endif |
| 677 |
| 667 #if !defined(OS_MACOSX) && !defined(OS_NACL) | 678 #if !defined(OS_MACOSX) && !defined(OS_NACL) |
| 668 void MessageLoopForUI::AddObserver(Observer* observer) { | 679 void MessageLoopForUI::AddObserver(Observer* observer) { |
| 669 pump_ui()->AddObserver(observer); | 680 pump_ui()->AddObserver(observer); |
| 670 } | 681 } |
| 671 | 682 |
| 672 void MessageLoopForUI::RemoveObserver(Observer* observer) { | 683 void MessageLoopForUI::RemoveObserver(Observer* observer) { |
| 673 pump_ui()->RemoveObserver(observer); | 684 pump_ui()->RemoveObserver(observer); |
| 674 } | 685 } |
| 675 | 686 |
| 676 void MessageLoopForUI::Run(Dispatcher* dispatcher) { | 687 void MessageLoopForUI::Run(Dispatcher* dispatcher) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 702 Watcher *delegate) { | 713 Watcher *delegate) { |
| 703 return pump_libevent()->WatchFileDescriptor( | 714 return pump_libevent()->WatchFileDescriptor( |
| 704 fd, | 715 fd, |
| 705 persistent, | 716 persistent, |
| 706 static_cast<base::MessagePumpLibevent::Mode>(mode), | 717 static_cast<base::MessagePumpLibevent::Mode>(mode), |
| 707 controller, | 718 controller, |
| 708 delegate); | 719 delegate); |
| 709 } | 720 } |
| 710 | 721 |
| 711 #endif | 722 #endif |
| OLD | NEW |