OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MUS_WINDOW_MANAGER_CONNECTION_H_ | 5 #ifndef UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ |
6 #define UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ | 6 #define UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
22 | 22 |
23 namespace shell { | 23 namespace shell { |
24 class Connector; | 24 class Connector; |
25 } | 25 } |
26 | 26 |
27 namespace views { | 27 namespace views { |
28 class ClipboardMus; | 28 class ClipboardMus; |
29 class NativeWidget; | 29 class NativeWidget; |
30 class PointerWatcher; | 30 class PointerWatcher; |
| 31 class TouchEventWatcher; |
31 class ScreenMus; | 32 class ScreenMus; |
32 namespace internal { | 33 namespace internal { |
33 class NativeWidgetDelegate; | 34 class NativeWidgetDelegate; |
34 } | 35 } |
35 | 36 |
36 // Provides configuration to mus in views. This consists of the following: | 37 // Provides configuration to mus in views. This consists of the following: |
37 // . Provides a Screen implementation backed by mus. | 38 // . Provides a Screen implementation backed by mus. |
38 // . Provides a Clipboard implementation backed by mus. | 39 // . Provides a Clipboard implementation backed by mus. |
39 // . Creates and owns a WindowTreeClient. | 40 // . Creates and owns a WindowTreeClient. |
40 // . Registers itself as the factory for creating NativeWidgets so that a | 41 // . Registers itself as the factory for creating NativeWidgets so that a |
(...skipping 19 matching lines...) Expand all Loading... |
60 const std::map<std::string, std::vector<uint8_t>>& properties); | 61 const std::map<std::string, std::vector<uint8_t>>& properties); |
61 | 62 |
62 NativeWidget* CreateNativeWidgetMus( | 63 NativeWidget* CreateNativeWidgetMus( |
63 const std::map<std::string, std::vector<uint8_t>>& properties, | 64 const std::map<std::string, std::vector<uint8_t>>& properties, |
64 const Widget::InitParams& init_params, | 65 const Widget::InitParams& init_params, |
65 internal::NativeWidgetDelegate* delegate); | 66 internal::NativeWidgetDelegate* delegate); |
66 | 67 |
67 void AddPointerWatcher(PointerWatcher* watcher); | 68 void AddPointerWatcher(PointerWatcher* watcher); |
68 void RemovePointerWatcher(PointerWatcher* watcher); | 69 void RemovePointerWatcher(PointerWatcher* watcher); |
69 | 70 |
| 71 void AddTouchEventWatcher(TouchEventWatcher* watcher); |
| 72 void RemoveTouchEventWatcher(TouchEventWatcher* watcher); |
| 73 |
70 private: | 74 private: |
71 friend class WindowManagerConnectionTest; | 75 friend class WindowManagerConnectionTest; |
72 | 76 |
73 WindowManagerConnection(shell::Connector* connector, | 77 WindowManagerConnection(shell::Connector* connector, |
74 const shell::Identity& identity); | 78 const shell::Identity& identity); |
75 | 79 |
76 // Returns true if there is one or more pointer watchers for this client. | 80 // Returns true if there is one or more pointer watchers for this client. |
77 bool HasPointerWatcher(); | 81 bool HasPointerWatcher(); |
| 82 bool HasTouchEventWatcher(); |
78 | 83 |
79 // ui::WindowTreeClientDelegate: | 84 // ui::WindowTreeClientDelegate: |
80 void OnEmbed(ui::Window* root) override; | 85 void OnEmbed(ui::Window* root) override; |
81 void OnDidDestroyClient(ui::WindowTreeClient* client) override; | 86 void OnDidDestroyClient(ui::WindowTreeClient* client) override; |
82 void OnEventObserved(const ui::Event& event, ui::Window* target) override; | 87 void OnEventObserved(const ui::Event& event, ui::Window* target) override; |
83 | 88 |
84 // ScreenMusDelegate: | 89 // ScreenMusDelegate: |
85 void OnWindowManagerFrameValuesChanged() override; | 90 void OnWindowManagerFrameValuesChanged() override; |
86 gfx::Point GetCursorScreenPoint() override; | 91 gfx::Point GetCursorScreenPoint() override; |
87 | 92 |
88 shell::Connector* connector_; | 93 shell::Connector* connector_; |
89 shell::Identity identity_; | 94 shell::Identity identity_; |
90 std::unique_ptr<ScreenMus> screen_; | 95 std::unique_ptr<ScreenMus> screen_; |
91 std::unique_ptr<ui::WindowTreeClient> client_; | 96 std::unique_ptr<ui::WindowTreeClient> client_; |
92 // Must be empty on destruction. | 97 // Must be empty on destruction. |
93 base::ObserverList<PointerWatcher, true> pointer_watchers_; | 98 base::ObserverList<PointerWatcher, true> pointer_watchers_; |
| 99 base::ObserverList<TouchEventWatcher, true> touch_event_watchers_; |
94 | 100 |
95 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); | 101 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); |
96 }; | 102 }; |
97 | 103 |
98 } // namespace views | 104 } // namespace views |
99 | 105 |
100 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ | 106 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ |
OLD | NEW |