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

Unified Diff: chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc

Issue 17500003: Close web contents modal dialogs on content load start (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bonus patchset: initiator tab -> initiator Created 7 years, 6 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: chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
index 2dd89a89c68443e1e5bb435dd9c402bce566e435..87cc43418926bbab43f7178f26b5ee7632c0eb09 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
@@ -19,8 +19,6 @@ TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate(
: close_delegate_(NULL),
closing_(false) {
NavigationController* controller = &web_contents->GetController();
- registrar_.Add(this, content::NOTIFICATION_LOAD_START,
- content::Source<NavigationController>(controller));
registrar_.Add(this, chrome::NOTIFICATION_TAB_CLOSING,
content::Source<NavigationController>(controller));
}
@@ -58,10 +56,8 @@ void TabModalConfirmDialogDelegate::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- // Close the dialog if we load a page (because the action might not apply to
- // the same page anymore) or if the tab is closed.
- if (type == content::NOTIFICATION_LOAD_START ||
- type == chrome::NOTIFICATION_TAB_CLOSING) {
+ // Close the dialog if the tab is closed.
+ if (type == chrome::NOTIFICATION_TAB_CLOSING) {
Cancel();
} else {
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698