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

Unified Diff: chrome/browser/ui/login/login_prompt.cc

Issue 5814005: Minimize login prompts (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add browsertest Created 10 years 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/login/login_prompt.cc
diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc
index d653457de8ed16f517d42939b3146bac51be62ce..ec619088adf91ac8903d7759a9d876b6c22c57b8 100644
--- a/chrome/browser/ui/login/login_prompt.cc
+++ b/chrome/browser/ui/login/login_prompt.cc
@@ -196,17 +196,17 @@ void LoginHandler::Observe(NotificationType type,
if (!requesting_contents)
return;
- NavigationController* this_controller = &requesting_contents->controller();
- NavigationController* that_controller =
- Source<NavigationController>(source).ptr();
-
- // Only handle notifications from other handlers.
- if (this_controller == that_controller)
+ // Break out early if we aren't interested in the notification.
+ if (WasAuthHandled(false))
cbentzel 2010/12/17 19:22:56 I know the code already existed like this, but I'm
asanka (google) 2010/12/17 21:35:35 I'll defer this for another CL. I agree with the
return;
LoginNotificationDetails* login_details =
Details<LoginNotificationDetails>(details).ptr();
+ // WasAuthHandled(false) should always test positive before we
+ // publish AUTH_SUPPLIED or AUTH_CANCELLED notifications.
+ DCHECK(login_details->handler() != this);
+
// Only handle notification for the identical auth info.
if (*login_details->handler()->auth_info() != *auth_info())
return;

Powered by Google App Engine
This is Rietveld 408576698