• Pavel Shmakov's avatar
    Extract url navigation and observer management out of · 57c21ec7
    Pavel Shmakov authored
    CustomTabActivityTabController
    
    Extracting CustomTabNavigationController will consist of (at least) two
    steps:
    - Extracting navigate() method
    - Extracting back/close navigation
    
    This CL is the first step. Currently the url navigation code is in
    CustomTabActivityTabController#loadUrlInTab. In addition to exposing
    this public method, the TabController also calls it itself to load the
    initial url when the tab is ready. Both of these things are not good
    from single responsibility perspective, and need a separate class each.
    
    To achieve that it became necessary to expose the way the initial tab
    was created and update the Observer interface correspondingly. To keep
    things tidy, holding onto the Tab, the creation method, and observer
    management was extracted into CustomTabActivityTabProvider (this is
    something we were planning to do eventually anyway).
    
    In this CL the code becomes structured as follows:
    
    TabController - minds the tab creation and initialization business, no
    longer navigates to any urls. Updates TabProvider (via package-local
    methods).
    
    TabProvider - hold the current tab and information about how the
    initial tab was created. Dispatches changes to observers. Typically,
    the features should only need to use TabProvider, but not
    TabController.
    
    NavigationController - navigates to urls. Will also contain back/close
    navigation in future.
    
    InitialPageLoader - observes TabController and commands
    NavigationController to navigate to the initial url.
    
    Bug: 916528
    Change-Id: Ic26ef955ab8e3e0bd926461c71ef740361686f17
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530884
    Commit-Queue: Pavel Shmakov <pshmakov@chromium.org>
    Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
    Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#645309}
    57c21ec7
chrome_junit_test_java_sources.gni 15.9 KB