• Mikel Astiz's avatar
    Avoid a proxy tab helper on Android for sync delegation · 42c62276
    Mikel Astiz authored
    Prior to this patch, TabContentsSyncedTabDelegate was itself a tab
    helper (WebContentsUserData) that was created on all platforms, with the
    whole purpose to reuse a partial implementation of
    sync_sessions::SyncedTabDelegate.
    
    This was a bit weird because
    a) The life cycle diverges across platforms: created lazily on Android,
       early otherwise.
    b) On Android there was no real need to register a tab helper.
    c) On Android, it's weird to reason about two tab delegates coexisting,
       one of which is a proxy but also overrides some logic.
    
    Instead, let's make TabContentsSyncedTabDelegate a base class that is
    *NOT* a WebContentsUserData, and let platform-specific subclasses
    decide whether they want to register as WebContentsUserData, as well
    as which logic they need to override.
    
    This also removes code that is dead on some platforms, because the
    base class is abtract and doesn't implements all methods (as opposed
    to a proxy object which cannot be abstract).
    
    Bug: 851905
    Change-Id: I305ad85e2392fdd2ce428c0464b7750ac599babf
    Reviewed-on: https://chromium-review.googlesource.com/1097405
    Commit-Queue: Mikel Astiz <mastiz@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarMarc Treib <treib@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#567213}
    42c62276
media_router_android.cc 11 KB