Don't save file transfers in elevated contexts.

On Windows, impersonate the logged-in user (if any) before writing
the file, aborting if impersonation fails, such as if at the log-in
screen where there's no logged-in user.

On MacOS, abort the transfer if running as root, which signifies that
the host is running on the log-in screen.

Note that this will not prevent uploads on the lock screen, as the OS
still considers the user to be logged in, in that case.

Bug: 679313
Change-Id: I8031473547c180e377ad858221de1ad2711813f8
Reviewed-on: https://chromium-review.googlesource.com/c/1398382
Commit-Queue: Erik Jensen <rkjnsn@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623844}
17 files changed