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
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
8 #include "ui/gfx/geometry/rect.h"
9 #include "ui/ozone/platform/dri/channel_observer.h"
10 #include "ui/ozone/platform/dri/dri_window_delegate.h"
14 class GpuPlatformSupportHostGbm;
16 // This is used when running with a GPU process (or with the in-process GPU) to
17 // IPC the native window configuration from the browser to the GPU.
18 class DriWindowDelegateProxy : public DriWindowDelegate,
19 public ChannelObserver {
21 DriWindowDelegateProxy(gfx::AcceleratedWidget widget,
22 GpuPlatformSupportHostGbm* sender);
23 virtual ~DriWindowDelegateProxy();
26 virtual void Initialize() OVERRIDE;
27 virtual void Shutdown() OVERRIDE;
28 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
29 virtual HardwareDisplayController* GetController() OVERRIDE;
30 virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
33 virtual void OnChannelEstablished() OVERRIDE;
34 virtual void OnChannelDestroyed() OVERRIDE;
37 gfx::AcceleratedWidget widget_;
38 GpuPlatformSupportHostGbm* sender_; // Not owned.
40 // Cached state for the window. If the GPU process crashes, this state is used
41 // to update the GPU side when it comes back.
44 DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateProxy);
49 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_