| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 virtual gfx::Rect GetBounds() const = 0; | 60 virtual gfx::Rect GetBounds() const = 0; |
| 61 | 61 |
| 62 // Updates the viewport metrics for the display, returning true if any | 62 // Updates the viewport metrics for the display, returning true if any |
| 63 // metrics have changed. | 63 // metrics have changed. |
| 64 virtual bool UpdateViewportMetrics( | 64 virtual bool UpdateViewportMetrics( |
| 65 const display::ViewportMetrics& metrics) = 0; | 65 const display::ViewportMetrics& metrics) = 0; |
| 66 | 66 |
| 67 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; | 67 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; |
| 68 | 68 |
| 69 virtual bool IsPrimaryDisplay() const = 0; | |
| 70 | |
| 71 // Notifies the PlatformDisplay that a connection to the gpu has been | 69 // Notifies the PlatformDisplay that a connection to the gpu has been |
| 72 // established. | 70 // established. |
| 73 virtual void OnGpuChannelEstablished( | 71 virtual void OnGpuChannelEstablished( |
| 74 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; | 72 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; |
| 75 | 73 |
| 76 // Overrides factory for testing. Default (NULL) value indicates regular | 74 // Overrides factory for testing. Default (NULL) value indicates regular |
| 77 // (non-test) environment. | 75 // (non-test) environment. |
| 78 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 76 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
| 79 PlatformDisplay::factory_ = factory; | 77 PlatformDisplay::factory_ = factory; |
| 80 } | 78 } |
| 81 | 79 |
| 82 private: | 80 private: |
| 83 // Static factory instance (always NULL for non-test). | 81 // Static factory instance (always NULL for non-test). |
| 84 static PlatformDisplayFactory* factory_; | 82 static PlatformDisplayFactory* factory_; |
| 85 }; | 83 }; |
| 86 | 84 |
| 87 | 85 |
| 88 } // namespace ws | 86 } // namespace ws |
| 89 } // namespace ui | 87 } // namespace ui |
| 90 | 88 |
| 91 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 89 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |