Commit e4e2e513 authored by Pete Williamson's avatar Pete Williamson Committed by Commit Bot

Fix "Learn more" by adding navigateToHelpPage for ExploreSurface.

When we added the explore surface, we did not also override the
navigateToHelpPage method.  This change adds an override to fix
the "Learn More" feature of the discover feed.

The web page we direct the user to is for the NTP, reviewers might want
to check that it still makes sense for the explore surface as part of
this code reivew.

Bug: 1106875
Change-Id: I45c572a5fc75e28bcc927d0625dd6179f6fafd81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315184Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Commit-Queue: Peter Williamson <petewil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791919}
parent 7065d57a
...@@ -16,10 +16,12 @@ import org.chromium.chrome.browser.native_page.NativePageNavigationDelegate; ...@@ -16,10 +16,12 @@ import org.chromium.chrome.browser.native_page.NativePageNavigationDelegate;
import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.start_surface.R; import org.chromium.chrome.start_surface.R;
import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.PageTransition;
import org.chromium.ui.mojom.WindowOpenDisposition; import org.chromium.ui.mojom.WindowOpenDisposition;
/** Implementation of the {@link NativePageNavigationDelegate} for the explore surface. */ /** Implementation of the {@link NativePageNavigationDelegate} for the explore surface. */
class ExploreSurfaceNavigationDelegate implements NativePageNavigationDelegate { class ExploreSurfaceNavigationDelegate implements NativePageNavigationDelegate {
private static final String NEW_TAB_URL_HELP = "https://support.google.com/chrome/?p=new_tab";
private final Context mContext; private final Context mContext;
ExploreSurfaceNavigationDelegate(Context context) { ExploreSurfaceNavigationDelegate(Context context) {
...@@ -50,4 +52,10 @@ class ExploreSurfaceNavigationDelegate implements NativePageNavigationDelegate { ...@@ -50,4 +52,10 @@ class ExploreSurfaceNavigationDelegate implements NativePageNavigationDelegate {
// mode accordingly (note that payment window supports incognito mode). // mode accordingly (note that payment window supports incognito mode).
return null; return null;
} }
@Override
public void navigateToHelpPage() {
openUrl(WindowOpenDisposition.CURRENT_TAB,
new LoadUrlParams(NEW_TAB_URL_HELP, PageTransition.AUTO_BOOKMARK));
}
} }
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