• Colin Blundell's avatar
    [Android] Create RedirectHandler interface for ExternalNavHandler · 2e43a9bd
    Colin Blundell authored
    We are in the midst of componentizing ExternalNavigationHandler.java for
    reuse by WebLayer. The main remaining //chrome-level dependency is on
    TabRedirectHandler.java. Unlike other dependencies, this dependency can
    neither be easily componentized (it is essentially //chrome-level
    functionality) nor can it be easily abstracted through
    ExternalNavigationDelegate.java. The reason for the latter is that
    the TabRedirectHandler instance is necessarily accessed through the
    ExternalNavigationParams instance as it is tied to the navigation in
    question, and if we were to remove all knowledge of it from
    ExternalNavigationParams, there would be no straightforward way to
    plumb it into //chrome's ExternalNavigationDelegateImpl.
    
    This CL instead creates a RedirectHandler interface that contains the
    methods needed by ExternalNavigationHandler. ExternalNavigationParams
    and ExternalNavigationHandler are changed to talk in terms of this
    interface, which TabRedirectHandler implements. This approach has the
    additional benefit that it leaves existing logic coalesced within
    ExternalNavigationHandler, which will make it easier to adapt this
    logic in the WebLayer context as needed.
    
    For this initial delegate interface, we have preserved the shape of the
    interface to be the exact current usage by
    ExternalNavigationHandler.java. Future work can refine the interface to
    have it be as thin and logical as possible, potentially coalescing some
    low-level methods into a smaller number of higher-level ones.
    
    Bug: 1031465
    Change-Id: I5b9568f371c248e8fd2d52429725ed0a44a098a2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095719
    Commit-Queue: Colin Blundell <blundell@chromium.org>
    Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#748747}
    2e43a9bd
BUILD.gn 417 Bytes