[Android] Fixed code for bookmarking page

Chromium change:
https://github.com/chromium/chromium/commit/f513a189244326df3c97271ebadc4d9ef5d8cfff

Contextual Page Actions: Added price tracking button controller
This CL adds a button controller to provide price tracking related UI
functionality for contextual page actions. The controller will be
instantiated in RootUiCoordinator and hooked up to
ContextualPageActionController in a later CL. Clicking on the button
triggers a bookmark with price tracking toggle flow which is same as
the one from bookmark button in app menu.

It also involves a small refactor that extracts out the bookmarking
related code out of Chrome*Activity into a separate class TabBookmarker.
The bookmarker will be plumbed to the button controller through a
supplier interface through the RootUiCoordinator.

UX: https://docs.google.com/presentation/d/1dz5qgDB5C2W2OEvX9YyPPgsy7sOnJ_MmmkTkK0lMIvw/edit?resourcekey=0-fy2DZAkYWFFM_NWBp8P6fw#slide=id.g125c3ccf3eb_2_163

Bug: 1322001
This commit is contained in:
samartnik
2022-07-22 13:33:54 +01:00
committed by Claudio DeSouza
parent d62ef06dae
commit cfbfc746b8
@@ -84,6 +84,7 @@ import org.chromium.chrome.browser.DormantUsersEngagementDialogFragment;
import org.chromium.chrome.browser.InternetConnection;
import org.chromium.chrome.browser.LaunchIntentDispatcher;
import org.chromium.chrome.browser.app.domain.WalletModel;
import org.chromium.chrome.browser.bookmarks.TabBookmarker;
import org.chromium.chrome.browser.brave_news.models.FeedItemsCard;
import org.chromium.chrome.browser.brave_stats.BraveStatsUtil;
import org.chromium.chrome.browser.browsing_data.BrowsingDataBridge;
@@ -1633,4 +1634,8 @@ public abstract class BraveActivity<C extends ChromeActivityComponent> extends C
assert layout != null;
return layout;
}
public void addOrEditBookmark(final Tab tabToBookmark) {
((TabBookmarker) mTabBookmarkerSupplier.get()).addOrEditBookmark(tabToBookmark);
}
}