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 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
28 class GpuService; | 28 class GpuService; |
29 } | 29 } |
30 | 30 |
31 namespace views { | 31 namespace views { |
32 class ClipboardMus; | 32 class ClipboardMus; |
33 class NativeWidget; | 33 class NativeWidget; |
34 class PointerWatcher; | 34 class PointerWatcher; |
35 class TouchEventWatcher; | |
36 class ScreenMus; | 35 class ScreenMus; |
37 namespace internal { | 36 namespace internal { |
38 class NativeWidgetDelegate; | 37 class NativeWidgetDelegate; |
39 } | 38 } |
40 | 39 |
41 // Provides configuration to mus in views. This consists of the following: | 40 // Provides configuration to mus in views. This consists of the following: |
42 // . Provides a Screen implementation backed by mus. | 41 // . Provides a Screen implementation backed by mus. |
43 // . Provides a Clipboard implementation backed by mus. | 42 // . Provides a Clipboard implementation backed by mus. |
44 // . Creates and owns a WindowTreeClient. | 43 // . Creates and owns a WindowTreeClient. |
45 // . Registers itself as the factory for creating NativeWidgets so that a | 44 // . Registers itself as the factory for creating NativeWidgets so that a |
(...skipping 16 matching lines...) Expand all Loading... |
62 shell::Connector* connector() { return connector_; } | 61 shell::Connector* connector() { return connector_; } |
63 | 62 |
64 ui::Window* NewWindow( | 63 ui::Window* NewWindow( |
65 const std::map<std::string, std::vector<uint8_t>>& properties); | 64 const std::map<std::string, std::vector<uint8_t>>& properties); |
66 | 65 |
67 NativeWidget* CreateNativeWidgetMus( | 66 NativeWidget* CreateNativeWidgetMus( |
68 const std::map<std::string, std::vector<uint8_t>>& properties, | 67 const std::map<std::string, std::vector<uint8_t>>& properties, |
69 const Widget::InitParams& init_params, | 68 const Widget::InitParams& init_params, |
70 internal::NativeWidgetDelegate* delegate); | 69 internal::NativeWidgetDelegate* delegate); |
71 | 70 |
72 void AddPointerWatcher(PointerWatcher* watcher); | 71 void AddPointerWatcher(PointerWatcher* watcher, bool want_moves); |
73 void RemovePointerWatcher(PointerWatcher* watcher); | 72 void RemovePointerWatcher(PointerWatcher* watcher); |
74 | 73 |
75 void AddTouchEventWatcher(TouchEventWatcher* watcher); | |
76 void RemoveTouchEventWatcher(TouchEventWatcher* watcher); | |
77 | |
78 const std::set<ui::Window*>& GetRoots() const; | 74 const std::set<ui::Window*>& GetRoots() const; |
79 | 75 |
80 private: | 76 private: |
81 friend class WindowManagerConnectionTest; | 77 friend class WindowManagerConnectionTest; |
82 | 78 |
83 WindowManagerConnection(shell::Connector* connector, | 79 WindowManagerConnection(shell::Connector* connector, |
84 const shell::Identity& identity); | 80 const shell::Identity& identity); |
85 | 81 |
86 // Returns true if there is one or more watchers for this client. | 82 // Returns true if there is one or more watchers for this client. |
87 bool HasPointerWatcher(); | 83 bool HasPointerWatcher(); |
88 bool HasTouchEventWatcher(); | |
89 | 84 |
90 // ui::WindowTreeClientDelegate: | 85 // ui::WindowTreeClientDelegate: |
91 void OnEmbed(ui::Window* root) override; | 86 void OnEmbed(ui::Window* root) override; |
92 void OnDidDestroyClient(ui::WindowTreeClient* client) override; | 87 void OnDidDestroyClient(ui::WindowTreeClient* client) override; |
93 void OnEventObserved(const ui::Event& event, ui::Window* target) override; | 88 void OnPointerEventObserved(const ui::PointerEvent& event, |
| 89 ui::Window* target) override; |
94 | 90 |
95 // ScreenMusDelegate: | 91 // ScreenMusDelegate: |
96 void OnWindowManagerFrameValuesChanged() override; | 92 void OnWindowManagerFrameValuesChanged() override; |
97 gfx::Point GetCursorScreenPoint() override; | 93 gfx::Point GetCursorScreenPoint() override; |
98 | 94 |
99 shell::Connector* connector_; | 95 shell::Connector* connector_; |
100 shell::Identity identity_; | 96 shell::Identity identity_; |
101 std::unique_ptr<ScreenMus> screen_; | 97 std::unique_ptr<ScreenMus> screen_; |
102 std::unique_ptr<ui::WindowTreeClient> client_; | 98 std::unique_ptr<ui::WindowTreeClient> client_; |
103 std::unique_ptr<ui::GpuService> gpu_service_; | 99 std::unique_ptr<ui::GpuService> gpu_service_; |
104 // Must be empty on destruction. | 100 // Must be empty on destruction. |
105 base::ObserverList<PointerWatcher, true> pointer_watchers_; | 101 base::ObserverList<PointerWatcher, true> pointer_watchers_; |
106 base::ObserverList<TouchEventWatcher, true> touch_event_watchers_; | 102 bool pointer_watcher_want_moves_; |
107 | 103 |
108 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); | 104 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); |
109 }; | 105 }; |
110 | 106 |
111 } // namespace views | 107 } // namespace views |
112 | 108 |
113 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ | 109 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ |
OLD | NEW |