• Elly Fong-Jones's avatar
    mac: add Tab menu · 0d121845
    Elly Fong-Jones authored
    This is a re-upload of
    <https://chromium-review.googlesource.com/c/chromium/src/+/1728718>,
    which got reverted because of <https://crbug.com/990664>.
    
    This change adds a new top-level menu to the system menu, used to
    manipulate and select tabs in the current window. This menu contains
    some static items, moved from the Window menu, and then a list of
    entries corresponding to open tabs in the current window. Specifically,
    this change:
    
    1) Adds a new class, TabMenuBridge, which binds a TabStripModel to a
       NSMenu;
    2) Adds a new menu item to the main menu named "Tab";
    3) Creates a TabMenuBridge for any tabbed browser window in the
       app controller
    
    The motivation for this change was twofold: first, to allow easier
    access to commands that are currently only present in the tab's
    context menu, and second, to allow easier access to tabs in crowded
    tabstrips. The first purpose is well-defined and understood but the
    second is very much experimental.
    
    Testing:
    Build, run, and enjoy the new Tab menu :). There are some unit tests in
    TabMenuBridgeTest.* as well.
    
    Future work:
    * Renaming the static items to better fit their new context. This was
      not done here to avoid breaking existing user key equivalents, which
      identify items by their full name.
    * Exploring other orderings of tabs in this menu.
    * Adding other tab actions to this menu, like "Bookmark" or possibly
      page actions.
    * Adding a search bar to search within tab titles/origins?
    * Adding key equivalents for the static actions (which will resolve
      the actual accessibility bug this commit is for)
    
    Bug: 818261
    Change-Id: I61987f7a64907a3d6ff32a06c0c67b1c2601e055
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728718
    Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarLeonard Grey <lgrey@chromium.org>
    Auto-Submit: Elly Fong-Jones <ellyjones@chromium.org>
    Cr-Original-Commit-Position: refs/heads/master@{#683682}
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1736976
    Cr-Commit-Position: refs/heads/master@{#686199}
    0d121845
global_keyboard_shortcuts_mac_browsertest.mm 9.73 KB