[cr142][Android] New arg navigationFulfillmentTypeSupplier at LocationBarMediator.ctor

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2747c27c571886bc1a646c4ab9eb1fa46c4b29fd

	Use event-driven supplier for fulfillment type

	Replace the polling-based `isUsingAiMode()` method with an event-driven
	`ObservableSupplier` that reports the `NavigationFulfillmentType`.

	This refactoring allows consumers like the LocationBar and Autocomplete
	systems to react dynamically to changes in the fulfillment mode (e.g.,
	switching between DEFAULT and AI_MODE) without needing to continuously
	poll for the current state.

	As a direct benefit, the LocationBar now observes this supplier to
	hide the Lens button when the fulfillment type is AI_MODE, ensuring
	the UI accurately reflects the available actions.

	Bug: 436888404
	Change-Id: Iae4df3f4fc6f5d2e298765a823b3ad61aa9f1512
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6943716
This commit is contained in:
AlexeyBarabash
2025-10-15 20:30:58 -04:00
committed by Emerick Rogul
parent 2289e4d283
commit 8104ebdf2b
2 changed files with 8 additions and 3 deletions
@@ -20,6 +20,7 @@ import org.chromium.build.annotations.NullUnmarked;
import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
import org.chromium.chrome.browser.lens.LensController;
import org.chromium.chrome.browser.locale.LocaleManager;
import org.chromium.chrome.browser.omnibox.navattach.NavigationFulfillmentType;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.theme.ThemeUtils;
@@ -64,7 +65,9 @@ public class BraveLocationBarMediator extends LocationBarMediator {
OmniboxSuggestionsDropdownEmbedderImpl dropdownEmbedder,
@Nullable ObservableSupplier<TabModelSelector> tabModelSelectorSupplier,
@Nullable BrowserControlsStateProvider browserControlsStateProvider,
Supplier<ModalDialogManager> modalDialogManagerSupplier) {
Supplier<ModalDialogManager> modalDialogManagerSupplier,
ObservableSupplier<@NavigationFulfillmentType Integer>
navigationFulfillmentTypeSupplier) {
super(
context,
locationBarLayout,
@@ -83,7 +86,8 @@ public class BraveLocationBarMediator extends LocationBarMediator {
dropdownEmbedder,
tabModelSelectorSupplier,
browserControlsStateProvider,
modalDialogManagerSupplier);
modalDialogManagerSupplier,
navigationFulfillmentTypeSupplier);
}
public static Class<OmniboxUma> getOmniboxUmaClass() {