OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 module mus.mojom; | 5 module mus.mojom; |
6 | 6 |
7 import "components/mus/public/interfaces/view_tree.mojom"; | 7 import "components/mus/public/interfaces/view_tree.mojom"; |
8 import "ui/mojo/geometry/geometry.mojom"; | 8 import "ui/mojo/geometry/geometry.mojom"; |
9 | 9 |
| 10 enum Rotation { |
| 11 VALUE_0, |
| 12 VALUE_90, |
| 13 VALUE_180, |
| 14 VALUE_270, |
| 15 }; |
| 16 |
| 17 struct Display { |
| 18 int64 id; |
| 19 mojo.Rect bounds; |
| 20 mojo.Rect work_area; |
| 21 float device_pixel_ratio; |
| 22 Rotation rotation; |
| 23 }; |
| 24 |
10 // Represents a core interface that should be implemented by any window manager | 25 // Represents a core interface that should be implemented by any window manager |
11 // built on top of Mus. | 26 // built on top of Mus. |
12 // For security reasons, methods that take view_ids can only pass view ids | 27 // For security reasons, methods that take view_ids can only pass view ids |
13 // created by calls to OpenWindow() from the *same connection* to the window | 28 // created by calls to OpenWindow() from the *same connection* to the window |
14 // manager. | 29 // manager. |
15 interface WindowManager { | 30 interface WindowManager { |
16 OpenWindow(mojo.ViewTreeClient client); | 31 OpenWindow(mojo.ViewTreeClient client); |
17 | 32 |
18 // Resizes the corresponding view to |size| and centers it in the current | 33 // Resizes the corresponding view to |size| and centers it in the current |
19 // context. | 34 // context. |
20 CenterWindow(uint32 view_id, mojo.Size size); | 35 CenterWindow(uint32 view_id, mojo.Size size); |
| 36 |
| 37 GetDisplays() => (array<Display> displays); |
21 }; | 38 }; |
OLD | NEW |