diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-21 23:49:18 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-21 23:49:18 +0000 |
commit | 478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d (patch) | |
tree | f995985b8749bd31da7cbb73ec73cfce24e97987 /chrome/browser/views/options | |
parent | 69e38eca8034fe35c22744f59bee77f987ae8755 (diff) | |
download | chromium_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/browser/views/options')
4 files changed, 13 insertions, 11 deletions
diff --git a/chrome/browser/views/options/advanced_page_view.cc b/chrome/browser/views/options/advanced_page_view.cc index fcf083b..20d8616 100644 --- a/chrome/browser/views/options/advanced_page_view.cc +++ b/chrome/browser/views/options/advanced_page_view.cc @@ -36,14 +36,12 @@ class ResetDefaultsConfirmBox : public views::DialogDelegate { protected: // views::DialogDelegate - virtual int GetDialogButtons() const { - return DIALOGBUTTON_OK | DIALOGBUTTON_CANCEL; - } - virtual std::wstring GetDialogButtonLabel(DialogButton button) const { + virtual std::wstring GetDialogButtonLabel( + MessageBoxFlags::DialogButton button) const { switch (button) { - case DIALOGBUTTON_OK: + case MessageBoxFlags::DIALOGBUTTON_OK: return l10n_util::GetString(IDS_OPTIONS_RESET_OKLABEL); - case DIALOGBUTTON_CANCEL: + case MessageBoxFlags::DIALOGBUTTON_CANCEL: return l10n_util::GetString(IDS_OPTIONS_RESET_CANCELLABEL); default: break; @@ -69,7 +67,7 @@ class ResetDefaultsConfirmBox : public views::DialogDelegate { const int kDialogWidth = 400; // Also deleted when the window closes. message_box_view_ = new MessageBoxView( - MessageBox::kFlagHasMessage | MessageBox::kFlagHasOKButton, + MessageBoxFlags::kFlagHasMessage | MessageBoxFlags::kFlagHasOKButton, l10n_util::GetString(IDS_OPTIONS_RESET_MESSAGE).c_str(), std::wstring(), kDialogWidth); diff --git a/chrome/browser/views/options/cookies_view.h b/chrome/browser/views/options/cookies_view.h index 2baed44..c05bce7 100644 --- a/chrome/browser/views/options/cookies_view.h +++ b/chrome/browser/views/options/cookies_view.h @@ -55,9 +55,11 @@ class CookiesView : public views::View, UINT flags); // views::WindowDelegate implementation: - virtual int GetDialogButtons() const { return DIALOGBUTTON_CANCEL; } + virtual int GetDialogButtons() const { + return MessageBoxFlags::DIALOGBUTTON_CANCEL; + } virtual views::View* GetInitiallyFocusedView() { - return search_field_; + return search_field_; } virtual bool CanResize() const { return true; } virtual std::wstring GetWindowTitle() const; diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc index f7f492f..d163640 100644 --- a/chrome/browser/views/options/options_window_view.cc +++ b/chrome/browser/views/options/options_window_view.cc @@ -42,7 +42,9 @@ class OptionsWindowView : public views::View, void ShowOptionsPage(OptionsPage page, OptionsGroup highlight_group); // views::DialogDelegate implementation: - virtual int GetDialogButtons() const { return DIALOGBUTTON_CANCEL; } + virtual int GetDialogButtons() const { + return MessageBoxFlags::DIALOGBUTTON_CANCEL; + } virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual bool Cancel(); diff --git a/chrome/browser/views/options/passwords_exceptions_window_view.cc b/chrome/browser/views/options/passwords_exceptions_window_view.cc index 9bf44b4..4ea100f 100644 --- a/chrome/browser/views/options/passwords_exceptions_window_view.cc +++ b/chrome/browser/views/options/passwords_exceptions_window_view.cc @@ -65,7 +65,7 @@ void PasswordsExceptionsWindowView::ViewHierarchyChanged( // PasswordsExceptionsWindowView, views::DisloagDelegate implementations int PasswordsExceptionsWindowView::GetDialogButtons() const { - return DIALOGBUTTON_CANCEL; + return MessageBoxFlags::DIALOGBUTTON_CANCEL; } std::wstring PasswordsExceptionsWindowView::GetWindowTitle() const { |