web_page_info.mojom 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2021 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 "mojo/public/mojom/base/unguessable_token.mojom";
  6. [Stable]
  7. struct WebPageInfo {
  8. int64 source_id@0;
  9. string domain@1;
  10. int32 engagement_score@2;
  11. bool has_form_entry@3;
  12. };
  13. // Interface for web page info. Implemented by lacros-chrome. Used by
  14. // ash-chrome to request current active/visible web page info in lacros-chrome
  15. // and use it as features for smart dim.
  16. // Next version: 1
  17. // Next method id: 1
  18. [Stable, Uuid="c361e03d-fd15-4313-84bf-32f6a527b28c"]
  19. interface WebPageInfoProvider {
  20. // Gets the topmost browser window's web page info from the current visible
  21. // tab.
  22. RequestCurrentWebPageInfo@0() => (WebPageInfo? web_page_info);
  23. };
  24. // A factory living in the Ash process which brokers connections to other
  25. // processes for web page info.
  26. // Next version: 1
  27. // Next method id: 1
  28. [Stable, Uuid="49a6b334-fbef-4887-ad01-570dd3688bdb"]
  29. interface WebPageInfoFactory {
  30. // A crosapi client (i.e. lacros chrome) can register itself as a web page
  31. // info provider. This enables ash to get web page info data from lacros.
  32. RegisterWebPageInfoProvider
  33. @0(pending_remote<WebPageInfoProvider> web_page_info_provider);
  34. };