OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_VIEWS_TEST_X11_PROPERTY_CHANGE_WAITER_H_ | 5 #ifndef UI_VIEWS_TEST_X11_PROPERTY_CHANGE_WAITER_H_ |
6 #define UI_VIEWS_TEST_X11_PROPERTY_CHANGE_WAITER_H_ | 6 #define UI_VIEWS_TEST_X11_PROPERTY_CHANGE_WAITER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "ui/events/platform/platform_event_dispatcher.h" | 14 #include "ui/events/platform/platform_event_dispatcher.h" |
15 #include "ui/events/platform/platform_event_types.h" | 15 #include "ui/events/platform/platform_event_types.h" |
16 #include "ui/gfx/x/x11_types.h" | 16 #include "ui/gfx/x/x11_types.h" |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 class ScopedEventDispatcher; | 19 class ScopedEventDispatcher; |
20 class X11AtomCache; | |
21 class XScopedEventSelector; | 20 class XScopedEventSelector; |
22 } | 21 } |
23 | 22 |
24 namespace views { | 23 namespace views { |
25 | 24 |
26 // Blocks till the value of |property| on |window| changes. | 25 // Blocks till the value of |property| on |window| changes. |
27 class X11PropertyChangeWaiter : public ui::PlatformEventDispatcher { | 26 class X11PropertyChangeWaiter : public ui::PlatformEventDispatcher { |
28 public: | 27 public: |
29 X11PropertyChangeWaiter(XID window, const char* property); | 28 X11PropertyChangeWaiter(XID window, const char* property); |
30 ~X11PropertyChangeWaiter() override; | 29 ~X11PropertyChangeWaiter() override; |
(...skipping 20 matching lines...) Expand all Loading... |
51 std::unique_ptr<ui::XScopedEventSelector> x_window_events_; | 50 std::unique_ptr<ui::XScopedEventSelector> x_window_events_; |
52 | 51 |
53 // Whether Wait() should block. | 52 // Whether Wait() should block. |
54 bool wait_; | 53 bool wait_; |
55 | 54 |
56 // Ends the run loop. | 55 // Ends the run loop. |
57 base::Closure quit_closure_; | 56 base::Closure quit_closure_; |
58 | 57 |
59 std::unique_ptr<ui::ScopedEventDispatcher> dispatcher_; | 58 std::unique_ptr<ui::ScopedEventDispatcher> dispatcher_; |
60 | 59 |
61 std::unique_ptr<ui::X11AtomCache> atom_cache_; | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(X11PropertyChangeWaiter); | 60 DISALLOW_COPY_AND_ASSIGN(X11PropertyChangeWaiter); |
64 }; | 61 }; |
65 | 62 |
66 } // namespace views | 63 } // namespace views |
67 | 64 |
68 #endif // UI_VIEWS_TEST_X11_PROPERTY_CHANGE_WAITER_H_ | 65 #endif // UI_VIEWS_TEST_X11_PROPERTY_CHANGE_WAITER_H_ |
OLD | NEW |