| 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/window_manager_constants.mojom"; |
| 7 import "components/mus/public/interfaces/window_tree.mojom"; | 8 import "components/mus/public/interfaces/window_tree.mojom"; |
| 8 import "ui/mojo/geometry/geometry.mojom"; | 9 import "ui/mojo/geometry/geometry.mojom"; |
| 9 | 10 |
| 10 enum WindowManagerErrorCode { | |
| 11 SUCCESS, | |
| 12 ERROR_ACCESS_DENIED | |
| 13 }; | |
| 14 | |
| 15 enum ShowState { | |
| 16 RESTORED, | |
| 17 MINIMIZED, | |
| 18 MAXIMIZED, | |
| 19 IMMERSIVE, | |
| 20 PRESENTATION | |
| 21 }; | |
| 22 | |
| 23 enum Rotation { | |
| 24 VALUE_0, | |
| 25 VALUE_90, | |
| 26 VALUE_180, | |
| 27 VALUE_270, | |
| 28 }; | |
| 29 | |
| 30 struct Display { | |
| 31 int64 id; | |
| 32 mojo.Rect bounds; | |
| 33 mojo.Rect work_area; | |
| 34 float device_pixel_ratio; | |
| 35 Rotation rotation; | |
| 36 }; | |
| 37 | |
| 38 // Represents a core interface that should be implemented by any window manager | 11 // Represents a core interface that should be implemented by any window manager |
| 39 // built on top of Mus. | 12 // built on top of Mus. |
| 40 // For security reasons, methods that take window_ids can only pass window ids | 13 // For security reasons, methods that take window_ids can only pass window ids |
| 41 // created by calls to OpenWindow() from the *same connection* to the window | 14 // created by calls to OpenWindow() from the *same connection* to the window |
| 42 // manager. The callback indicates success or failure. | 15 // manager. The callback indicates success or failure. |
| 43 interface WindowManager { | 16 interface WindowManager { |
| 44 // The window bounds as set by user input. Type: mojo::Rect. | 17 // The window bounds as set by user input. Type: mojo::Rect. |
| 45 const string kUserSetBounds_Property = "prop:user-set-bounds"; | 18 const string kUserSetBounds_Property = "prop:user-set-bounds"; |
| 46 // The window's preferred size as defined by its content. Type: mojo::Size. | 19 // The window's preferred size as defined by its content. Type: mojo::Size. |
| 47 const string kPreferredSize_Property = "prop:preferred-size"; | 20 const string kPreferredSize_Property = "prop:preferred-size"; |
| 48 // The window's show state. Type: ShowState. | 21 // The window's show state. Type: ShowState. |
| 49 const string kShowState_Property = "prop:show-state"; | 22 const string kShowState_Property = "prop:show-state"; |
| 50 | 23 |
| 51 OpenWindow(WindowTreeClient client); | 24 OpenWindow(WindowTreeClient client); |
| 52 | 25 |
| 53 // Updates the window's preferred size and triggers a relayout of the window | 26 // Updates the window's preferred size and triggers a relayout of the window |
| 54 // within its container. | 27 // within its container. |
| 55 SetPreferredSize(uint32 window_id, mojo.Size size) => | 28 SetPreferredSize(uint32 window_id, mojo.Size size) => |
| 56 (WindowManagerErrorCode result); | 29 (WindowManagerErrorCode result); |
| 57 | 30 |
| 58 SetBounds(uint32 window_id, mojo.Rect bounds) => | 31 SetBounds(uint32 window_id, mojo.Rect bounds) => |
| 59 (WindowManagerErrorCode result); | 32 (WindowManagerErrorCode result); |
| 60 | 33 |
| 61 SetShowState(uint32 window_id, ShowState show_state) => | 34 SetShowState(uint32 window_id, ShowState show_state) => |
| 62 (WindowManagerErrorCode result); | 35 (WindowManagerErrorCode result); |
| 63 | 36 |
| 64 GetDisplays() => (array<Display> displays); | 37 GetDisplays() => (array<Display> displays); |
| 65 }; | 38 }; |
| OLD | NEW |