// 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 extensions_bar.mojom; import "components/browser_apis/ui_controllers/toolbar/extensions_bar_data_model.mojom"; import "components/browser_apis/ui_controllers/toolbar/toolbar_ui_api_data_model.mojom"; import "components/browser_apis/ui_controllers/toolbar/icon_handle.mojom"; import "ui/base/mojom/menu_source_type.mojom"; // Used by the WebUI page to bootstrap bidirectional communication. // At most a single connection is expected to exist at a time, but it // may be broken and re-established (e.g. if the UI is reloaded via // devtools). interface PageHandlerFactory { // The WebUI calls this method when the page is first initialized. CreatePageHandler(pending_remote page, pending_receiver handler); }; // Browser-side handler for requests from WebUI page. interface PageHandler { // Runs the action with given ID. ExecuteUserAction(string id); // Show the context menu for the toolbar button corresponding to the // given action ID. `source` denotes the type of input that produced the // request. ShowContextMenu(ui.mojom.MenuSourceType source, string id); // Asks the browser to flip show/hide status of extensions menu. ToggleExtensionsMenuFromWebUI(); }; // WebUI-side handler for requests from the browser. interface Page { // Called when new actions are added or existing actions changed. ActionsAddedOrUpdated(array icons, array actions); // Called when an action is removed. ActionRemoved(array icons, string id); // Called when an action has been popped out. The callback is expected to // be called when it's safe to anchor things to newly-visible button. // // There will also be an ActionsAddedOrUpdated before this message. ActionPoppedOut() => (); };