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

cbuiv: remove some GetDialogButtons overrides

They are replaced with the new setters.

Bug: 1011446
Change-Id: I1c4bcb1853e4ae43d043135bc7f3fbf534aca66f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007649Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732943}
parent 7832cb0b
......@@ -80,16 +80,15 @@ class BaseDialogContainer : public views::DialogDelegateView {
BaseDialogContainer(std::unique_ptr<views::View> dialog_body,
const base::Closure& close_callback)
: dialog_body_(AddChildView(std::move(dialog_body))),
close_callback_(close_callback) {}
close_callback_(close_callback) {
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_NONE);
}
~BaseDialogContainer() override {}
protected:
views::View* dialog_body() { return dialog_body_; }
private:
// Overridden from views::DialogDelegate:
int GetDialogButtons() const override { return ui::DIALOG_BUTTON_NONE; }
// Overridden from views::WidgetDelegate:
ui::ModalType GetModalType() const override { return kModalType; }
void WindowClosing() override {
......
......@@ -42,6 +42,7 @@ AppPauseDialogView::AppPauseDialogView(
apps::AppServiceProxy::OnPauseDialogClosedCallback closed_callback)
: BubbleDialogDelegateView(nullptr, views::BubbleBorder::NONE),
closed_callback_(std::move(closed_callback)) {
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_OK);
ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal,
......@@ -79,10 +80,6 @@ gfx::Size AppPauseDialogView::CalculatePreferredSize() const {
return gfx::Size(default_width, GetHeightForWidth(default_width));
}
int AppPauseDialogView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK;
}
ui::ModalType AppPauseDialogView::GetModalType() const {
return ui::MODAL_TYPE_SYSTEM;
}
......
......@@ -28,7 +28,6 @@ class AppPauseDialogView : public views::BubbleDialogDelegateView {
// views::BubbleDialogDelegateView:
bool Accept() override;
gfx::Size CalculatePreferredSize() const override;
int GetDialogButtons() const override;
ui::ModalType GetModalType() const override;
base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override;
......
......@@ -43,10 +43,6 @@ base::string16 NativeFileSystemRestrictedDirectoryDialogView::GetWindowTitle()
: IDS_NATIVE_FILE_SYSTEM_RESTRICTED_FILE_TITLE);
}
int NativeFileSystemRestrictedDirectoryDialogView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
bool NativeFileSystemRestrictedDirectoryDialogView::ShouldShowCloseButton()
const {
return false;
......
......@@ -47,7 +47,6 @@ class NativeFileSystemRestrictedDirectoryDialogView
// views::DialogDelegateView:
base::string16 GetWindowTitle() const override;
int GetDialogButtons() const override;
bool ShouldShowCloseButton() const override;
bool Accept() override;
bool Cancel() override;
......
......@@ -77,9 +77,6 @@ class RemoveSuggestionBubbleDialogDelegateView
}
// views::DialogDelegateView:
int GetDialogButtons() const override {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
bool Accept() override {
std::move(remove_closure_).Run();
return true;
......
......@@ -40,10 +40,6 @@ base::string16 DeepScanningModalDialog::GetLinkText() const {
return base::string16();
}
int DeepScanningModalDialog::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
void DeepScanningModalDialog::OnLinkClicked(WindowOpenDisposition disposition) {
// TODO(drubery): Once we have an FAQ page for download deep scanning, link it
// here;
......
......@@ -32,7 +32,6 @@ class DeepScanningModalDialog : public TabModalConfirmDialogDelegate {
base::string16 GetDialogMessage() override;
base::string16 GetAcceptButtonTitle() override;
base::string16 GetLinkText() const override;
int GetDialogButtons() const override;
void OnLinkClicked(WindowOpenDisposition disposition) override;
void OnAccepted() 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