• Vaclav Brozek's avatar
    Serialise passwords for export on Android · a4d802eb
    Vaclav Brozek authored
    This CL prepares the C++ binding for passing exported passwords to the
    Java code controlling Chrome's settings. This consists of:
    
    (1) Extending the PasswordUIViewAndroid C++ class to handle a call to
    start serialising passwords, to spawn a task to copy and serialize the
    passwords on a backend task runner, and to post the result back to
    Java.
    
    (2) Teaching the Java class SavePasswordsPreferences to trigger the
    serialisation when the user taps on the Export menu item.
    
    The changes in (1) specifically make life-time management of
    PasswordUIViewAndroid a little more complex: care is take that the
    class always survives the backend processing. This includes
    introducing a state variable and postponing self-destruction
    in Destroy().
    
    The CL also adds a whole new unittest for PasswordUIViewAndroid and
    one more scenario to the existing SavePasswordsPreferencesTest. The
    code in either language is tested, but passing the information through
    JNI is not, because it is not clear how that would be done.
    
    The format changes to BUILD.gn (beyond introducing the new unittest)
    are unrelated, but a result of the compulsory running of git cl format.
    
    The CL does not introduce any processing of the serialised data in the
    Java code yet (it is currently dropped on receipt). That will come in
    future CLs.
    
    Bug: 788701
    Change-Id: I32bbcb4bf62883d3154b3abf81ea7b076c05e37c
    Reviewed-on: https://chromium-review.googlesource.com/809127
    Commit-Queue: Vaclav Brozek <vabr@chromium.org>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Reviewed-by: default avatarTheresa <twellington@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#530603}
    a4d802eb
password_ui_view_android.cc 8.29 KB