• Jason Lin's avatar
    Store PluginVM camera/mic permissions in auto-reset prefs · 215be9c2
    Jason Lin authored
    We are making the permissions persistent across chrome restarts, so we
    have to change the way the permissions are stored (currently, they are
    stored as member variables initialized to false). Note that this CL
    still resets the prefs values to false in
    `PluginVmManagerImpl::OnPrimaryUserProfilePrepared()` because the
    required permission indicators/notifications are not ready yet, so the
    behavior for now is actually going to be the same.
    
    This CL also fixes the bug that pressing <esc> key on the relaunch
    dialog does not recover the toggle state.
    
    This CL also simplfies the code by:
    * removing <plugin-vm-permission-dialog> --- it is simpler to use
      <cr-dialog> directly.
    * replacing `wouldPermissionChangeRequireRelaunch()` with
      `isRelaunchNeededForNewPermissions()` --- The toggle is the only way
      the user can change the value, so there is no need for the c++ code to
      check whether the values are actually different.
    
    Bug: b/167491603
    Change-Id: I423e1d03db6e4d2b52fefc052c22eb4f27733425
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488262
    Commit-Queue: Jason Lin <lxj@google.com>
    Reviewed-by: default avatarJeevan Shikaram <jshikaram@chromium.org>
    Reviewed-by: default avatarcalamity <calamity@chromium.org>
    Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
    Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
    Reviewed-by: default avatarDaniel Ng <danielng@google.com>
    Cr-Commit-Position: refs/heads/master@{#821080}
    215be9c2
plugin_vm_manager.h 2.32 KB