| 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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module mojo; | 6 module mojo; |
| 7 | 7 |
| 8 import "geometry/interfaces/geometry.mojom"; | 8 import "geometry/interfaces/geometry.mojom"; |
| 9 import "input_events/interfaces/input_events.mojom"; | 9 import "input_events/interfaces/input_events.mojom"; |
| 10 import "mojo/public/interfaces/application/service_provider.mojom"; | 10 import "mojo/public/interfaces/application/service_provider.mojom"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 enum ErrorCode { | 29 enum ErrorCode { |
| 30 NONE, | 30 NONE, |
| 31 VALUE_IN_USE, | 31 VALUE_IN_USE, |
| 32 ILLEGAL_ARGUMENT, | 32 ILLEGAL_ARGUMENT, |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // Views are identified by a uint32. The upper 16 bits are the connection id, | 35 // Views are identified by a uint32. The upper 16 bits are the connection id, |
| 36 // and the lower 16 the id assigned by the client. | 36 // and the lower 16 the id assigned by the client. |
| 37 // | 37 // |
| 38 // The root view is identified with a connection id of 0, and value of 1. | 38 // The root view is identified with a connection id of 0, and value of 1. |
| 39 [ServiceName="mojo::ViewManagerService"] |
| 39 interface ViewManagerService { | 40 interface ViewManagerService { |
| 40 // Creates a new view with the specified id. It is up to the client to ensure | 41 // Creates a new view with the specified id. It is up to the client to ensure |
| 41 // the id is unique to the connection (the id need not be globally unique). | 42 // the id is unique to the connection (the id need not be globally unique). |
| 42 // Additionally the connection id (embedded in |view_id|) must match that of | 43 // Additionally the connection id (embedded in |view_id|) must match that of |
| 43 // the connection. | 44 // the connection. |
| 44 // Errors: | 45 // Errors: |
| 45 // ERROR_CODE_VALUE_IN_USE: a view already exists with the specified id. | 46 // ERROR_CODE_VALUE_IN_USE: a view already exists with the specified id. |
| 46 // ERROR_CODE_ILLEGAL_ARGUMENT: The connection part of |view_id| does not | 47 // ERROR_CODE_ILLEGAL_ARGUMENT: The connection part of |view_id| does not |
| 47 // match the connection id of the client. | 48 // match the connection id of the client. |
| 48 // | 49 // |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // | 150 // |
| 150 // TODO(sky): nuke this. This is here to guarantee the state of the | 151 // TODO(sky): nuke this. This is here to guarantee the state of the |
| 151 // WindowManager matches that of the ViewManager at the time the client | 152 // WindowManager matches that of the ViewManager at the time the client |
| 152 // invokes the function. When we can enforce ordering this won't be necessary. | 153 // invokes the function. When we can enforce ordering this won't be necessary. |
| 153 PerformAction(uint32 view_id, string action) => (bool success); | 154 PerformAction(uint32 view_id, string action) => (bool success); |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 // Changes to views are not sent to the connection that originated the | 157 // Changes to views are not sent to the connection that originated the |
| 157 // change. For example, if connection 1 changes the bounds of a view by calling | 158 // change. For example, if connection 1 changes the bounds of a view by calling |
| 158 // SetBounds(), connection 1 does not receive OnViewBoundsChanged(). | 159 // SetBounds(), connection 1 does not receive OnViewBoundsChanged(). |
| 160 [ServiceName="mojo::ViewManagerClient"] |
| 159 interface ViewManagerClient { | 161 interface ViewManagerClient { |
| 160 // Invoked when the client application has been embedded at |root|. | 162 // Invoked when the client application has been embedded at |root|. |
| 161 // See Embed() on ViewManagerService for more details. |view_manager_service| | 163 // See Embed() on ViewManagerService for more details. |view_manager_service| |
| 162 // will be a handle back to the view manager service, unless the connection is | 164 // will be a handle back to the view manager service, unless the connection is |
| 163 // to the WindowManager in which case it will be null. | 165 // to the WindowManager in which case it will be null. |
| 164 // |window_manager_pipe| is a pipe to the WindowManager. | 166 // |window_manager_pipe| is a pipe to the WindowManager. |
| 165 OnEmbed(uint16 connection_id, | 167 OnEmbed(uint16 connection_id, |
| 166 string embedder_url, | 168 string embedder_url, |
| 167 ViewData root, | 169 ViewData root, |
| 168 ViewManagerService? view_manager_service, | 170 ViewManagerService? view_manager_service, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 OnViewSharedPropertyChanged(uint32 view, string name, array<uint8>? new_data); | 224 OnViewSharedPropertyChanged(uint32 view, string name, array<uint8>? new_data); |
| 223 | 225 |
| 224 // Invoked when an event is targeted at the specified view. | 226 // Invoked when an event is targeted at the specified view. |
| 225 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 227 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
| 226 | 228 |
| 227 // Invoked solely on the WindowManager. See comments in PerformAction() above | 229 // Invoked solely on the WindowManager. See comments in PerformAction() above |
| 228 // for details. | 230 // for details. |
| 229 // TODO(sky): nuke this. | 231 // TODO(sky): nuke this. |
| 230 OnPerformAction(uint32 view_id, string action) => (bool success); | 232 OnPerformAction(uint32 view_id, string action) => (bool success); |
| 231 }; | 233 }; |
| OLD | NEW |