summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 03:51:50 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 03:51:50 +0000
commit1e1baa489c6fc202c8516707dd5ca2d4738920b9 (patch)
tree060270c7656e935cfdb0aaa1cea4d48cc8626611 /chrome/browser/app_modal_dialog.h
parentc1f50aa589d83b9725d4b7f19559eb94c006d818 (diff)
downloadchromium_src-1e1baa489c6fc202c8516707dd5ca2d4738920b9.zip
chromium_src-1e1baa489c6fc202c8516707dd5ca2d4738920b9.tar.gz
chromium_src-1e1baa489c6fc202c8516707dd5ca2d4738920b9.tar.bz2
Fixes two bugs in cookie prompting:
. In certain situations we could crash because we weren't letting CookiePromptView::Init complete and then attempting to reference some NULL fields. I've fixed this by adding AppModalDialog::IsValid and moving the logic that was in Init to IsValid. This way we only create CookiePromptView when needed. . We were leaking AppModalDialogs. I've made CookiePromptView own the AppModalDialog and delete it when the CookiePromptView is deleted. BUG=36079 TEST=enable prompting for cookies, go to a bunch of sites make sure you don't crash. Review URL: http://codereview.chromium.org/632006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog.h')
-rw-r--r--chrome/browser/app_modal_dialog.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/app_modal_dialog.h b/chrome/browser/app_modal_dialog.h
index 715e12e..de87749 100644
--- a/chrome/browser/app_modal_dialog.h
+++ b/chrome/browser/app_modal_dialog.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/basictypes.h"
#include "build/build_config.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
@@ -46,6 +47,12 @@ class AppModalDialog {
// Called by the app modal window queue when it is time to show this window.
void ShowModalDialog();
+ // Returns true if the dialog is still valid. As dialogs are created they are
+ // added to the AppModalDialogQueue. When the current modal dialog finishes
+ // and it's time to show the next dialog in the queue IsValid is invoked.
+ // If IsValid returns false the dialog is deleted and not shown.
+ virtual bool IsValid() { return !skip_this_dialog_; }
+
/////////////////////////////////////////////////////////////////////////////
// The following methods are platform specific and should be implemented in
// the platform specific .cc files.
@@ -101,6 +108,9 @@ class AppModalDialog {
// True if the dialog should no longer be shown, e.g. because the underlying
// tab navigated away while the dialog was queued.
bool skip_this_dialog_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AppModalDialog);
};
#endif // CHROME_BROWSER_APP_MODAL_DIALOG_H_