• Kurt Horimoto's avatar
    [iOS] Update BadgeMediator to take a Browser. · 78d2f344
    Kurt Horimoto authored
    This CL updates BadgeMediator to be constructed with a Browser in
    preparation for a follow-up CL where the mediator will observe the
    OverlayPresenter for the Browser in order to update the
    InfobarBadgeTabHelper for banner presentations and dismissals.
    
    This CL also cleans up and updates the mediator:
    - Adds readwrite property for the active WebState, allowing easy
      access to the WebState as well as facilitating idempotent updates
      via |-updateForNewWebState:oldWebState:|.
    - Adds a readonly property for the active WebState's
      InfobarBadgeTabHelper.
    - Since a Browser's BrowserState is constant over the Browser's
      lifetime, we don't need to check whether the newly-activated
      WebState is incognito.  Instead, the incognito badge item is just
      created once upon initialization.
    - Updates order of protocol implementations to match declaration
      order.
    - Updates test fixture to use params so that both the incognito and
      normal browsing behavior can be tested.
    
    Bug: 1030357
    Change-Id: If7a5b4761ea4fd8e558120d1cfc14eb806c75290
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986860
    Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
    Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
    Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#728740}
    78d2f344
badge_mediator.h 1.12 KB