Commit 5d4c8ba2 authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Always cancel Plugin VM installation when the installer dialog is closed

Currently closing the Plugin VM installer dialog cancels installation
only if the cancel button is clicked. Clicking the X or hitting escape
doesn't cancel the install, leading to weird states if the user then
opens the dialog again.

This CL moves the logic for cancelling the installation to the dialog's
destructor, ensuring we always properly cancel the installation.

Bug: b/169973809
Change-Id: I3390e88effac6553e76e78c1509315250cb6ff18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462897
Commit-Queue: Timothy Loh <timloh@chromium.org>
Reviewed-by: default avatarJason Lin <lxj@google.com>
Cr-Commit-Position: refs/heads/master@{#816358}
parent 7983efc7
......@@ -212,10 +212,6 @@ bool PluginVmInstallerView::Accept() {
}
bool PluginVmInstallerView::Cancel() {
// We call |Cancel()| if the user hasn't started installation to log to UMA.
if (state_ == State::kConfirmInstall || state_ == State::kInstalling)
plugin_vm_installer_->Cancel();
return true;
}
......@@ -435,6 +431,9 @@ void PluginVmInstallerView::SetFinishedCallbackForTesting(
PluginVmInstallerView::~PluginVmInstallerView() {
plugin_vm_installer_->RemoveObserver();
// We call |Cancel()| if the user hasn't started installation to log to UMA.
if (state_ == State::kConfirmInstall || state_ == State::kInstalling)
plugin_vm_installer_->Cancel();
g_plugin_vm_installer_view = nullptr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment