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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1678233003: Don't focus the location bar in a phishy situation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 61bddb1d90a0f21c98a8c9f035a2ddaeb3a328f4..562a8507114972cc02e1498bd271036c3ce195bc 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2915,8 +2915,11 @@ void WebContentsImpl::ResumeLoadingCreatedWebContents() {
bool WebContentsImpl::FocusLocationBarByDefault() {
NavigationEntry* entry = controller_.GetVisibleEntry();
- if (entry && entry->GetURL() == GURL(url::kAboutBlankURL))
+ if (entry &&
+ entry->GetTransitionType() != ui::PageTransition::PAGE_TRANSITION_LINK &&
+ entry->GetURL() == GURL(url::kAboutBlankURL)) {
Charlie Reis 2016/02/10 05:47:48 Here's what I would recommend (if we decide to kee
palmer 2016/02/10 23:15:25 OK, I did that, and added a sketch of a test that
return true;
+ }
return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this);
}
« 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