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

cbuiv: remove IdleActionWarningDialogView Cancel override

This cancel override is essentially a no-op now. There is no cancel
button on this dialog so the only call path is via CloseDialog, which
always stops the timer before calling into Cancel, so Cancel was
always returning true. This change removes the Cancel override and
the explicit stop of the timer, which is no longer needed.

Bug: 1011446
Change-Id: Ifa6d42591ebcb4063aae05aa959199f407e50df0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148678Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758962}
parent 5b9183bb
...@@ -58,8 +58,7 @@ IdleActionWarningDialogView::IdleActionWarningDialogView( ...@@ -58,8 +58,7 @@ IdleActionWarningDialogView::IdleActionWarningDialogView(
} }
void IdleActionWarningDialogView::CloseDialog() { void IdleActionWarningDialogView::CloseDialog() {
update_timer_.Stop(); GetWidget()->Close();
CancelDialog();
} }
void IdleActionWarningDialogView::Update(base::TimeTicks idle_action_time) { void IdleActionWarningDialogView::Update(base::TimeTicks idle_action_time) {
...@@ -85,10 +84,6 @@ bool IdleActionWarningDialogView::ShouldShowCloseButton() const { ...@@ -85,10 +84,6 @@ bool IdleActionWarningDialogView::ShouldShowCloseButton() const {
return false; return false;
} }
bool IdleActionWarningDialogView::Cancel() {
return !update_timer_.IsRunning();
}
gfx::Size IdleActionWarningDialogView::CalculatePreferredSize() const { gfx::Size IdleActionWarningDialogView::CalculatePreferredSize() const {
const int default_width = views::LayoutProvider::Get()->GetDistanceMetric( const int default_width = views::LayoutProvider::Get()->GetDistanceMetric(
DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH); DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH);
...@@ -97,8 +92,7 @@ gfx::Size IdleActionWarningDialogView::CalculatePreferredSize() const { ...@@ -97,8 +92,7 @@ gfx::Size IdleActionWarningDialogView::CalculatePreferredSize() const {
GetLayoutManager()->GetPreferredHeightForWidth(this, default_width)); GetLayoutManager()->GetPreferredHeightForWidth(this, default_width));
} }
IdleActionWarningDialogView::~IdleActionWarningDialogView() { IdleActionWarningDialogView::~IdleActionWarningDialogView() = default;
}
void IdleActionWarningDialogView::UpdateTitle() { void IdleActionWarningDialogView::UpdateTitle() {
GetWidget()->UpdateWindowTitle(); GetWidget()->UpdateWindowTitle();
......
...@@ -27,7 +27,6 @@ class IdleActionWarningDialogView : public views::DialogDelegateView { ...@@ -27,7 +27,6 @@ class IdleActionWarningDialogView : public views::DialogDelegateView {
ui::ModalType GetModalType() const override; ui::ModalType GetModalType() const override;
base::string16 GetWindowTitle() const override; base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
bool Cancel() override;
// views::View: // views::View:
gfx::Size CalculatePreferredSize() 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