• Connie Wan's avatar
    Add a CreateEmpty() constructor to TabGroupId · 0cfb9adb
    Connie Wan authored
    This is useful for the extensions API, where it's helpful to have something like:
    
        tab_groups::TabGroupId group = tab_groups::TabGroupId::CreateEmpty();
        GetGroupFromId(id, &group);  // Populates group by reference, with an existing value.
        if (!group.is_empty()) {
          // Logic handling the group
        }
    
    Having CreateEmpty() and is_empty() helps make this pattern intentional without accidentally creating empty groups and breaking assumptions in the tabstrip.
    
    Change-Id: Ibb217edfd8ba599023488ea3d1a33277b49d8284
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2415573Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
    Commit-Queue: Connie Wan <connily@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#808028}
    0cfb9adb
tab_group_id.h 1.31 KB