chromium/chromeos/crosapi/mojom/web_page_info.mojom

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module crosapi.mojom;

[Stable]
struct WebPageInfo {
  int64  source_id@0;
  string domain@1;
  int32 engagement_score@2;
  bool has_form_entry@3;
};

// Interface for web page info. Implemented by lacros-chrome. Used by
// ash-chrome to request current active/visible web page info in lacros-chrome
// and use it as features for smart dim.
// Next version: 1
// Next method id: 1
[Stable, Uuid="c361e03d-fd15-4313-84bf-32f6a527b28c"]
interface WebPageInfoProvider {
  // Gets the topmost browser window's web page info from the current visible
  // tab.
  RequestCurrentWebPageInfo@0() => (WebPageInfo? web_page_info);
};

// A factory living in the Ash process which brokers connections to other
// processes for web page info.
// Next version: 1
// Next method id: 1
[Stable, Uuid="49a6b334-fbef-4887-ad01-570dd3688bdb"]
interface WebPageInfoFactory {
  // A crosapi client (i.e. lacros chrome) can register itself as a web page
  // info provider. This enables ash to get web page info data from lacros.
  RegisterWebPageInfoProvider
      @0(pending_remote<WebPageInfoProvider> web_page_info_provider);
};