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

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: Compilation fixes, change "inhibit" variable names Created 7 years, 5 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 c8d87ea66c5d58d1d937f336aed500df8c7cf3f1..c8e1a588267fdb65c9dd7c1a5024eb1edd53c050 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
@@ -16,11 +16,9 @@ using content::WebContents;
TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate(
WebContents* web_contents)
- : close_delegate_(NULL),
+ : operations_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));
}
@@ -28,7 +26,7 @@ TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate(
TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() {
// If we end up here, the window has been closed, so make sure we don't close
// it again.
- close_delegate_ = NULL;
+ operations_delegate_ = NULL;
// Make sure everything is cleaned up.
Cancel();
}
@@ -67,10 +65,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();
@@ -112,6 +108,6 @@ void TabModalConfirmDialogDelegate::OnLinkClicked(
}
void TabModalConfirmDialogDelegate::CloseDialog() {
- if (close_delegate_)
- close_delegate_->CloseDialog();
+ if (operations_delegate_)
+ operations_delegate_->CloseDialog();
}
« no previous file with comments | « chrome/browser/ui/tab_modal_confirm_dialog_delegate.h ('k') | chrome/browser/ui/views/autofill/autofill_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698