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

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

Issue 23820004: Don't listen for NOTIFICATION_TAB_CLOSING in TabModalConfirmDialogDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e49df0d9902af42519eb53bab25b59cef60813e..0d9513712aaae7053f38cea860f398f51a980504 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
@@ -21,8 +21,6 @@ TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate(
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));
}
TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() {
@@ -66,13 +64,10 @@ void TabModalConfirmDialogDelegate::Observe(
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();
- } else {
- NOTREACHED();
- }
+ // the same page anymore).
+ DCHECK(type == content::NOTIFICATION_LOAD_START);
sky 2013/09/04 14:12:51 DCHECK_EQ
Mike Wittman 2013/09/04 16:59:28 Done.
+
+ Close();
}
void TabModalConfirmDialogDelegate::Close() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698