summaryrefslogtreecommitdiffstats
path: root/chrome/views/window/dialog_delegate.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-21 23:49:18 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-21 23:49:18 +0000
commit478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d (patch)
treef995985b8749bd31da7cbb73ec73cfce24e97987 /chrome/views/window/dialog_delegate.cc
parent69e38eca8034fe35c22744f59bee77f987ae8755 (diff)
downloadchromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.zip
chromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.tar.gz
chromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.tar.bz2
Reland r14146 which refactors DialogButton into cross platform
code. This is the same as the last change except I renamed class MessageBox to class MessageBoxFlags to avoid conflicting with the same name in windows.h. Review URL: http://codereview.chromium.org/87065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/window/dialog_delegate.cc')
-rw-r--r--chrome/views/window/dialog_delegate.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/views/window/dialog_delegate.cc b/chrome/views/window/dialog_delegate.cc
index 9778066..bc4f1fd8 100644
--- a/chrome/views/window/dialog_delegate.cc
+++ b/chrome/views/window/dialog_delegate.cc
@@ -13,18 +13,18 @@ namespace views {
// Overridden from WindowDelegate:
int DialogDelegate::GetDefaultDialogButton() const {
- if (GetDialogButtons() & DIALOGBUTTON_OK)
- return DIALOGBUTTON_OK;
- if (GetDialogButtons() & DIALOGBUTTON_CANCEL)
- return DIALOGBUTTON_CANCEL;
- return DIALOGBUTTON_NONE;
+ if (GetDialogButtons() & MessageBoxFlags::DIALOGBUTTON_OK)
+ return MessageBoxFlags::DIALOGBUTTON_OK;
+ if (GetDialogButtons() & MessageBoxFlags::DIALOGBUTTON_CANCEL)
+ return MessageBoxFlags::DIALOGBUTTON_CANCEL;
+ return MessageBoxFlags::DIALOGBUTTON_NONE;
}
View* DialogDelegate::GetInitiallyFocusedView() {
// Focus the default button if any.
DialogClientView* dcv = GetDialogClientView();
int default_button = GetDefaultDialogButton();
- if (default_button == DIALOGBUTTON_NONE)
+ if (default_button == MessageBoxFlags::DIALOGBUTTON_NONE)
return NULL;
if ((default_button & GetDialogButtons()) == 0) {
@@ -33,9 +33,9 @@ View* DialogDelegate::GetInitiallyFocusedView() {
return NULL;
}
- if (default_button & DIALOGBUTTON_OK)
+ if (default_button & MessageBoxFlags::DIALOGBUTTON_OK)
return dcv->ok_button();
- if (default_button & DIALOGBUTTON_CANCEL)
+ if (default_button & MessageBoxFlags::DIALOGBUTTON_CANCEL)
return dcv->cancel_button();
return NULL;
}