blob: af2de5c398b4b1a249b6d9e5c5041dc588e77c44 [file] [log] [blame]
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module contextual_tasks.mojom;
import "mojo/public/mojom/base/uuid.mojom";
import "url/mojom/url.mojom";
// The interface that defines the webui (typescript/renderer) to browser process
// communication channel. This is primarily used to notify the browser of user
// actions on the page (e.g. UI changes or requests for new data).
interface PageHandler {
// Provides a URL for an AI thread (e.g. with Gemini or search AI mode) to
// the WebUI to load in the hosted webview element.
GetThreadUrl() => (url.mojom.Url url);
// Gets a URL for the provided task ID. This method should primarily be used
// in the init flow for the feature, after a query is intercepted from UI like
// the omnibox and we don't yet have a thread ID.
GetUrlForTask(mojo_base.mojom.Uuid uuid) => (url.mojom.Url url);
// Sets the task ID for the WebUI instance running the feature.
SetTaskId(mojo_base.mojom.Uuid uuid);
// Set the title of the active thread.
SetThreadTitle(string title);
// Notify the browser when the UI is ready to show.
ShowUi();
};
// The interface that defines the browser process to webui (typescript/renderer)
// communication channel. This is primarily used to notify the page if something
// changes on the browser side (e.g. the data model) not directly caused by an
// interation on the page.
interface Page {
// TODO(445841345): Add browser-to-page functionality.
};
// Used to bootstrip bi-directional communication between the browser and webui.
interface PageHandlerFactory {
CreatePageHandler(
pending_remote<Page> page,
pending_receiver<PageHandler> page_handler);
};