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

Unified Diff: views/window/dialog_delegate.cc

Issue 6622002: Do all OOLing in the views code. linux_views now builds clean with the clang plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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
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

Powered by Google App Engine
This is Rietveld 408576698