Commit 137ddfbe authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cbuiv: remove all GetDialogButtons overrides in crostini

Bug: 1011446
Change-Id: I8ad4f0f0c0765a53f5ff618842c147da9284d70d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993902Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730171}
parent 40121f83
......@@ -39,10 +39,6 @@ void CrostiniAppRestartView::Show(const ash::ShelfID& id, int64_t display_id) {
chrome::RecordDialogCreation(chrome::DialogIdentifier::CROSTINI_APP_RESTART);
}
int CrostiniAppRestartView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK;
}
bool CrostiniAppRestartView::ShouldShowCloseButton() const {
return false;
}
......
......@@ -15,7 +15,6 @@ class CrostiniAppRestartView : public views::DialogDelegateView {
static void Show(const ash::ShelfID& id, int64_t display_id);
// views::DialogDelegateView:
int GetDialogButtons() const override;
bool ShouldShowCloseButton() const override;
bool Accept() override;
gfx::Size CalculatePreferredSize() const override;
......
......@@ -39,10 +39,6 @@ void CrostiniAppUninstallerView::Show(Profile* profile,
->Show();
}
int CrostiniAppUninstallerView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
base::string16 CrostiniAppUninstallerView::GetWindowTitle() const {
return l10n_util::GetStringUTF16(
IDS_CROSTINI_APPLICATION_UNINSTALL_CONFIRM_TITLE);
......
......@@ -21,7 +21,6 @@ class CrostiniAppUninstallerView : public views::BubbleDialogDelegateView {
static void Show(Profile* profile, const std::string& app_id);
// views::DialogDelegateView:
int GetDialogButtons() const override;
base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override;
bool Accept() override;
......
......@@ -57,10 +57,6 @@ ui::ModalType CrostiniForceCloseView::GetModalType() const {
return ui::ModalType::MODAL_TYPE_WINDOW;
}
int CrostiniForceCloseView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
bool CrostiniForceCloseView::ShouldShowCloseButton() const {
return false;
}
......
......@@ -35,7 +35,6 @@ class CrostiniForceCloseView : public views::BubbleDialogDelegateView {
bool Accept() override;
ui::ModalType GetModalType() const override;
bool ShouldShowCloseButton() const override;
int GetDialogButtons() const override;
base::string16 GetWindowTitle() const override;
gfx::Size CalculatePreferredSize() const override;
......
......@@ -32,10 +32,6 @@ void CrostiniPackageInstallFailureView::Show(const std::string& error_message) {
->Show();
}
int CrostiniPackageInstallFailureView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK;
}
bool CrostiniPackageInstallFailureView::ShouldShowCloseButton() const {
return false;
}
......@@ -54,6 +50,7 @@ gfx::Size CrostiniPackageInstallFailureView::CalculatePreferredSize() const {
CrostiniPackageInstallFailureView::CrostiniPackageInstallFailureView(
const std::string& error_message) {
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_OK);
views::LayoutProvider* provider = views::LayoutProvider::Get();
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical,
......
......@@ -15,7 +15,6 @@ class CrostiniPackageInstallFailureView
// BubbleDialogDelegateView overrides.
bool ShouldShowCloseButton() const override;
int GetDialogButtons() const override;
base::string16 GetWindowTitle() const override;
gfx::Size CalculatePreferredSize() const override;
......
......@@ -50,19 +50,6 @@ void CrostiniUninstallerView::Show(Profile* profile) {
g_crostini_uninstaller_view->GetWidget()->Show();
}
int CrostiniUninstallerView::GetDialogButtons() const {
switch (state_) {
case State::PROMPT:
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
case State::UNINSTALLING:
return ui::DIALOG_BUTTON_NONE;
case State::ERROR:
return ui::DIALOG_BUTTON_CANCEL;
}
NOTREACHED();
return 0;
}
base::string16 CrostiniUninstallerView::GetWindowTitle() const {
const base::string16 device_type = ui::GetChromeOSDeviceName();
return l10n_util::GetStringUTF16(IDS_CROSTINI_UNINSTALLER_TITLE);
......@@ -74,6 +61,7 @@ bool CrostiniUninstallerView::ShouldShowCloseButton() const {
bool CrostiniUninstallerView::Accept() {
state_ = State::UNINSTALLING;
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_NONE);
message_label_->SetText(
l10n_util::GetStringUTF16(IDS_CROSTINI_UNINSTALLER_UNINSTALLING_MESSAGE));
......@@ -140,6 +128,7 @@ CrostiniUninstallerView::~CrostiniUninstallerView() {
void CrostiniUninstallerView::HandleError(const base::string16& error_message) {
state_ = State::ERROR;
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_CANCEL);
message_label_->SetVisible(true);
message_label_->SetText(error_message);
progress_bar_->SetVisible(false);
......
......@@ -34,7 +34,6 @@ class CrostiniUninstallerView : public views::BubbleDialogDelegateView {
static void Show(Profile* profile);
// views::DialogDelegateView:
int GetDialogButtons() const override;
base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override;
bool Accept() override;
......
......@@ -46,10 +46,6 @@ void CrostiniUpdateComponentView::Show(Profile* profile) {
g_crostini_upgrade_view->GetWidget()->Show();
}
int CrostiniUpdateComponentView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK;
}
base::string16 CrostiniUpdateComponentView::GetWindowTitle() const {
return l10n_util::GetStringUTF16(IDS_CROSTINI_TERMINA_UPDATE_REQUIRED);
}
......@@ -72,6 +68,8 @@ CrostiniUpdateComponentView::GetActiveViewForTesting() {
}
CrostiniUpdateComponentView::CrostiniUpdateComponentView() {
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_OK);
views::LayoutProvider* provider = views::LayoutProvider::Get();
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical,
......
......@@ -20,7 +20,6 @@ class CrostiniUpdateComponentView : public views::BubbleDialogDelegateView {
static void Show(Profile* profile);
// views::DialogDelegateView:
int GetDialogButtons() const override;
base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override;
gfx::Size CalculatePreferredSize() const override;
......
......@@ -90,10 +90,6 @@ void CrostiniUpdateFilesystemView::Show(Profile* profile) {
g_crostini_update_filesystem_view_dialog->GetWidget()->Show();
}
int CrostiniUpdateFilesystemView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK;
}
base::string16 CrostiniUpdateFilesystemView::GetWindowTitle() const {
return l10n_util::GetStringUTF16(IDS_CROSTINI_UPGRADING_LABEL);
}
......@@ -118,6 +114,8 @@ CrostiniUpdateFilesystemView::GetActiveViewForTesting() {
CrostiniUpdateFilesystemView::CrostiniUpdateFilesystemView() {
constexpr int kDialogSpacingVertical = 32;
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_OK);
views::LayoutProvider* provider = views::LayoutProvider::Get();
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical,
......
......@@ -20,7 +20,6 @@ class CrostiniUpdateFilesystemView : public views::BubbleDialogDelegateView {
static void Show(Profile* profile);
// views::DialogDelegateView:
int GetDialogButtons() const override;
base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override;
gfx::Size CalculatePreferredSize() const override;
......
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