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

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

Issue 1093153002: Fix to allow the proxy authentication dialog to appear when hosting gaia in webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and put extensions code behind a guard. Created 5 years, 8 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 | « chrome/browser/chromeos/login/wizard_controller_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ae9c2cf7915b04ba7a45d53f02ce31be7794bc9b 100644
--- a/chrome/browser/ui/login/login_prompt.cc
+++ b/chrome/browser/ui/login/login_prompt.cc
@@ -36,6 +36,10 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/text_elider.h"
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/browser/guest_view/guest_view_base.h"
+#endif
+
using autofill::PasswordForm;
using content::BrowserThread;
using content::NavigationController;
@@ -472,8 +476,30 @@ void ShowLoginPrompt(const GURL& request_url,
password_manager::ContentPasswordManagerDriver* driver =
handler->GetPasswordManagerDriverForLogin();
+ // The realm is controlled by the remote server, so there is no reason
+ // to believe it is of a reasonable length.
+ base::string16 elided_realm;
+ gfx::ElideString(base::UTF8ToUTF16(auth_info->realm), 120, &elided_realm);
+
+
msw 2015/04/24 21:45:50 nit: remove extra blank line
paulmeyer 2015/04/24 21:53:39 Done.
+ base::string16 host_and_port = base::ASCIIToUTF16(
+ request_url.scheme() + "://" + auth_info->challenger.ToString());
+ base::string16 explanation = elided_realm.empty() ?
+ l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM,
+ host_and_port) :
+ l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION,
+ host_and_port,
+ elided_realm);
+
if (!driver) {
- // Same logic as above.
+#if defined(ENABLE_EXTENSIONS)
+ // A WebContents in a <webview> (a GuestView type) does not have a password
+ // manager, but still needs to be able to show login prompts.
+ if (extensions::GuestViewBase::FromWebContents(parent_contents)) {
+ handler->BuildViewForPasswordManager(nullptr, explanation);
+ return;
+ }
+#endif
handler->CancelAuth();
return;
}
@@ -493,19 +519,6 @@ void ShowLoginPrompt(const GURL& request_url,
driver->OnPasswordFormsParsed(v);
handler->SetPasswordManager(driver->GetPasswordManager());
- // The realm is controlled by the remote server, so there is no reason
- // to believe it is of a reasonable length.
- base::string16 elided_realm;
- gfx::ElideString(base::UTF8ToUTF16(auth_info->realm), 120, &elided_realm);
-
- base::string16 host_and_port = base::ASCIIToUTF16(
- request_url.scheme() + "://" + auth_info->challenger.ToString());
- base::string16 explanation = elided_realm.empty() ?
- l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM,
- host_and_port) :
- l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION,
- host_and_port,
- elided_realm);
handler->BuildViewForPasswordManager(driver->GetPasswordManager(),
explanation);
}
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698