Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / ui / ozone / platform / dri / dri_window_delegate.h
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.
4
5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_
7
8 #include "ui/gfx/native_widget_types.h"
9
10 namespace gfx {
11 class Rect;
12 }  // namespace gfx
13
14 namespace ui {
15
16 class HardwareDisplayController;
17
18 // Interface for the display-server half of a DriWindow.
19 //
20 // The main implementation of this lives in the process that owns the display
21 // connection (usually the GPU process) and associates a platform window
22 // (DriWindow) with a display. A window is associated with the display whose
23 // bounds contains the window bounds. If there's no suitable display, the window
24 // is disconnected and its contents will not be visible.
25 //
26 // In software mode, this is owned directly on DriWindow because the display
27 // controller object is in the same process.
28 //
29 // In accelerated mode, there's a proxy implementation and calls are forwarded
30 // to the real object in the GPU process via IPC.
31 class DriWindowDelegate {
32  public:
33   virtual ~DriWindowDelegate() {}
34
35   virtual void Initialize() = 0;
36
37   virtual void Shutdown() = 0;
38
39   // Returns the accelerated widget associated with the delegate.
40   virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
41
42   // Returns the current controller the window is displaying on. Callers should
43   // not cache the result as the controller may change as the window is moved.
44   virtual HardwareDisplayController* GetController() = 0;
45
46   // Called when the window is resized/moved.
47   virtual void OnBoundsChanged(const gfx::Rect& bounds) = 0;
48 };
49
50 }  // namespace ui
51
52 #endif  // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_