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 UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_ |
6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_ |
7 | 7 |
| 8 #include "ui/gfx/geometry/rect.h" |
| 9 #include "ui/ozone/platform/dri/channel_observer.h" |
8 #include "ui/ozone/platform/dri/dri_window_delegate.h" | 10 #include "ui/ozone/platform/dri/dri_window_delegate.h" |
9 | 11 |
10 namespace ui { | 12 namespace ui { |
11 | 13 |
12 class GpuPlatformSupportHostGbm; | 14 class GpuPlatformSupportHostGbm; |
13 | 15 |
14 // This is used when running with a GPU process (or with the in-process GPU) to | 16 // This is used when running with a GPU process (or with the in-process GPU) to |
15 // IPC the native window configuration from the browser to the GPU. | 17 // IPC the native window configuration from the browser to the GPU. |
16 class DriWindowDelegateProxy : public DriWindowDelegate { | 18 class DriWindowDelegateProxy : public DriWindowDelegate, |
| 19 public ChannelObserver { |
17 public: | 20 public: |
18 DriWindowDelegateProxy(gfx::AcceleratedWidget widget, | 21 DriWindowDelegateProxy(gfx::AcceleratedWidget widget, |
19 GpuPlatformSupportHostGbm* sender); | 22 GpuPlatformSupportHostGbm* sender); |
20 virtual ~DriWindowDelegateProxy(); | 23 virtual ~DriWindowDelegateProxy(); |
21 | 24 |
22 // DriWindowDelegate: | 25 // DriWindowDelegate: |
23 virtual void Initialize() OVERRIDE; | 26 virtual void Initialize() OVERRIDE; |
24 virtual void Shutdown() OVERRIDE; | 27 virtual void Shutdown() OVERRIDE; |
25 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 28 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
26 virtual HardwareDisplayController* GetController() OVERRIDE; | 29 virtual HardwareDisplayController* GetController() OVERRIDE; |
27 virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE; | 30 virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE; |
28 | 31 |
| 32 // ChannelObserver: |
| 33 virtual void OnChannelEstablished() OVERRIDE; |
| 34 virtual void OnChannelDestroyed() OVERRIDE; |
| 35 |
29 private: | 36 private: |
30 gfx::AcceleratedWidget widget_; | 37 gfx::AcceleratedWidget widget_; |
31 GpuPlatformSupportHostGbm* sender_; | 38 GpuPlatformSupportHostGbm* sender_; |
| 39 gfx::Rect bounds_; |
| 40 // Tracks if the connection is established or not. |
| 41 bool has_connection_; |
32 | 42 |
33 DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateProxy); | 43 DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateProxy); |
34 }; | 44 }; |
35 | 45 |
36 } // namespace ui | 46 } // namespace ui |
37 | 47 |
38 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_ | 48 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_ |
OLD | NEW |