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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/auto_login_infobar_delegate.h" 5 #include "chrome/browser/ui/auto_login_infobar_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 } // namespace 135 } // namespace
136 136
137 137
138 // AutoLoginInfoBarDelegate --------------------------------------------------- 138 // AutoLoginInfoBarDelegate ---------------------------------------------------
139 139
140 // static 140 // static
141 bool AutoLoginInfoBarDelegate::Create(content::WebContents* web_contents, 141 bool AutoLoginInfoBarDelegate::Create(content::WebContents* web_contents,
142 const Params& params) { 142 const Params& params) {
143
144 // 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.
145 // 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
146 // have no business trying to get people to auto-log-in.
147 if (web_contents->GetEmbedderWebContents())
148 return false;
149
143 // If |web_contents| is hosted in a WebDialog, there may be no infobar 150 // If |web_contents| is hosted in a WebDialog, there may be no infobar
144 // service. 151 // service.
145 InfoBarService* infobar_service = 152 InfoBarService* infobar_service =
146 InfoBarService::FromWebContents(web_contents); 153 InfoBarService::FromWebContents(web_contents);
147 if (!infobar_service) 154 if (!infobar_service)
148 return false; 155 return false;
149 156
150 Profile* profile = 157 Profile* profile =
151 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 158 Profile::FromBrowserContext(web_contents->GetBrowserContext());
152 #if defined(OS_ANDROID) 159 #if defined(OS_ANDROID)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 const content::NotificationSource& source, 231 const content::NotificationSource& source,
225 const content::NotificationDetails& details) { 232 const content::NotificationDetails& details) {
226 DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type); 233 DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type);
227 infobar()->RemoveSelf(); 234 infobar()->RemoveSelf();
228 } 235 }
229 236
230 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) { 237 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) {
231 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, 238 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action,
232 HISTOGRAM_BOUNDING_VALUE); 239 HISTOGRAM_BOUNDING_VALUE);
233 } 240 }
OLDNEW
« 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