Chromium Code Reviews| 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 3fce5589817adef556893bab406a0df37424104d..fdc57c7751bfe853ebf8f084a6b6bac95a1e1045 100644 |
| --- a/chrome/browser/ui/login/login_prompt.cc |
| +++ b/chrome/browser/ui/login/login_prompt.cc |
| @@ -21,16 +21,20 @@ |
| #include "components/password_manager/core/browser/browser_save_password_progress_logger.h" |
| #include "components/password_manager/core/browser/password_manager.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" |
| @@ -555,10 +559,20 @@ void LoginDialogCallback(const GURL& request_url, |
| request_url, |
| make_scoped_refptr(auth_info), |
| make_scoped_refptr(handler)); |
| + content::NavigationEntry* pending_entry = |
| + parent_contents->GetController().GetPendingEntry(); |
| + ui::PageTransition transition = pending_entry->GetTransitionType(); |
| + // For non-user initiated navigations, auth dialog is displayed when the |
| + // visible url points to the page that initiated the navigation and not the |
| + // actual auth url. Update the pending entry in that case. |
| + content::NavigationEntry* entry = |
| + (transition & ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) |
| + ? parent_contents->GetController().GetVisibleEntry() |
| + : pending_entry; |
|
meacer
2015/03/12 20:37:48
Not sure if this is the best way to check for rend
Charlie Reis
2015/03/13 18:19:37
This won't work for determining renderer-initiated
meacer
2015/03/17 17:30:44
I initally used is_renderer_initiated() but realiz
|
| + const content::SSLStatus& ssl_status = 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, |