Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4200)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java

Issue 1568813002: Let clients update icons for buttons on bottombar through service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bottom_bar
Patch Set: tag->id Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
index 7fd0d7d4ccb9a5344e9fd0290496ddf1dea67af8..3447ca0f6f1cbd119911d21dddaebe834854fca4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -237,6 +237,19 @@ public class CustomTabIntentDataProvider {
}
/**
+ * @return The {@link CustomButtonParams} having the given id. Returns null if no such params
+ * can be found.
+ */
+ public CustomButtonParams getButtonParamsForId(int id) {
+ for (CustomButtonParams params : mCustomButtonParams) {
+ // A custom button params will always carry an ID. If the client calls updateVisuals()
+ // without an id, we will assign the toolbar action button id to it.
+ if (id == params.getId()) return params;
+ }
+ return null;
+ }
+
+ /**
* @return Titles of menu items that were passed from client app via intent.
*/
public List<String> getMenuTitles() {

Powered by Google App Engine
This is Rietveld 408576698