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 { ...@@ -80,16 +80,15 @@ class BaseDialogContainer : public views::DialogDelegateView {
BaseDialogContainer(std::unique_ptr<views::View> dialog_body, BaseDialogContainer(std::unique_ptr<views::View> dialog_body,
const base::Closure& close_callback) const base::Closure& close_callback)
: dialog_body_(AddChildView(std::move(dialog_body))), : dialog_body_(AddChildView(std::move(dialog_body))),
close_callback_(close_callback) {} close_callback_(close_callback) {
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_NONE);
}
~BaseDialogContainer() override {} ~BaseDialogContainer() override {}
protected: protected:
views::View* dialog_body() { return dialog_body_; } views::View* dialog_body() { return dialog_body_; }
private: private:
// Overridden from views::DialogDelegate:
int GetDialogButtons() const override { return ui::DIALOG_BUTTON_NONE; }
// Overridden from views::WidgetDelegate: // Overridden from views::WidgetDelegate:
ui::ModalType GetModalType() const override { return kModalType; } ui::ModalType GetModalType() const override { return kModalType; }
void WindowClosing() override { void WindowClosing() override {
......
...@@ -42,6 +42,7 @@ AppPauseDialogView::AppPauseDialogView( ...@@ -42,6 +42,7 @@ AppPauseDialogView::AppPauseDialogView(
apps::AppServiceProxy::OnPauseDialogClosedCallback closed_callback) apps::AppServiceProxy::OnPauseDialogClosedCallback closed_callback)
: BubbleDialogDelegateView(nullptr, views::BubbleBorder::NONE), : BubbleDialogDelegateView(nullptr, views::BubbleBorder::NONE),
closed_callback_(std::move(closed_callback)) { closed_callback_(std::move(closed_callback)) {
DialogDelegate::set_buttons(ui::DIALOG_BUTTON_OK);
ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
SetLayoutManager(std::make_unique<views::BoxLayout>( SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal, views::BoxLayout::Orientation::kHorizontal,
...@@ -79,10 +80,6 @@ gfx::Size AppPauseDialogView::CalculatePreferredSize() const { ...@@ -79,10 +80,6 @@ gfx::Size AppPauseDialogView::CalculatePreferredSize() const {
return gfx::Size(default_width, GetHeightForWidth(default_width)); return gfx::Size(default_width, GetHeightForWidth(default_width));
} }
int AppPauseDialogView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK;
}
ui::ModalType AppPauseDialogView::GetModalType() const { ui::ModalType AppPauseDialogView::GetModalType() const {
return ui::MODAL_TYPE_SYSTEM; return ui::MODAL_TYPE_SYSTEM;
} }
......
...@@ -28,7 +28,6 @@ class AppPauseDialogView : public views::BubbleDialogDelegateView { ...@@ -28,7 +28,6 @@ class AppPauseDialogView : public views::BubbleDialogDelegateView {
// views::BubbleDialogDelegateView: // views::BubbleDialogDelegateView:
bool Accept() override; bool Accept() override;
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
int GetDialogButtons() const override;
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;
......
...@@ -43,10 +43,6 @@ base::string16 NativeFileSystemRestrictedDirectoryDialogView::GetWindowTitle() ...@@ -43,10 +43,6 @@ base::string16 NativeFileSystemRestrictedDirectoryDialogView::GetWindowTitle()
: IDS_NATIVE_FILE_SYSTEM_RESTRICTED_FILE_TITLE); : IDS_NATIVE_FILE_SYSTEM_RESTRICTED_FILE_TITLE);
} }
int NativeFileSystemRestrictedDirectoryDialogView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
bool NativeFileSystemRestrictedDirectoryDialogView::ShouldShowCloseButton() bool NativeFileSystemRestrictedDirectoryDialogView::ShouldShowCloseButton()
const { const {
return false; return false;
......
...@@ -47,7 +47,6 @@ class NativeFileSystemRestrictedDirectoryDialogView ...@@ -47,7 +47,6 @@ class NativeFileSystemRestrictedDirectoryDialogView
// views::DialogDelegateView: // views::DialogDelegateView:
base::string16 GetWindowTitle() const override; base::string16 GetWindowTitle() const override;
int GetDialogButtons() const override;
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
bool Accept() override; bool Accept() override;
bool Cancel() override; bool Cancel() override;
......
...@@ -77,9 +77,6 @@ class RemoveSuggestionBubbleDialogDelegateView ...@@ -77,9 +77,6 @@ class RemoveSuggestionBubbleDialogDelegateView
} }
// views::DialogDelegateView: // views::DialogDelegateView:
int GetDialogButtons() const override {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
bool Accept() override { bool Accept() override {
std::move(remove_closure_).Run(); std::move(remove_closure_).Run();
return true; return true;
......
...@@ -40,10 +40,6 @@ base::string16 DeepScanningModalDialog::GetLinkText() const { ...@@ -40,10 +40,6 @@ base::string16 DeepScanningModalDialog::GetLinkText() const {
return base::string16(); return base::string16();
} }
int DeepScanningModalDialog::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}
void DeepScanningModalDialog::OnLinkClicked(WindowOpenDisposition disposition) { void DeepScanningModalDialog::OnLinkClicked(WindowOpenDisposition disposition) {
// TODO(drubery): Once we have an FAQ page for download deep scanning, link it // TODO(drubery): Once we have an FAQ page for download deep scanning, link it
// here; // here;
......
...@@ -32,7 +32,6 @@ class DeepScanningModalDialog : public TabModalConfirmDialogDelegate { ...@@ -32,7 +32,6 @@ class DeepScanningModalDialog : public TabModalConfirmDialogDelegate {
base::string16 GetDialogMessage() override; base::string16 GetDialogMessage() override;
base::string16 GetAcceptButtonTitle() override; base::string16 GetAcceptButtonTitle() override;
base::string16 GetLinkText() const override; base::string16 GetLinkText() const override;
int GetDialogButtons() const override;
void OnLinkClicked(WindowOpenDisposition disposition) override; void OnLinkClicked(WindowOpenDisposition disposition) override;
void OnAccepted() 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