Commit 9e169edb authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Re-use PluginVmInstaller::InstallingState in PluginVmInstallerView

This CL makes PluginVmInstallerView re-use from PluginVmInstaller the
enum indicating installer progress. This somewhat reduces the code that
needs to be written when adding new steps in the installation flow,
but more importantly allows a subsequent CL, crrev.com/c/2214586, to
simplify the installer's observer interface so the UI will only need
to be concerned with what to display to the user for a given state.

Bug: 1063748
Change-Id: I5ce64bb7d641f221af822d4737e35fb21de8d589
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213651Reviewed-by: default avatarJulian Watson <juwa@google.com>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772119}
parent 2b3de4bf
......@@ -55,21 +55,16 @@ class PluginVmInstallerView : public views::BubbleDialogDelegateView,
base::OnceCallback<void(bool success)> callback);
private:
// TODO(crbug.com/1063748): Re-use PluginVmInstaller::InstallingState.
enum class State {
CONFIRM_INSTALL, // Waiting for user to start installation.
CHECKING_LICENSE, // Ensuring the user license is valid.
CHECKING_DISK_SPACE, // Checking there is available free disk space.
LOW_DISK_SPACE, // Prompt user to continue or abort due to low disk space.
DOWNLOADING_DLC, // PluginVm DLC downloading and installing in progress.
CHECKING_VMS, // Checking for existing VMs.
DOWNLOADING, // Image download (ISO or VM) is in progress.
IMPORTING, // Downloaded image is being imported.
CREATED, // A brand new VM has been created using ISO image.
IMPORTED, // Downloaded VM image has been imported successfully.
ERROR, // Something unexpected happened.
kConfirmInstall, // Waiting for user to start installation.
kInstalling, // Installation in progress.
kCreated, // A brand new VM has been created using ISO image.
kImported, // Downloaded VM image has been imported successfully.
kError, // Something unexpected happened.
};
using InstallingState = plugin_vm::PluginVmInstaller::InstallingState;
~PluginVmInstallerView() override;
int GetCurrentDialogButtons() const;
......@@ -97,7 +92,8 @@ class PluginVmInstallerView : public views::BubbleDialogDelegateView,
views::ImageView* big_image_ = nullptr;
base::TimeTicks setup_start_tick_;
State state_ = State::CONFIRM_INSTALL;
State state_ = State::kConfirmInstall;
InstallingState installing_state_ = InstallingState::kInactive;
base::Optional<plugin_vm::PluginVmInstaller::FailureReason> reason_;
base::OnceCallback<void(bool success)> finished_callback_for_testing_;
......
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