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

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

Issue 1368863002: Set SSL info when an HTTP auth dialog is triggered by direct navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fill in the rest of entry->GetSSL(). Created 5 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
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 8051d83138dad0e8f008a3f5163e32310c236cce..985f36c9ed1d27d4d587764346c99e67585c551b 100644
--- a/chrome/browser/ui/login/login_prompt.cc
+++ b/chrome/browser/ui/login/login_prompt.cc
@@ -26,16 +26,20 @@
#include "components/password_manager/core/browser/password_manager.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/ssl_status.h"
+#include "grit/generated_resources.h"
#include "net/base/auth.h"
#include "net/base/load_flags.h"
#include "net/base/net_util.h"
#include "net/http/http_transaction_factory.h"
+#include "net/ssl/ssl_info.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "ui/base/l10n/l10n_util.h"
@@ -581,10 +585,24 @@ void LoginDialogCallback(const GURL& request_url,
request_url,
make_scoped_refptr(auth_info),
make_scoped_refptr(handler));
+ // TODO(palmer, creis, meacer): Explain why this is safe. It is safe if:
+ //
+ // 1) Browser initiated navigations will always start with a pending entry,
+ // but it may get discarded or replaced before the navigation commits. When
+ // does this call happen? (It may be possible for the pending entry to be
+ // gone by now, which might have been why we couldn't use it.)
Charlie Reis 2015/09/29 22:52:11 Following the trail in codesearch, it looks like L
+ //
+ // 2) Renderer initiated navigations in the main frame will have a pending
+ // entry if they make a network request, but it can get discarded as above.
+ //
+ // 3) Renderer initiated navigations in subframes will not have pending
+ // entries. Can they cause an auth dialog?
+ content::NavigationEntry* pending_entry =
+ parent_contents->GetController().GetPendingEntry();
+ const content::SSLStatus& ssl_status = pending_entry->GetSSL();
// This is owned by the interstitial it creates. It cancels any existing
// interstitial.
- new LoginInterstitialDelegate(parent_contents,
- request_url,
+ new LoginInterstitialDelegate(parent_contents, request_url, ssl_status,
callback);
} else {
ShowLoginPrompt(request_url,

Powered by Google App Engine
This is Rietveld 408576698