Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: components/mus/public/interfaces/window_tree.mojom

Issue 1891413002: mash: Convert OnWindowInputEventAck to use an enum for handled status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a file Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 module mus.mojom; 5 module mus.mojom;
6 6
7 import "components/mus/public/interfaces/compositor_frame.mojom"; 7 import "components/mus/public/interfaces/compositor_frame.mojom";
8 import "components/mus/public/interfaces/cursor.mojom"; 8 import "components/mus/public/interfaces/cursor.mojom";
9 import "components/mus/public/interfaces/input_events.mojom"; 9 import "components/mus/public/interfaces/input_events.mojom";
10 import "components/mus/public/interfaces/mus_constants.mojom"; 10 import "components/mus/public/interfaces/mus_constants.mojom";
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Only the owner of a window may obtain this surface. 45 // Only the owner of a window may obtain this surface.
46 // The window manager can change the offset of this by way of 46 // The window manager can change the offset of this by way of
47 // SetUnderlaySurfaceOffsetAndExtendedHitArea(). 47 // SetUnderlaySurfaceOffsetAndExtendedHitArea().
48 UNDERLAY, 48 UNDERLAY,
49 49
50 // Only the embedded app may obtain this surface. If an app is not embedded 50 // Only the embedded app may obtain this surface. If an app is not embedded
51 // in the Window than the owner may also render to this surface as well. 51 // in the Window than the owner may also render to this surface as well.
52 DEFAULT, 52 DEFAULT,
53 }; 53 };
54 54
55 // The result of an input event sent to a client app.
56 enum EventResult {
57 HANDLED,
58 UNHANDLED,
59 };
60
55 // Windows are identified by a uint32. The upper 16 bits are the connection id, 61 // Windows are identified by a uint32. The upper 16 bits are the connection id,
56 // and the lower 16 the id assigned by the client. 62 // and the lower 16 the id assigned by the client.
57 // 63 //
58 // The root window is identified with a connection id of 0, and value of 1. 64 // The root window is identified with a connection id of 0, and value of 1.
59 // 65 //
60 // Most functions to the WindowTree take a change_id parameter. When 66 // Most functions to the WindowTree take a change_id parameter. When
61 // WindowTree completes processing of a function WindowTree calls 67 // WindowTree completes processing of a function WindowTree calls
62 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the 68 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the
63 // client and the result of the function. This allows the client to track 69 // client and the result of the function. This allows the client to track
64 // whether the call succeeded or not. Calls are done via the client interface 70 // whether the call succeeded or not. Calls are done via the client interface
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 240
235 // Set text input state for the given window. 241 // Set text input state for the given window.
236 SetWindowTextInputState(uint32 window_id, mojo.TextInputState state); 242 SetWindowTextInputState(uint32 window_id, mojo.TextInputState state);
237 243
238 // Set the input method editor UI (software keyboard, etc) visibility. 244 // Set the input method editor UI (software keyboard, etc) visibility.
239 // If state is non-null, the specified window's text input state is updated. 245 // If state is non-null, the specified window's text input state is updated.
240 // Otherwise the existing state is used. 246 // Otherwise the existing state is used.
241 SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); 247 SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state);
242 248
243 // See documentation for WindowTreeClient::OnWindowInputEvent(). 249 // See documentation for WindowTreeClient::OnWindowInputEvent().
244 OnWindowInputEventAck(uint32 event_id, bool handled); 250 OnWindowInputEventAck(uint32 event_id, EventResult result);
245 251
246 // See description of WindowManager for details. 252 // See description of WindowManager for details.
247 GetWindowManagerClient(associated WindowManagerClient& internal); 253 GetWindowManagerClient(associated WindowManagerClient& internal);
248 }; 254 };
249 255
250 // Changes to windows are not sent to the connection that originated the 256 // Changes to windows are not sent to the connection that originated the
251 // change. For example, if connection 1 changes the bounds of a window by 257 // change. For example, if connection 1 changes the bounds of a window by
252 // calling SetWindowBounds(), connection 1 does not receive 258 // calling SetWindowBounds(), connection 1 does not receive
253 // OnWindowBoundsChanged(). 259 // OnWindowBoundsChanged().
254 interface WindowTreeClient { 260 interface WindowTreeClient {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 OnWindowParentDrawnStateChanged(uint32 window, bool drawn); 350 OnWindowParentDrawnStateChanged(uint32 window, bool drawn);
345 351
346 // Invoked when a window property is changed. If this change is a removal, 352 // Invoked when a window property is changed. If this change is a removal,
347 // |new_data| is null. 353 // |new_data| is null.
348 OnWindowSharedPropertyChanged(uint32 window, 354 OnWindowSharedPropertyChanged(uint32 window,
349 string name, 355 string name,
350 array<uint8>? new_data); 356 array<uint8>? new_data);
351 357
352 // Invoked when an event is targeted at the specified window. The client must 358 // Invoked when an event is targeted at the specified window. The client must
353 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify 359 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify
354 // that the event has been processed, and with a boolean |handled| to notify 360 // that the event has been processed, and with an EventResult value to notify
355 // if the event was consumed. The client will not receive farther events until 361 // if the event was consumed. The client will not receive farther events until
356 // the event is ack'ed. 362 // the event is ack'ed.
357 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); 363 OnWindowInputEvent(uint32 event_id, uint32 window, Event event);
358 364
359 // Called in two distinct cases: when a window known to the connection gains 365 // Called in two distinct cases: when a window known to the connection gains
360 // focus, or when focus moves from a window known to the connection to a 366 // focus, or when focus moves from a window known to the connection to a
361 // window not known to the connection. In the later case |focused_window_id| 367 // window not known to the connection. In the later case |focused_window_id|
362 // is 0. As with other functions this is only called if the client did not 368 // is 0. As with other functions this is only called if the client did not
363 // initiate the change. 369 // initiate the change.
364 OnWindowFocused(uint32 focused_window_id); 370 OnWindowFocused(uint32 focused_window_id);
(...skipping 11 matching lines...) Expand all
376 // See description of WindowManager for details. 382 // See description of WindowManager for details.
377 GetWindowManager(associated WindowManager& internal); 383 GetWindowManager(associated WindowManager& internal);
378 }; 384 };
379 385
380 // Mus provides this interface as a way for clients to connect and obtain a 386 // Mus provides this interface as a way for clients to connect and obtain a
381 // WindowTree handle with a supplied WindowTreeClient handle. The 387 // WindowTree handle with a supplied WindowTreeClient handle. The
382 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 388 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
383 interface WindowTreeFactory { 389 interface WindowTreeFactory {
384 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 390 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
385 }; 391 };
OLDNEW
« no previous file with comments | « components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc ('k') | components/mus/ws/window_manager_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698