| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "services/ui/display/viewport_metrics.h" | 14 #include "services/ui/display/viewport_metrics.h" |
| 15 #include "services/ui/public/interfaces/cursor/cursor.mojom.h" | 15 #include "services/ui/public/interfaces/cursor/cursor.mojom.h" |
| 16 #include "ui/events/event_source.h" | 16 #include "ui/events/event_source.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 | 18 |
| 19 namespace base { |
| 20 class SingleThreadTaskRunner; |
| 21 } |
| 22 |
| 19 namespace ui { | 23 namespace ui { |
| 20 | 24 |
| 21 struct TextInputState; | 25 struct TextInputState; |
| 22 | 26 |
| 23 namespace ws { | 27 namespace ws { |
| 24 | 28 |
| 25 class FrameGenerator; | 29 class FrameGenerator; |
| 26 class PlatformDisplayDelegate; | 30 class PlatformDisplayDelegate; |
| 27 class PlatformDisplayFactory; | 31 class PlatformDisplayFactory; |
| 28 class ServerWindow; | 32 class ServerWindow; |
| 29 | 33 |
| 30 // PlatformDisplay is used to connect the root ServerWindow to a display. | 34 // PlatformDisplay is used to connect the root ServerWindow to a display. |
| 31 class PlatformDisplay : public ui::EventSource { | 35 class PlatformDisplay : public ui::EventSource { |
| 32 public: | 36 public: |
| 33 ~PlatformDisplay() override {} | 37 ~PlatformDisplay() override {} |
| 34 | 38 |
| 35 static std::unique_ptr<PlatformDisplay> Create( | 39 static std::unique_ptr<PlatformDisplay> Create( |
| 36 ServerWindow* root_window, | 40 ServerWindow* root_window, |
| 37 const display::ViewportMetrics& metrics); | 41 const display::ViewportMetrics& metrics, |
| 42 scoped_refptr<base::SingleThreadTaskRunner>& resource_runner); |
| 38 | 43 |
| 39 virtual void Init(PlatformDisplayDelegate* delegate) = 0; | 44 virtual void Init(PlatformDisplayDelegate* delegate) = 0; |
| 40 | 45 |
| 41 virtual void SetViewportSize(const gfx::Size& size) = 0; | 46 virtual void SetViewportSize(const gfx::Size& size) = 0; |
| 42 | 47 |
| 43 virtual void SetTitle(const base::string16& title) = 0; | 48 virtual void SetTitle(const base::string16& title) = 0; |
| 44 | 49 |
| 45 virtual void SetCapture() = 0; | 50 virtual void SetCapture() = 0; |
| 46 | 51 |
| 47 virtual void ReleaseCapture() = 0; | 52 virtual void ReleaseCapture() = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 private: | 77 private: |
| 73 // Static factory instance (always NULL for non-test). | 78 // Static factory instance (always NULL for non-test). |
| 74 static PlatformDisplayFactory* factory_; | 79 static PlatformDisplayFactory* factory_; |
| 75 }; | 80 }; |
| 76 | 81 |
| 77 | 82 |
| 78 } // namespace ws | 83 } // namespace ws |
| 79 } // namespace ui | 84 } // namespace ui |
| 80 | 85 |
| 81 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 86 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |