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

Unified Diff: chrome/browser/ui/auto_login_infobar_delegate.cc

Issue 131483010: Android: Disallow iframes from requesting to auto-log-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/auto_login_infobar_delegate.cc
diff --git a/chrome/browser/ui/auto_login_infobar_delegate.cc b/chrome/browser/ui/auto_login_infobar_delegate.cc
index 7929b7f925f98d96165be30870047d26c28ecc26..5afcb9d1de7d8b8c8f5068afdcf01c80f5743372 100644
--- a/chrome/browser/ui/auto_login_infobar_delegate.cc
+++ b/chrome/browser/ui/auto_login_infobar_delegate.cc
@@ -140,6 +140,13 @@ void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) {
// static
bool AutoLoginInfoBarDelegate::Create(content::WebContents* web_contents,
const Params& params) {
+
+ // Only offer to auto-log-in if the user can see the origin that is
msw 2014/02/03 23:37:01 nit: s/log-in/login/ here and below.
+ // incurring the attempt: that is, if |web_contents| is top-level. iframes
Charlie Reis 2014/02/04 01:26:09 When is a WebContents not top-level? iframes don'
palmer 2014/02/20 21:30:33 I admit I'm no expert, but if a WebContents has an
Fady Samuel 2014/02/20 21:35:53 <webview>: The content of a webview thinks it's a
Charlie Reis 2014/02/20 22:26:04 To be clear: iframes never have a WebContents of t
palmer 2014/10/14 01:09:08 Any clues on where I can get that context? Sorry,
Charlie Reis 2014/10/14 19:56:41 I'm not familiar with auto login or the possible c
palmer 2014/10/15 20:54:20 Weirdly: ~/chromium/src $ search -n '\.cc$' -C Au
+ // have no business trying to get people to auto-log-in.
+ if (web_contents->GetEmbedderWebContents())
+ return false;
+
// If |web_contents| is hosted in a WebDialog, there may be no infobar
// service.
InfoBarService* infobar_service =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698