diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 22:17:54 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 22:17:54 +0000 |
commit | c1e3e220c1b6502c830b0da74fc721d437bb2577 (patch) | |
tree | c76b66ce241f59b3354d41842f0cdae3fe2a05ad /chrome/browser/views/options | |
parent | 66fb6e078a0f26c23f76bd79120f98554c94a464 (diff) | |
download | chromium_src-c1e3e220c1b6502c830b0da74fc721d437bb2577.zip chromium_src-c1e3e220c1b6502c830b0da74fc721d437bb2577.tar.gz chromium_src-c1e3e220c1b6502c830b0da74fc721d437bb2577.tar.bz2 |
Change ConfirmMessageBoxDialog to just be a native view (it was only windows before, too, but now at least it doesn't
cause zombie processes) with an observer that is notified when the user clicks OK/closes the dialog instead of running
a nested message loop and blocking. This fixes bug 20451, where nested message loops were running a confirm dialog and
could cause zombie processes at browser shutdown.
BUG=20451
TEST=None (manual: verify that the confirmation dialog is shown when you try to remove all passwords, and that no zombie is left behind if the browser is closed while the confirmation dialog is showing)
Review URL: http://codereview.chromium.org/243054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/options')
-rw-r--r-- | chrome/browser/views/options/passwords_page_view.cc | 13 | ||||
-rw-r--r-- | chrome/browser/views/options/passwords_page_view.h | 9 |
2 files changed, 13 insertions, 9 deletions
diff --git a/chrome/browser/views/options/passwords_page_view.cc b/chrome/browser/views/options/passwords_page_view.cc index 40cf83c..739c336a 100644 --- a/chrome/browser/views/options/passwords_page_view.cc +++ b/chrome/browser/views/options/passwords_page_view.cc @@ -8,7 +8,6 @@ #include "base/string_util.h" #include "chrome/browser/password_manager/password_store.h" #include "chrome/browser/profile.h" -#include "chrome/browser/views/confirm_message_box_dialog.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "grit/generated_resources.h" @@ -215,16 +214,12 @@ void PasswordsPageView::ButtonPressed( views::Button* sender, const views::Event& event) { // Close will result in our destruction. if (sender == &remove_all_button_) { - bool accepted = ConfirmMessageBoxDialog::Run( + ConfirmMessageBoxDialog::Run( GetWindow()->GetNativeWindow(), + this, l10n_util::GetString(IDS_PASSWORDS_PAGE_VIEW_TEXT_DELETE_ALL_PASSWORDS), l10n_util::GetString( IDS_PASSWORDS_PAGE_VIEW_CAPTION_DELETE_ALL_PASSWORDS)); - - if (accepted) { - // Delete all the Passwords shown. - table_model_.ForgetAndRemoveAllSignons(); - } return; } @@ -256,6 +251,10 @@ void PasswordsPageView::OnRowCountChanged(size_t rows) { remove_all_button_.SetEnabled(rows > 0); } +void PasswordsPageView::OnConfirmMessageAccept() { + table_model_.ForgetAndRemoveAllSignons(); +} + /////////////////////////////////////////////////////////////////////////////// // PasswordsPageView, protected void PasswordsPageView::InitControlLayout() { diff --git a/chrome/browser/views/options/passwords_page_view.h b/chrome/browser/views/options/passwords_page_view.h index d1c0346..6de8785 100644 --- a/chrome/browser/views/options/passwords_page_view.h +++ b/chrome/browser/views/options/passwords_page_view.h @@ -11,8 +11,9 @@ #include "app/table_model.h" #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" -#include "chrome/browser/views/options/options_page_view.h" #include "chrome/browser/password_manager/password_store.h" +#include "chrome/browser/views/confirm_message_box_dialog.h" +#include "chrome/browser/views/options/options_page_view.h" #include "views/controls/button/native_button.h" #include "views/controls/label.h" #include "views/controls/table/table_view.h" @@ -145,7 +146,8 @@ class PasswordsTableModel : public TableModel, class PasswordsPageView : public OptionsPageView, public views::TableViewObserver, public views::ButtonListener, - public PasswordsTableModelObserver { + public PasswordsTableModelObserver, + public ConfirmMessageBoxObserver { public: explicit PasswordsPageView(Profile* profile); @@ -158,6 +160,9 @@ class PasswordsPageView : public OptionsPageView, // PasswordsTableModelObserver implementation. virtual void OnRowCountChanged(size_t rows); + // ConfirmMessageBoxObserver implementation. + virtual void OnConfirmMessageAccept(); + protected: virtual void InitControlLayout(); |