naiveproxy/ash/public/interfaces/assistant_card_renderer.mojom

40 lines
1.6 KiB
Plaintext
Raw Normal View History

2018-08-11 08:35:24 +03:00
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module ash.mojom;
import "components/account_id/interfaces/account_id.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
// Interface for a class which is responsible for rendering Assistant cards.
interface AssistantCardRenderer {
// Renders a card as defined by the specified |params| for the profile
// associated with |account_id|. Any call to Render should be paired with a
// corresponding call to Release when the card is no longer needed. To this
// end, the caller must supply a identifier by which to uniquely identify a
// card. When the card is ready for embedding, the supplied callback will be
// run providing an unguessable |embed_token| which corresponds uniquely to
// the rendered contents.
Render(signin.mojom.AccountId account_id,
mojo_base.mojom.UnguessableToken id_token, AssistantCardParams params)
=> (mojo_base.mojom.UnguessableToken embed_token);
// Releases any resources associated with card uniquely identified by
// |id_token|.
Release(mojo_base.mojom.UnguessableToken id_token);
// Releases any resources associated with any card uniquely identified by one
// of the specified |id_tokens|.
ReleaseAll(array<mojo_base.mojom.UnguessableToken> id_tokens);
};
// Defines parameters for an Assistant card.
struct AssistantCardParams {
// An HTML data string for the card.
string html;
// The minimum desired width for the card.
int32 min_width_dip;
// The maximum desired width for the card.
int32 max_width_dip;
};