• Elly Fong-Jones's avatar
    cbui: remove CardUnmaskPromptViews CreateFootnoteView · 77c8de16
    Elly Fong-Jones authored
    Whether this control creates a footnote view or not (and the state of the
    footnote view if it does create one) depends on several pieces of state in the
    controller, some of which are only present after the controller's ShowPrompt
    method is called. This change therefore:
    
    1) Changes ShowPrompt to take a factory callback that manufactures the concrete
       View class
    2) Invokes that factory callback once all the state needed for the View is ready
    3) Moves creation of the View's footnote view into the View's constructor, now
       that all the needed state is guaranteed to be available.
    
    This change exposed a bug in the tests: the production code passed ownership of
    a raw pointer in for the View, but the tests instead retain ownership and pass
    in a weak raw pointer. This happens to work because View tolerates being
    destroyed while still parented, but this behavior of View is deprecated. I have
    not fixed this test behavior in this CL to keep the size down.
    
    Bug: 1011446
    Change-Id: I1ad6f12cc59b2f77c75ac81b13f41eae67738205
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1907069
    Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
    Reviewed-by: default avatarJared Saul <jsaul@google.com>
    Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#714625}
    77c8de16
full_card_requester.mm 2.17 KB