| 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 <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "services/service_manager/public/cpp/identity.h" | 17 #include "services/service_manager/public/cpp/identity.h" |
| 18 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 18 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
| 19 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" | 19 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" |
| 20 #include "ui/views/mus/mus_export.h" | 20 #include "ui/views/mus/mus_export.h" |
| 21 #include "ui/views/mus/screen_mus_delegate.h" | 21 #include "ui/views/mus/screen_mus_delegate.h" |
| 22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| 23 | 23 |
| 24 namespace service_manager { | 24 namespace service_manager { |
| 25 class Connector; | 25 class Connector; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 class GpuService; | 29 class Gpu; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace views { | 32 namespace views { |
| 33 class NativeWidget; | 33 class NativeWidget; |
| 34 class PointerWatcherEventRouter; | 34 class PointerWatcherEventRouter; |
| 35 class ScreenMus; | 35 class ScreenMus; |
| 36 class SurfaceContextFactory; | 36 class SurfaceContextFactory; |
| 37 namespace internal { | 37 namespace internal { |
| 38 class NativeWidgetDelegate; | 38 class NativeWidgetDelegate; |
| 39 } | 39 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 52 // | 52 // |
| 53 // TODO(sky): this name is now totally confusing. Come up with a better one. | 53 // TODO(sky): this name is now totally confusing. Come up with a better one. |
| 54 class VIEWS_MUS_EXPORT WindowManagerConnection | 54 class VIEWS_MUS_EXPORT WindowManagerConnection |
| 55 : public NON_EXPORTED_BASE(ui::WindowTreeClientDelegate), | 55 : public NON_EXPORTED_BASE(ui::WindowTreeClientDelegate), |
| 56 public ScreenMusDelegate, | 56 public ScreenMusDelegate, |
| 57 public ui::OSExchangeDataProviderFactory::Factory { | 57 public ui::OSExchangeDataProviderFactory::Factory { |
| 58 public: | 58 public: |
| 59 ~WindowManagerConnection() override; | 59 ~WindowManagerConnection() override; |
| 60 | 60 |
| 61 // |io_task_runner| is used by the gpu service. If no task runner is provided, | 61 // |io_task_runner| is used by the gpu service. If no task runner is provided, |
| 62 // then a new thread is created and used by ui::GpuService. | 62 // then a new thread is created and used by ui::Gpu. |
| 63 static std::unique_ptr<WindowManagerConnection> Create( | 63 static std::unique_ptr<WindowManagerConnection> Create( |
| 64 service_manager::Connector* connector, | 64 service_manager::Connector* connector, |
| 65 const service_manager::Identity& identity, | 65 const service_manager::Identity& identity, |
| 66 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr); | 66 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr); |
| 67 static WindowManagerConnection* Get(); | 67 static WindowManagerConnection* Get(); |
| 68 static bool Exists(); | 68 static bool Exists(); |
| 69 | 69 |
| 70 PointerWatcherEventRouter* pointer_watcher_event_router() { | 70 PointerWatcherEventRouter* pointer_watcher_event_router() { |
| 71 return pointer_watcher_event_router_.get(); | 71 return pointer_watcher_event_router_.get(); |
| 72 } | 72 } |
| 73 service_manager::Connector* connector() { return connector_; } | 73 service_manager::Connector* connector() { return connector_; } |
| 74 ui::GpuService* gpu_service() { return gpu_service_.get(); } | 74 ui::Gpu* gpu() { return gpu_.get(); } |
| 75 ui::WindowTreeClient* client() { return client_.get(); } | 75 ui::WindowTreeClient* client() { return client_.get(); } |
| 76 | 76 |
| 77 ui::Window* NewTopLevelWindow( | 77 ui::Window* NewTopLevelWindow( |
| 78 const std::map<std::string, std::vector<uint8_t>>& properties); | 78 const std::map<std::string, std::vector<uint8_t>>& properties); |
| 79 | 79 |
| 80 NativeWidget* CreateNativeWidgetMus( | 80 NativeWidget* CreateNativeWidgetMus( |
| 81 const std::map<std::string, std::vector<uint8_t>>& properties, | 81 const std::map<std::string, std::vector<uint8_t>>& properties, |
| 82 const Widget::InitParams& init_params, | 82 const Widget::InitParams& init_params, |
| 83 internal::NativeWidgetDelegate* delegate); | 83 internal::NativeWidgetDelegate* delegate); |
| 84 | 84 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 107 gfx::Point GetCursorScreenPoint() override; | 107 gfx::Point GetCursorScreenPoint() override; |
| 108 aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; | 108 aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; |
| 109 | 109 |
| 110 // ui:OSExchangeDataProviderFactory::Factory: | 110 // ui:OSExchangeDataProviderFactory::Factory: |
| 111 std::unique_ptr<OSExchangeData::Provider> BuildProvider() override; | 111 std::unique_ptr<OSExchangeData::Provider> BuildProvider() override; |
| 112 | 112 |
| 113 service_manager::Connector* connector_; | 113 service_manager::Connector* connector_; |
| 114 service_manager::Identity identity_; | 114 service_manager::Identity identity_; |
| 115 std::unique_ptr<ScreenMus> screen_; | 115 std::unique_ptr<ScreenMus> screen_; |
| 116 std::unique_ptr<ui::WindowTreeClient> client_; | 116 std::unique_ptr<ui::WindowTreeClient> client_; |
| 117 std::unique_ptr<ui::GpuService> gpu_service_; | 117 std::unique_ptr<ui::Gpu> gpu_; |
| 118 std::unique_ptr<PointerWatcherEventRouter> pointer_watcher_event_router_; | 118 std::unique_ptr<PointerWatcherEventRouter> pointer_watcher_event_router_; |
| 119 std::unique_ptr<SurfaceContextFactory> compositor_context_factory_; | 119 std::unique_ptr<SurfaceContextFactory> compositor_context_factory_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); | 121 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace views | 124 } // namespace views |
| 125 | 125 |
| 126 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ | 126 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ |
| OLD | NEW |