Index: views/window/dialog_delegate.cc |
diff --git a/views/window/dialog_delegate.cc b/views/window/dialog_delegate.cc |
index 4ae9a9163e2e39fd555d59b2c1f854307039f5de..43bdce38a113f2737391bd2a71a1dd1ec776dc03 100644 |
--- a/views/window/dialog_delegate.cc |
+++ b/views/window/dialog_delegate.cc |
@@ -12,6 +12,34 @@ namespace views { |
// Overridden from WindowDelegate: |
+DialogDelegate* DialogDelegate::AsDialogDelegate() { return this; } |
+ |
+int DialogDelegate::GetDialogButtons() const { |
+ return ui::MessageBoxFlags::DIALOGBUTTON_OK | |
+ ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; |
+} |
+ |
+bool DialogDelegate::AreAcceleratorsEnabled( |
+ ui::MessageBoxFlags::DialogButton button) { |
+ return true; |
+} |
+ |
+std::wstring DialogDelegate::GetDialogButtonLabel( |
+ ui::MessageBoxFlags::DialogButton button) const { |
+ // empty string results in defaults for |
+ // ui::MessageBoxFlags::DIALOGBUTTON_OK, |
+ // ui::MessageBoxFlags::DIALOGBUTTON_CANCEL. |
+ return L""; |
+} |
+ |
+View* DialogDelegate::GetExtraView() { |
+ return NULL; |
+} |
+ |
+bool DialogDelegate::GetSizeExtraViewHeightToButtons() { |
+ return false; |
+} |
+ |
int DialogDelegate::GetDefaultDialogButton() const { |
if (GetDialogButtons() & MessageBoxFlags::DIALOGBUTTON_OK) |
return MessageBoxFlags::DIALOGBUTTON_OK; |
@@ -20,6 +48,28 @@ int DialogDelegate::GetDefaultDialogButton() const { |
return MessageBoxFlags::DIALOGBUTTON_NONE; |
} |
+bool DialogDelegate::IsDialogButtonEnabled( |
+ ui::MessageBoxFlags::DialogButton button) const { |
+ return true; |
+} |
+ |
+bool DialogDelegate::IsDialogButtonVisible( |
+ ui::MessageBoxFlags::DialogButton button) const { |
+ return true; |
+} |
+ |
+bool DialogDelegate::Cancel() { |
+ return true; |
+} |
+ |
+bool DialogDelegate::Accept(bool window_closiang) { |
+ return Accept(); |
+} |
+ |
+bool DialogDelegate::Accept() { |
+ return true; |
+} |
+ |
View* DialogDelegate::GetInitiallyFocusedView() { |
// Focus the default button if any. |
DialogClientView* dcv = GetDialogClientView(); |
@@ -51,4 +101,8 @@ DialogClientView* DialogDelegate::GetDialogClientView() const { |
return dialog_client_view; |
} |
+AccessibilityTypes::Role DialogDelegate::accessible_role() const { |
+ return AccessibilityTypes::ROLE_DIALOG; |
+} |
+ |
} // namespace views |