• Christopher Cameron's avatar
    Only show profiles that have app installed in PWA profile menu · 4be24bf9
    Christopher Cameron authored
    In order to do this, we will need to know whether or not a PWA is
    installed for a given profile, without actually loading that profile.
    The suggested mechanism for this is to check the for the presence of
    a Extensions/app_id subdirectory of the profile path.
    
    Add a profile_menu_items_ member to ExtensionAppShimHandler that
    lists all profiles in the AvatarMenu.
    
    Add a installed_profiles member to ExtensionAppShimHandler::AppState
    that lists all profiles for which a given app is installed (this is
    a subset of the profiles in ExtensionAppShimHandler::
    profile_menu_items_).
    
    Add a ExtensionAppShimHandler::Delegate::GetProfilesForAppAsync
    method to do the aforementioned path check.
    
    Update ExtensionAppShimHandler::UpdateAppProfileMenu to sort menu
    items by |menu_index| and to send an empty list if just one profile
    would have appeared in the menu.
    
    Add tests. Restructure tests such that ExtensionAppShimHandler
    takes its delegate as a constructor argument (instead of having it
    be set-able).
    
    R=dominickn
    TBR=skuhne
    
    Bug: 1001215
    Change-Id: I10bb7128c6f775759f1d1f381000eb7b33960eb3
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864098Reviewed-by: default avatarccameron <ccameron@chromium.org>
    Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
    Commit-Queue: ccameron <ccameron@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#708792}
    4be24bf9
profile_avatar_icon_util.cc 28.3 KB