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

Issue 1678233003: Don't focus the location bar in a phishy situation. (Closed)

Created:
4 years, 10 months ago by palmer
Modified:
4 years, 9 months ago
CC:
chromium-reviews, darin-cc_chromium.org, nasko+codewatch_chromium.org, jam, creis+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't focus the location bar in a phishy situation. There is logic to focus the location bar for editing if the URL is about:blank. However, if the page transition type is PAGE_TRANSITION_LINK, bypass that logic; it's not really a blank page. This avoids a phishy edge case with window.open. BUG=567445 Committed: https://crrev.com/c70cb1fe9303df33b11187d0f5f60d22938e6e63 Cr-Commit-Position: refs/heads/master@{#379396}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Take creis' suggestion; useless sketch of a test. #

Patch Set 3 : Test in chrome/. #

Total comments: 4

Patch Set 4 : Make it a uitest. #

Total comments: 6

Patch Set 5 : Wait for load in the WC returned by GetActiveWebContents #

Total comments: 12

Patch Set 6 : Respond to comments. Thanks! #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -2 lines) Patch
M chrome/browser/ui/browser_focus_uitest.cc View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 1 chunk +21 lines, -2 lines 1 comment Download

Messages

Total messages: 30 (8 generated)
palmer
nasko or creis, could you please take a look?
4 years, 10 months ago (2016-02-09 04:05:32 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1678233003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1678233003/1
4 years, 10 months ago (2016-02-09 04:09:17 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-09 05:15:46 UTC) #6
Charlie Reis
Glad you're narrowing down the cause for this! That said, this doesn't look like the ...
4 years, 10 months ago (2016-02-10 01:03:41 UTC) #7
Charlie Reis
New suggestion below, after investigating. Is it possible to add a test for this? The ...
4 years, 10 months ago (2016-02-10 05:47:48 UTC) #8
palmer
https://codereview.chromium.org/1678233003/diff/1/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1678233003/diff/1/content/browser/web_contents/web_contents_impl.cc#newcode2920 content/browser/web_contents/web_contents_impl.cc:2920: entry->GetURL() == GURL(url::kAboutBlankURL)) { On 2016/02/10 05:47:48, Charlie Reis ...
4 years, 10 months ago (2016-02-10 23:15:25 UTC) #9
Charlie Reis
Good question about the test. It will need to be in the chrome/ layer to ...
4 years, 10 months ago (2016-02-11 00:22:24 UTC) #11
palmer
OK, here's a test in chrome/. If ui_test_utils::IsViewFocused worked, I'd be more sure that the ...
4 years, 10 months ago (2016-02-12 01:15:54 UTC) #12
Peter Kasting
https://codereview.chromium.org/1678233003/diff/40001/chrome/browser/ui/browser_navigator_browsertest.cc File chrome/browser/ui/browser_navigator_browsertest.cc (right): https://codereview.chromium.org/1678233003/diff/40001/chrome/browser/ui/browser_navigator_browsertest.cc#newcode1450 chrome/browser/ui/browser_navigator_browsertest.cc:1450: ASSERT_FALSE(omnibox->IsEditingOrEmpty()); On 2016/02/12 01:15:54, palmer wrote: > This test ...
4 years, 10 months ago (2016-02-12 01:37:20 UTC) #13
palmer
> > This line causes the link to fail: No implementation available for the > ...
4 years, 10 months ago (2016-02-12 23:00:17 UTC) #14
Charlie Reis
On 2016/02/12 23:00:17, palmer wrote: > > > This line causes the link to fail: ...
4 years, 10 months ago (2016-02-12 23:43:47 UTC) #15
palmer
> Hmm, I'm curious which way the test is failing without the fix, since it ...
4 years, 10 months ago (2016-02-17 02:22:14 UTC) #16
palmer
https://codereview.chromium.org/1678233003/diff/60001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/1678233003/diff/60001/chrome/browser/ui/browser_focus_uitest.cc#newcode759 chrome/browser/ui/browser_focus_uitest.cc:759: EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); On 2016/02/12 23:43:47, Charlie Reis (catching up) wrote: ...
4 years, 10 months ago (2016-02-23 00:37:59 UTC) #17
palmer
> Following the example of other code in this file, I added: > > ASSERT_NO_FATAL_FAILURE(content::WaitForLoadStop( ...
4 years, 10 months ago (2016-02-23 00:54:08 UTC) #18
Charlie Reis
Sorry for the delay! (I've been at an event all week.) LGTM. The fix looks ...
4 years, 10 months ago (2016-02-25 00:48:40 UTC) #19
palmer
pkasting, ping. :)
4 years, 9 months ago (2016-03-03 01:40:11 UTC) #20
Peter Kasting
LGTM https://codereview.chromium.org/1678233003/diff/80001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/1678233003/diff/80001/chrome/browser/ui/browser_focus_uitest.cc#newcode741 chrome/browser/ui/browser_focus_uitest.cc:741: // Ensure that crbug.com/567445 does not regress. Nit: ...
4 years, 9 months ago (2016-03-03 21:02:19 UTC) #21
palmer
https://codereview.chromium.org/1678233003/diff/80001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/1678233003/diff/80001/chrome/browser/ui/browser_focus_uitest.cc#newcode741 chrome/browser/ui/browser_focus_uitest.cc:741: // Ensure that crbug.com/567445 does not regress. On 2016/03/03 ...
4 years, 9 months ago (2016-03-04 22:15:57 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1678233003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1678233003/100001
4 years, 9 months ago (2016-03-04 22:24:48 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 9 months ago (2016-03-04 23:41:36 UTC) #26
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/c70cb1fe9303df33b11187d0f5f60d22938e6e63 Cr-Commit-Position: refs/heads/master@{#379396}
4 years, 9 months ago (2016-03-04 23:43:48 UTC) #28
groby-ooo-7-16
4 years, 9 months ago (2016-03-07 20:00:37 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/1678233003/diff/100001/content/browser/web_co...
File content/browser/web_contents/web_contents_impl.cc (right):

https://codereview.chromium.org/1678233003/diff/100001/content/browser/web_co...
content/browser/web_contents/web_contents_impl.cc:2952: // the pending entry is
the problematic navigation elsewhere.
Thank you, thank you, thank you!

Future Rachel is immensely grateful for this comment! (Because 6 months hence,
I'll have no idea why this is here otherwise :)

Powered by Google App Engine
This is Rietveld 408576698