Commit 79c38bbb authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Set Data Saver menu item highlight based on Duet on/off

Bug: 944984
Change-Id: I4570d22e914af74bd3f2a4bcc83157eb9e80c060
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538386
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644860}
parent 69a60b13
......@@ -100,13 +100,18 @@ public class ToolbarButtonInProductHelpController implements Destroyable {
mPageLoadObserver.destroy();
}
private static int getDataReductionMenuItemHighlight() {
return FeatureUtilities.isBottomToolbarEnabled() ? R.id.data_reduction_menu_item
: R.id.app_menu_footer;
}
// Attempts to show an IPH text bubble for data saver detail.
private static void maybeShowDataSaverDetail(ChromeActivity activity) {
View anchorView = activity.getToolbarManager().getMenuButton();
if (anchorView == null) return;
setupAndMaybeShowIPHForFeature(FeatureConstants.DATA_SAVER_DETAIL_FEATURE,
R.id.data_reduction_menu_item, false, R.string.iph_data_saver_detail_text,
getDataReductionMenuItemHighlight(), false, R.string.iph_data_saver_detail_text,
R.string.iph_data_saver_detail_accessibility_text, anchorView,
activity.getAppMenuHandler(), Profile.getLastUsedProfile(), activity, null);
}
......@@ -125,9 +130,9 @@ public class ToolbarButtonInProductHelpController implements Destroyable {
promo.onPromoTextSeen();
};
setupAndMaybeShowIPHForFeature(FeatureConstants.DATA_SAVER_MILESTONE_PROMO_FEATURE,
R.id.data_reduction_menu_item, false, promo.getPromoText(), promo.getPromoText(),
anchorView, activity.getAppMenuHandler(), Profile.getLastUsedProfile(), activity,
dismissCallback);
getDataReductionMenuItemHighlight(), false, promo.getPromoText(),
promo.getPromoText(), anchorView, activity.getAppMenuHandler(),
Profile.getLastUsedProfile(), activity, dismissCallback);
}
// Attempts to show an IPH text bubble for page in preview mode.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment