Commit 56759c7c authored by Mehran Mahmoudi's avatar Mehran Mahmoudi Committed by Commit Bot

[TTS] Update IPH strings for Contextual Search

Change In-Product Help UI strings (http://go/cs-iph-strings).
Also fix a bug in IPH that caused a NullPointerExcepetion.

Bug: 784561
Change-Id: Icad33dbacc12d8c4d186b119f90c6262ac0cf976
Reviewed-on: https://chromium-review.googlesource.com/769678
Commit-Queue: Mehran Mahmoudi <mahmoudi@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517537}
parent 44ad510c
......@@ -25,6 +25,7 @@ import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost;
import org.chromium.chrome.browser.compositor.scene_layer.ContextualSearchSceneLayer;
import org.chromium.chrome.browser.compositor.scene_layer.SceneOverlayLayer;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDelegate;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.util.MathUtils;
import org.chromium.ui.base.LocalizationUtils;
import org.chromium.ui.resources.ResourceManager;
......@@ -194,7 +195,7 @@ public class ContextualSearchPanel extends OverlayPanel {
PanelState fromState = getPanelState();
mPanelMetrics.onPanelStateChanged(
fromState, toState, reason, mActivity.getActivityTab().getProfile());
fromState, toState, reason, Profile.getLastUsedProfile().getOriginalProfile());
if (toState == PanelState.PEEKED
&& (fromState == PanelState.CLOSED || fromState == PanelState.UNDEFINED)) {
......
......@@ -33,6 +33,7 @@ import org.chromium.chrome.browser.externalnav.ExternalNavigationParams;
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
import org.chromium.chrome.browser.gsa.GSAContextDisplaySelection;
import org.chromium.chrome.browser.infobar.InfoBarContainer;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabRedirectHandler;
import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver;
......@@ -401,7 +402,7 @@ public class ContextualSearchManager
mSearchRequest = null;
mInProductHelp.dismiss(mActivity.getActivityTab().getProfile());
mInProductHelp.dismiss(Profile.getLastUsedProfile().getOriginalProfile());
if (mIsShowingPromo && !mDidLogPromoOutcome && mSearchPanel.wasPromoInteractive()) {
ContextualSearchUma.logPromoOutcome(mWasActivatedByTap, mIsMandatoryPromo);
......@@ -486,7 +487,7 @@ public class ContextualSearchManager
mWereSearchResultsSeen = false;
mInProductHelp.beforePanelShown(
isTap, mPolicy.isTapSupported(), mActivity.getActivityTab().getProfile());
isTap, mPolicy.isTapSupported(), Profile.getLastUsedProfile().getOriginalProfile());
// Note: now that the contextual search has properly started, set the promo involvement.
if (mPolicy.isPromoAvailable()) {
......@@ -718,11 +719,11 @@ public class ContextualSearchManager
mReceivedContextualCardsEntityData = !quickActionShown && receivedCaptionOrThumbnail;
if (mReceivedContextualCardsEntityData) {
Tracker tracker =
TrackerFactory.getTrackerForProfile(mActivity.getActivityTab().getProfile());
Tracker tracker = TrackerFactory.getTrackerForProfile(
Profile.getLastUsedProfile().getOriginalProfile());
tracker.notifyEvent(EventConstants.CONTEXTUAL_SEARCH_ENTITY_RESULT);
mInProductHelp.onEntityDataReceived(
mWasActivatedByTap, mActivity.getActivityTab().getProfile());
mWasActivatedByTap, Profile.getLastUsedProfile().getOriginalProfile());
}
ContextualSearchUma.logContextualCardsDataShown(mReceivedContextualCardsEntityData);
......@@ -1232,12 +1233,13 @@ public class ContextualSearchManager
@Override
public void onPanelFinishedShowing() {
mInProductHelp.onPanelFinishedShowing(
mWasActivatedByTap, mActivity.getActivityTab().getProfile());
mWasActivatedByTap, Profile.getLastUsedProfile().getOriginalProfile());
}
@Override
public void onPanelExpandedOrMaximized() {
mInProductHelp.onPanelExpandedOrMaximized(mActivity.getActivityTab().getProfile());
mInProductHelp.onPanelExpandedOrMaximized(
Profile.getLastUsedProfile().getOriginalProfile());
}
/**
......
......@@ -2795,14 +2795,14 @@ However, you aren’t invisible. Going incognito doesn’t hide your browsing fr
<message name="IDS_CONTEXTUAL_SEARCH_QUICK_ACTION_CAPTION_GENERIC_WEBSITE" desc="Caption displayed in the Contextual Search bar prompting the user to navigate to a web page.">
Go to page
</message>
<message name="IDS_CONTEXTUAL_SEARCH_IPH_ENTITY" desc="The in-product-help message for encouraging users to open the Contextual Search panel to learn to more about the phrase they have tapped on. This is a placeholder while the string is being finalized. Do not translate for now.">
Open this panel to find more information
<message name="IDS_CONTEXTUAL_SEARCH_IPH_ENTITY" desc="An in-product-help message for the Touch to Search feature on Chrome Android. The message encourages users to open a panel that contains search results for the word or phrase they tapped on.">
See instant search results in this panel
</message>
<message name="IDS_CONTEXTUAL_SEARCH_IPH_SEARCH_RESULT" desc="The in-product-help message for encouraging users to open the Contextual Search panel to see related results about a phrase they have selected. This is a placeholder while the string is being finalized. Do not translate for now.">
Open this panel to find related search results
<message name="IDS_CONTEXTUAL_SEARCH_IPH_SEARCH_RESULT" desc="An in-product-help message for the Touch to Search feature. It encourages users to open the Touch to Search panel to see search results for a word or phrase they have tapped.">
Tap a word to search instantly or see related actions
</message>
<message name="IDS_CONTEXTUAL_SEARCH_IPH_TAP" desc="The in-product-help message for encouraging users to tap instead of long pressing for triggeting Contextual Search. This is a placeholder while the string is being finalized. Do not translate for now.">
You can also search with one tap
<message name="IDS_CONTEXTUAL_SEARCH_IPH_TAP" desc="An in-product-help message for encouraging users to tap instead of long pressing to trigger the Touch to Search feature.">
You can also search with a quick tap on a word
</message>
<!-- Web apps -->
......
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