Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 1846033002: Switch GlobalErrorBubbleView to a BubbleDialogDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index 5b5db8b88a4ca586a446d74ad93a0a0006e5981f..62a800c138bb519c60bbd6fe74e8c2e4201fae1c 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -95,7 +95,7 @@ void DialogClientView::UpdateDialogButtons() {
AddChildView(ok_button_);
}
- UpdateButton(ok_button_, ui::DIALOG_BUTTON_OK);
+ GetDialogDelegate()->UpdateButton(ok_button_, ui::DIALOG_BUTTON_OK);
} else if (ok_button_) {
delete ok_button_;
ok_button_ = NULL;
@@ -107,7 +107,7 @@ void DialogClientView::UpdateDialogButtons() {
AddChildView(cancel_button_);
}
- UpdateButton(cancel_button_, ui::DIALOG_BUTTON_CANCEL);
+ GetDialogDelegate()->UpdateButton(cancel_button_, ui::DIALOG_BUTTON_CANCEL);
} else if (cancel_button_) {
delete cancel_button_;
cancel_button_ = NULL;
@@ -320,14 +320,6 @@ LabelButton* DialogClientView::CreateDialogButton(ui::DialogButton type) {
return button;
}
-void DialogClientView::UpdateButton(LabelButton* button,
- ui::DialogButton type) {
- DialogDelegate* dialog = GetDialogDelegate();
- button->SetText(dialog->GetDialogButtonLabel(type));
- button->SetEnabled(dialog->IsDialogButtonEnabled(type));
- button->SetIsDefault(type == dialog->GetDefaultDialogButton());
-}
-
int DialogClientView::GetButtonsAndExtraViewRowHeight() const {
int extra_view_height = ShouldShow(extra_view_) ?
extra_view_->GetPreferredSize().height() : 0;
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698