OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MUS_CLIENT_H_ | 5 #ifndef UI_VIEWS_MUS_MUS_CLIENT_H_ |
6 #define UI_VIEWS_MUS_MUS_CLIENT_H_ | 6 #define UI_VIEWS_MUS_MUS_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "services/service_manager/public/cpp/identity.h" | 15 #include "services/service_manager/public/cpp/identity.h" |
16 #include "ui/aura/client/capture_client.h" | 16 #include "ui/aura/client/capture_client.h" |
17 #include "ui/aura/mus/window_tree_client_delegate.h" | 17 #include "ui/aura/mus/window_tree_client_delegate.h" |
18 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" | |
19 #include "ui/views/mus/mus_export.h" | 18 #include "ui/views/mus/mus_export.h" |
20 #include "ui/views/mus/screen_mus_delegate.h" | 19 #include "ui/views/mus/screen_mus_delegate.h" |
21 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
22 | 21 |
23 namespace aura { | 22 namespace aura { |
24 class PropertyConverter; | 23 class PropertyConverter; |
25 class Window; | 24 class Window; |
26 class WindowTreeClient; | 25 class WindowTreeClient; |
27 } | 26 } |
28 | 27 |
(...skipping 25 matching lines...) Expand all Loading... |
54 class NativeWidgetDelegate; | 53 class NativeWidgetDelegate; |
55 } | 54 } |
56 | 55 |
57 namespace test { | 56 namespace test { |
58 class MusClientTestApi; | 57 class MusClientTestApi; |
59 } | 58 } |
60 | 59 |
61 // MusClient establishes a connection to mus and sets up necessary state so that | 60 // MusClient establishes a connection to mus and sets up necessary state so that |
62 // aura and views target mus. This class is useful for typical clients, not the | 61 // aura and views target mus. This class is useful for typical clients, not the |
63 // WindowManager. Most clients don't create this directly, rather use AuraInit. | 62 // WindowManager. Most clients don't create this directly, rather use AuraInit. |
64 class VIEWS_MUS_EXPORT MusClient | 63 class VIEWS_MUS_EXPORT MusClient : public aura::WindowTreeClientDelegate, |
65 : public aura::WindowTreeClientDelegate, | 64 public ScreenMusDelegate { |
66 public ScreenMusDelegate, | |
67 public ui::OSExchangeDataProviderFactory::Factory { | |
68 public: | 65 public: |
69 // Most clients should use AuraInit, which creates a MusClient. | 66 // Most clients should use AuraInit, which creates a MusClient. |
70 // |create_wm_state| indicates whether MusClient should create a wm::WMState. | 67 // |create_wm_state| indicates whether MusClient should create a wm::WMState. |
71 MusClient( | 68 MusClient( |
72 service_manager::Connector* connector, | 69 service_manager::Connector* connector, |
73 const service_manager::Identity& identity, | 70 const service_manager::Identity& identity, |
74 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr, | 71 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr, |
75 bool create_wm_state = true); | 72 bool create_wm_state = true); |
76 ~MusClient() override; | 73 ~MusClient() override; |
77 | 74 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void OnLostConnection(aura::WindowTreeClient* client) override; | 125 void OnLostConnection(aura::WindowTreeClient* client) override; |
129 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; | 126 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; |
130 void OnPointerEventObserved(const ui::PointerEvent& event, | 127 void OnPointerEventObserved(const ui::PointerEvent& event, |
131 aura::Window* target) override; | 128 aura::Window* target) override; |
132 aura::PropertyConverter* GetPropertyConverter() override; | 129 aura::PropertyConverter* GetPropertyConverter() override; |
133 | 130 |
134 // ScreenMusDelegate: | 131 // ScreenMusDelegate: |
135 void OnWindowManagerFrameValuesChanged() override; | 132 void OnWindowManagerFrameValuesChanged() override; |
136 aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; | 133 aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; |
137 | 134 |
138 // ui:OSExchangeDataProviderFactory::Factory: | |
139 std::unique_ptr<OSExchangeData::Provider> BuildProvider() override; | |
140 | |
141 static MusClient* instance_; | 135 static MusClient* instance_; |
142 | 136 |
143 service_manager::Identity identity_; | 137 service_manager::Identity identity_; |
144 | 138 |
145 std::unique_ptr<base::Thread> io_thread_; | 139 std::unique_ptr<base::Thread> io_thread_; |
146 | 140 |
147 base::ObserverList<MusClientObserver> observer_list_; | 141 base::ObserverList<MusClientObserver> observer_list_; |
148 | 142 |
149 // NOTE: this may be null (creation is based on argument supplied to | 143 // NOTE: this may be null (creation is based on argument supplied to |
150 // constructor). | 144 // constructor). |
(...skipping 10 matching lines...) Expand all Loading... |
161 | 155 |
162 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager> | 156 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager> |
163 discardable_shared_memory_manager_; | 157 discardable_shared_memory_manager_; |
164 | 158 |
165 DISALLOW_COPY_AND_ASSIGN(MusClient); | 159 DISALLOW_COPY_AND_ASSIGN(MusClient); |
166 }; | 160 }; |
167 | 161 |
168 } // namespace views | 162 } // namespace views |
169 | 163 |
170 #endif // UI_VIEWS_MUS_MUS_CLIENT_H_ | 164 #endif // UI_VIEWS_MUS_MUS_CLIENT_H_ |
OLD | NEW |