| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> |
| 12 #include <string> | 13 #include <string> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "services/shell/public/cpp/identity.h" | 17 #include "services/shell/public/cpp/identity.h" |
| 17 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 18 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
| 18 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" | 19 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" |
| 19 #include "ui/views/mus/mus_export.h" | 20 #include "ui/views/mus/mus_export.h" |
| 20 #include "ui/views/mus/screen_mus_delegate.h" | 21 #include "ui/views/mus/screen_mus_delegate.h" |
| 21 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 class ClipboardMus; | 33 class ClipboardMus; |
| 33 class NativeWidget; | 34 class NativeWidget; |
| 34 class PointerWatcher; | 35 class PointerWatcher; |
| 35 class PointerWatcherEventRouter; | 36 class PointerWatcherEventRouter; |
| 36 class ScreenMus; | 37 class ScreenMus; |
| 37 class SurfaceContextFactory; | 38 class SurfaceContextFactory; |
| 38 namespace internal { | 39 namespace internal { |
| 39 class NativeWidgetDelegate; | 40 class NativeWidgetDelegate; |
| 40 } | 41 } |
| 41 | 42 |
| 43 namespace test { |
| 44 class WindowManagerConnectionTestApi; |
| 45 } |
| 46 |
| 42 // Provides configuration to mus in views. This consists of the following: | 47 // Provides configuration to mus in views. This consists of the following: |
| 43 // . Provides a Screen implementation backed by mus. | 48 // . Provides a Screen implementation backed by mus. |
| 44 // . Provides a Clipboard implementation backed by mus. | 49 // . Provides a Clipboard implementation backed by mus. |
| 45 // . Creates and owns a WindowTreeClient. | 50 // . Creates and owns a WindowTreeClient. |
| 46 // . Registers itself as the factory for creating NativeWidgets so that a | 51 // . Registers itself as the factory for creating NativeWidgets so that a |
| 47 // NativeWidgetMus is created. | 52 // NativeWidgetMus is created. |
| 48 // WindowManagerConnection is a singleton and should be created early on. | 53 // WindowManagerConnection is a singleton and should be created early on. |
| 49 // | 54 // |
| 50 // TODO(sky): this name is now totally confusing. Come up with a better one. | 55 // TODO(sky): this name is now totally confusing. Come up with a better one. |
| 51 class VIEWS_MUS_EXPORT WindowManagerConnection | 56 class VIEWS_MUS_EXPORT WindowManagerConnection |
| (...skipping 23 matching lines...) Expand all Loading... |
| 75 const std::map<std::string, std::vector<uint8_t>>& properties); | 80 const std::map<std::string, std::vector<uint8_t>>& properties); |
| 76 | 81 |
| 77 NativeWidget* CreateNativeWidgetMus( | 82 NativeWidget* CreateNativeWidgetMus( |
| 78 const std::map<std::string, std::vector<uint8_t>>& properties, | 83 const std::map<std::string, std::vector<uint8_t>>& properties, |
| 79 const Widget::InitParams& init_params, | 84 const Widget::InitParams& init_params, |
| 80 internal::NativeWidgetDelegate* delegate); | 85 internal::NativeWidgetDelegate* delegate); |
| 81 | 86 |
| 82 const std::set<ui::Window*>& GetRoots() const; | 87 const std::set<ui::Window*>& GetRoots() const; |
| 83 | 88 |
| 84 private: | 89 private: |
| 90 friend class test::WindowManagerConnectionTestApi; |
| 91 |
| 85 WindowManagerConnection( | 92 WindowManagerConnection( |
| 86 shell::Connector* connector, | 93 shell::Connector* connector, |
| 87 const shell::Identity& identity, | 94 const shell::Identity& identity, |
| 88 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 95 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 89 | 96 |
| 90 // ui::WindowTreeClientDelegate: | 97 // ui::WindowTreeClientDelegate: |
| 91 void OnEmbed(ui::Window* root) override; | 98 void OnEmbed(ui::Window* root) override; |
| 92 void OnLostConnection(ui::WindowTreeClient* client) override; | 99 void OnLostConnection(ui::WindowTreeClient* client) override; |
| 93 void OnEmbedRootDestroyed(ui::Window* root) override; | 100 void OnEmbedRootDestroyed(ui::Window* root) override; |
| 94 void OnPointerEventObserved(const ui::PointerEvent& event, | 101 void OnPointerEventObserved(const ui::PointerEvent& event, |
| 95 ui::Window* target) override; | 102 ui::Window* target) override; |
| 96 | 103 |
| 97 // ScreenMusDelegate: | 104 // ScreenMusDelegate: |
| 98 void OnWindowManagerFrameValuesChanged() override; | 105 void OnWindowManagerFrameValuesChanged() override; |
| 99 gfx::Point GetCursorScreenPoint() override; | 106 gfx::Point GetCursorScreenPoint() override; |
| 107 ui::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; |
| 100 | 108 |
| 101 // ui:OSExchangeDataProviderFactory::Factory: | 109 // ui:OSExchangeDataProviderFactory::Factory: |
| 102 std::unique_ptr<OSExchangeData::Provider> BuildProvider() override; | 110 std::unique_ptr<OSExchangeData::Provider> BuildProvider() override; |
| 103 | 111 |
| 104 shell::Connector* connector_; | 112 shell::Connector* connector_; |
| 105 shell::Identity identity_; | 113 shell::Identity identity_; |
| 106 std::unique_ptr<ScreenMus> screen_; | 114 std::unique_ptr<ScreenMus> screen_; |
| 107 std::unique_ptr<ui::WindowTreeClient> client_; | 115 std::unique_ptr<ui::WindowTreeClient> client_; |
| 108 std::unique_ptr<ui::GpuService> gpu_service_; | 116 std::unique_ptr<ui::GpuService> gpu_service_; |
| 109 std::unique_ptr<PointerWatcherEventRouter> pointer_watcher_event_router_; | 117 std::unique_ptr<PointerWatcherEventRouter> pointer_watcher_event_router_; |
| 110 std::unique_ptr<SurfaceContextFactory> compositor_context_factory_; | 118 std::unique_ptr<SurfaceContextFactory> compositor_context_factory_; |
| 111 | 119 |
| 112 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); | 120 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); |
| 113 }; | 121 }; |
| 114 | 122 |
| 115 } // namespace views | 123 } // namespace views |
| 116 | 124 |
| 117 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ | 125 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ |
| OLD | NEW |