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 COMPONENTS_MUS_WS_SERVER_WINDOW_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_WS_SERVER_WINDOW_DELEGATE_H_ |
6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_DELEGATE_H_ | 6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "components/mus/public/interfaces/mus_constants.mojom.h" | 9 #include "components/mus/public/interfaces/mus_constants.mojom.h" |
| 10 #include "components/mus/public/interfaces/window_tree.mojom.h" |
10 | 11 |
11 namespace mus { | 12 namespace mus { |
12 | 13 |
13 class SurfacesState; | 14 class SurfacesState; |
14 | 15 |
15 namespace ws { | 16 namespace ws { |
16 | 17 |
| 18 struct ClientWindowId; |
17 class ServerWindow; | 19 class ServerWindow; |
18 struct WindowId; | 20 struct WindowId; |
19 | 21 |
20 class ServerWindowDelegate { | 22 class ServerWindowDelegate { |
21 public: | 23 public: |
22 virtual SurfacesState* GetSurfacesState() = 0; | 24 virtual SurfacesState* GetSurfacesState() = 0; |
23 | 25 |
24 virtual void OnScheduleWindowPaint(const ServerWindow* window) = 0; | 26 virtual void OnScheduleWindowPaint(const ServerWindow* window) = 0; |
25 | 27 |
26 // Returns the root of the window tree to which this |window| is attached. | 28 // Returns the root of the window tree to which this |window| is attached. |
27 // Returns null if this window is not attached up through to a root window. | 29 // Returns null if this window is not attached up through to a root window. |
28 virtual const ServerWindow* GetRootWindow( | 30 virtual const ServerWindow* GetRootWindow( |
29 const ServerWindow* window) const = 0; | 31 const ServerWindow* window) const = 0; |
30 | 32 |
31 // Schedules a callback to DestroySurfacesScheduledForDestruction() at the | 33 // Schedules a callback to DestroySurfacesScheduledForDestruction() at the |
32 // appropriate time, which may be synchronously. | 34 // appropriate time, which may be synchronously. |
33 virtual void ScheduleSurfaceDestruction(ServerWindow* window) = 0; | 35 virtual void ScheduleSurfaceDestruction(ServerWindow* window) = 0; |
34 | 36 |
| 37 // Used to resolve a reference to a Window by ClientWindowId in submitted |
| 38 // frames. When the client owning |ancestor| (or the client embedded at |
| 39 // |ancestor|) submits a frame the frame may referenced child windows. The |
| 40 // reference is done using an id that is only known to the client. This |
| 41 // function resolves the id into the appropriate window, or null if a window |
| 42 // can't be found. |
| 43 virtual ServerWindow* FindWindowForSurface( |
| 44 const ServerWindow* ancestor, |
| 45 mojom::SurfaceType surface_type, |
| 46 const ClientWindowId& client_window_id) = 0; |
| 47 |
35 protected: | 48 protected: |
36 virtual ~ServerWindowDelegate() {} | 49 virtual ~ServerWindowDelegate() {} |
37 }; | 50 }; |
38 | 51 |
39 } // namespace ws | 52 } // namespace ws |
40 | 53 |
41 } // namespace mus | 54 } // namespace mus |
42 | 55 |
43 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_DELEGATE_H_ | 56 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_DELEGATE_H_ |
OLD | NEW |