| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace gpu { | 21 namespace gpu { |
| 22 class GpuChannelHost; | 22 class GpuChannelHost; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace ui { | 25 namespace ui { |
| 26 | 26 |
| 27 struct TextInputState; | 27 struct TextInputState; |
| 28 | 28 |
| 29 namespace ws { | 29 namespace ws { |
| 30 | 30 |
| 31 class FrameGenerator; |
| 31 class PlatformDisplayDelegate; | 32 class PlatformDisplayDelegate; |
| 32 class PlatformDisplayFactory; | 33 class PlatformDisplayFactory; |
| 33 struct PlatformDisplayInitParams; | 34 struct PlatformDisplayInitParams; |
| 34 | 35 |
| 35 // PlatformDisplay is used to connect the root ServerWindow to a display. | 36 // PlatformDisplay is used to connect the root ServerWindow to a display. |
| 36 class PlatformDisplay { | 37 class PlatformDisplay { |
| 37 public: | 38 public: |
| 38 virtual ~PlatformDisplay() {} | 39 virtual ~PlatformDisplay() {} |
| 39 | 40 |
| 40 static std::unique_ptr<PlatformDisplay> Create( | 41 static std::unique_ptr<PlatformDisplay> Create( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 59 | 60 |
| 60 virtual gfx::Rect GetBounds() const = 0; | 61 virtual gfx::Rect GetBounds() const = 0; |
| 61 | 62 |
| 62 // Updates the viewport metrics for the display, returning true if any | 63 // Updates the viewport metrics for the display, returning true if any |
| 63 // metrics have changed. | 64 // metrics have changed. |
| 64 virtual bool UpdateViewportMetrics( | 65 virtual bool UpdateViewportMetrics( |
| 65 const display::ViewportMetrics& metrics) = 0; | 66 const display::ViewportMetrics& metrics) = 0; |
| 66 | 67 |
| 67 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; | 68 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; |
| 68 | 69 |
| 70 virtual FrameGenerator* GetFrameGenerator() = 0; |
| 71 |
| 69 // Notifies the PlatformDisplay that a connection to the gpu has been | 72 // Notifies the PlatformDisplay that a connection to the gpu has been |
| 70 // established. | 73 // established. |
| 71 virtual void OnGpuChannelEstablished( | 74 virtual void OnGpuChannelEstablished( |
| 72 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; | 75 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; |
| 73 | 76 |
| 74 // Overrides factory for testing. Default (NULL) value indicates regular | 77 // Overrides factory for testing. Default (NULL) value indicates regular |
| 75 // (non-test) environment. | 78 // (non-test) environment. |
| 76 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 79 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
| 77 PlatformDisplay::factory_ = factory; | 80 PlatformDisplay::factory_ = factory; |
| 78 } | 81 } |
| 79 | 82 |
| 80 private: | 83 private: |
| 81 // Static factory instance (always NULL for non-test). | 84 // Static factory instance (always NULL for non-test). |
| 82 static PlatformDisplayFactory* factory_; | 85 static PlatformDisplayFactory* factory_; |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 | 88 |
| 86 } // namespace ws | 89 } // namespace ws |
| 87 } // namespace ui | 90 } // namespace ui |
| 88 | 91 |
| 89 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 92 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |