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

Issue 6883299: Hide translate infobar on programmatic navigation. (Closed)

Created:
9 years, 7 months ago by jeremy
Modified:
9 years, 6 months ago
CC:
chromium-reviews, jam, Avi (use Gerrit), pam+watch_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Hide translate infobar on programmatic navigation. In Google news, you can change the UI language through a popup menu [which does so by submitting a form programmatically]. The translation infobar wasn't being refreshed in this situation because the page navigation being performed is programmatic. Infobar hiding on navigation, goes through TabContents::ExpireInfoBars() which has an early return if the navigation just performed wasn't initiated by the user. After this, the code loops through the list of infobars and calls ShouldExpire() on each one to determine if it can be closed. This CL removes the early return and moves the code to determine dismissal to the ShouldExpire() method of the infobar delegates, thus allowing the translate infobar to indicate that it can be dismissed on page navigation. BUG=70261 TEST=See bug. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=85731

Patch Set 1 #

Total comments: 3

Patch Set 2 : Less invasive change #

Total comments: 5

Patch Set 3 : new #

Patch Set 4 : Update testcase. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -19 lines) Patch
M chrome/browser/omnibox_search_hint.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/infobar_delegate.h View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/infobar_delegate.cc View 1 2 1 chunk +11 lines, -0 lines 1 comment Download
M chrome/browser/translate/translate_infobar_delegate.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/translate/translate_infobar_delegate.cc View 1 2 1 chunk +10 lines, -0 lines 1 comment Download
M chrome/browser/translate/translate_manager_browsertest.cc View 1 2 3 1 chunk +0 lines, -7 lines 1 comment Download
M chrome/browser/ui/browser_init.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/keystone_infobar.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/tab_contents/tab_contents.cc View 1 2 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jeremy
brettw/ben: Only need one of you to look at this.
9 years, 7 months ago (2011-05-01 13:50:44 UTC) #1
jeremy
9 years, 7 months ago (2011-05-01 13:51:55 UTC) #2
brettw
http://codereview.chromium.org/6883299/diff/1/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc (right): http://codereview.chromium.org/6883299/diff/1/chrome/browser/translate/translate_infobar_delegate.cc#newcode357 chrome/browser/translate/translate_infobar_delegate.cc:357: return (contents_unique_id_ != details.entry->unique_id()) || Might we still want ...
9 years, 7 months ago (2011-05-02 16:35:25 UTC) #3
MAD
An alternate proposal... http://codereview.chromium.org/6883299/diff/1/chrome/browser/tab_contents/infobar_delegate.cc File chrome/browser/tab_contents/infobar_delegate.cc (right): http://codereview.chromium.org/6883299/diff/1/chrome/browser/tab_contents/infobar_delegate.cc#newcode27 chrome/browser/tab_contents/infobar_delegate.cc:27: if (!details.is_user_initiated_main_frame_load()) Why not do this ...
9 years, 7 months ago (2011-05-02 19:18:02 UTC) #4
jeremy
mad: I made a less invasive change per-your-suggestions by adding a DoNotCloseOnProgrammaticNavigation() virtual method. I ...
9 years, 7 months ago (2011-05-11 08:24:02 UTC) #5
MAD
Excellent. Thanks! LGTM with two coding style change requests... And after spending some time triaging ...
9 years, 7 months ago (2011-05-13 12:41:56 UTC) #6
brettw
http://codereview.chromium.org/6883299/diff/5001/chrome/browser/tab_contents/infobar_delegate.cc File chrome/browser/tab_contents/infobar_delegate.cc (right): http://codereview.chromium.org/6883299/diff/5001/chrome/browser/tab_contents/infobar_delegate.cc#newcode30 chrome/browser/tab_contents/infobar_delegate.cc:30: return true; Indentation messed up. http://codereview.chromium.org/6883299/diff/5001/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc (right): ...
9 years, 7 months ago (2011-05-13 17:04:45 UTC) #7
jeremy
That's what I did in my first patch but changed due to mad's review comment. ...
9 years, 7 months ago (2011-05-13 17:17:15 UTC) #8
MAD
Ho, sorry, I looked too quickly, so I revoke my LGTM... The goal of my ...
9 years, 7 months ago (2011-05-13 18:07:32 UTC) #9
brettw
LGTM from a high level, I'll assume you'll work with MAD to reduce duplication and ...
9 years, 7 months ago (2011-05-13 18:10:36 UTC) #10
jeremy
New version uploaded - ready for another look.
9 years, 7 months ago (2011-05-17 10:46:23 UTC) #11
jeremy
http://codereview.chromium.org/6883299/diff/20001/chrome/browser/translate/translate_manager_browsertest.cc File chrome/browser/translate/translate_manager_browsertest.cc (left): http://codereview.chromium.org/6883299/diff/20001/chrome/browser/translate/translate_manager_browsertest.cc#oldcode724 chrome/browser/translate/translate_manager_browsertest.cc:724: // Navigate in page, the same infobar should still ...
9 years, 7 months ago (2011-05-17 14:52:14 UTC) #12
MAD
9 years, 7 months ago (2011-05-17 16:25:55 UTC) #13
Cool Thanks!

LGTM with two style nits...

BYE
MAD

http://codereview.chromium.org/6883299/diff/20001/chrome/browser/tab_contents...
File chrome/browser/tab_contents/infobar_delegate.cc (right):

http://codereview.chromium.org/6883299/diff/20001/chrome/browser/tab_contents...
chrome/browser/tab_contents/infobar_delegate.cc:28: return false;
Too much indent...

http://codereview.chromium.org/6883299/diff/20001/chrome/browser/translate/tr...
File chrome/browser/translate/translate_infobar_delegate.cc (right):

http://codereview.chromium.org/6883299/diff/20001/chrome/browser/translate/tr...
chrome/browser/translate/translate_infobar_delegate.cc:356: // was programmatic
and not initiated by the user - crbug.com/70261 .
Remove extra space before '.'

Powered by Google App Engine
This is Rietveld 408576698