desk_template.mojom 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module crosapi.mojom;
  5. import "ui/base/mojom/ui_base_types.mojom";
  6. import "ui/gfx/geometry/mojom/geometry.mojom";
  7. import "url/mojom/url.mojom";
  8. import "ui/gfx/image/mojom/image.mojom";
  9. // Additional state of the browser in the single Lacros window for saving in the
  10. // desk template.
  11. [Stable]
  12. struct DeskTemplateState {
  13. // URLs in the tab strip.
  14. array<url.mojom.Url> urls@0;
  15. // Index of the active tab.
  16. uint32 active_index@1;
  17. [MinVersion=2] string? browser_app_name@2;
  18. [MinVersion=3] int64 restore_window_id@3;
  19. };
  20. // Interface for desk template clients. Implemented by lacros-chrome.
  21. // Next version: 4
  22. // Next method id: 3
  23. [Stable]
  24. interface DeskTemplateClient {
  25. // Creates a browser from the desk template data.
  26. [MinVersion=1]
  27. CreateBrowserWithRestoredData@1(gfx.mojom.Rect bounds,
  28. ui.mojom.WindowShowState initial_show_state,
  29. DeskTemplateState state);
  30. // Returns state of the tab strip model in the browser window identified by
  31. // |window_unique_id|.
  32. GetTabStripModelUrls@0(uint32 serial, string window_unique_id) => (
  33. uint32 serial, string window_unique_id, DeskTemplateState? state);
  34. // Gets the image of the favicon associated with `url`. Returns an empty
  35. // image if the favicon cannot be found.
  36. [MinVersion=3]
  37. GetFaviconImage@2(url.mojom.Url url) => (gfx.mojom.ImageSkia? image);
  38. };
  39. // Interface for desk template. Implemented by ash-chrome.
  40. // Next version: 1
  41. // Next method id: 1
  42. [Stable, Uuid="7566edd4-358d-44b6-b71c-9eb87c632271"]
  43. interface DeskTemplate {
  44. // Registers the client that lives in lacros-chrome.
  45. AddDeskTemplateClient@0(pending_remote<DeskTemplateClient> client);
  46. };