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

Issue 1142153002: Simplify infobar expiry. (Closed)

Created:
5 years, 7 months ago by Peter Kasting
Modified:
5 years, 7 months ago
CC:
browser-components-watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, estade+watch_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, gcasto+watchlist_chromium.org, mcasas+watch_chromium.org, mkwst+watchlist-passwords_chromium.org, mlamouri+watch-geolocation_chromium.org, mlamouri+watch-notifications_chromium.org, Michael van Ouwerkerk, peter+watch_chromium.org, posciak+watch_chromium.org, rouslan+autofillwatch_chromium.org, toyoshim+midi_chromium.org, vabr+watchlist_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Simplify infobar expiry. Some of the changes below may have a functional effect, but I don't _think_ they will, if they do it should be minor, and I don't know another way of finding out than trying to make this change and seeing what happens. (Besides simplification, this change is also intended to unblock https://codereview.chromium.org/1139823006/ , which doesn't want to affect infobar behavior but without this change might do so.) * Moved the check for "!details.did_replace_entry" from ConfirmInfoBarDelegate up to the base class. Very few people subclass the base class anyway, and for those who do, there's no obvious reason not to do this. I actually suggested doing this in a review several years ago but it never happened. * Removed InfoBarDelegate::ShouldExpireInternal(), which didn't seem to be doing much useful. I think the unique ID check was basically doing the same thing as the "is_navigation_to_different_page" bit that was already checked in ShouldExpire() (which didn't exist when the unique IDs were added long ago). So if we got to ShouldExpireInternal() at all, that would be true regardless, and thus that helper would always return true. (Incidentally, reloads _are_ treated as "navigations to a different page", so we still dismiss infobars by default on reload. If this wasn't true we'd have already been broken anyway, since ShouldExpire() would have early-returned false.) * Removed ProtectedMediaIdentifierInfoBarDelegate::ShouldExpireInternal(). I discussed this with kkimlabs@, the original author, and neither of us can understand why it was necessary to begin with. We both think this should be removed. * Removed the wonky TranslateInfoBarDelegate::ShouldExpire(). Long ago, this used to check a bit called "is_auto", because it was trying to allow the infobar to be dismissed even for automatic navigations, whereas other infobars wanted to only be dismissed for user-driven ones. However, the "is_auto" bit was later removed, and the replacement code didn't really work the same way, and besides this, the conditional didn't really make sense, since "!details.is_main_frame" implies "!details.is_navigation_to_different_page". So we basically had a function that would call InfoBarDelegate::ShouldExpireInternal() for all main-frame navigations. But since, as I said above, I think the unique ID check there was functionally the same as checking for a "navigation to a different page"... I think all this ended up just doing the same thing as the original base function. And I couldn't check because the translate infobar no longer exists for views anyway. So whatever. * Removed copy-and-pasted code that wasn't needed. BUG=none TEST=none Committed: https://crrev.com/34cc3c8d2b014a6413709ba88249eb2bd3c933a7 Cr-Commit-Position: refs/heads/master@{#330817}

Patch Set 1 #

Patch Set 2 : Fix Android compile #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -141 lines) Patch
M chrome/browser/extensions/api/debugger/debugger_api.cc View 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/geolocation/geolocation_infobar_delegate.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/geolocation/geolocation_infobar_delegate.cc View 2 chunks +2 lines, -17 lines 2 comments Download
M chrome/browser/media/midi_permission_infobar_delegate.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/media/midi_permission_infobar_delegate.cc View 2 chunks +1 line, -11 lines 0 comments Download
M chrome/browser/media/protected_media_identifier_infobar_delegate.h View 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/media/protected_media_identifier_infobar_delegate.cc View 1 5 chunks +3 lines, -18 lines 0 comments Download
M chrome/browser/notifications/desktop_notification_infobar_delegate.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/notifications/desktop_notification_infobar_delegate.cc View 2 chunks +1 line, -12 lines 0 comments Download
M chrome/browser/password_manager/save_password_infobar_delegate.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/keystone_infobar_delegate.mm View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/startup/autolaunch_prompt_win.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/startup/default_browser_prompt.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M components/autofill/core/browser/autofill_cc_infobar_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/core/browser/autofill_cc_infobar_delegate.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M components/infobars/core/confirm_infobar_delegate.h View 1 chunk +0 lines, -2 lines 0 comments Download
M components/infobars/core/confirm_infobar_delegate.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M components/infobars/core/infobar.h View 1 chunk +3 lines, -3 lines 0 comments Download
M components/infobars/core/infobar.cc View 1 chunk +0 lines, -1 line 0 comments Download
M components/infobars/core/infobar_delegate.h View 1 chunk +0 lines, -12 lines 0 comments Download
M components/infobars/core/infobar_delegate.cc View 2 chunks +2 lines, -16 lines 0 comments Download
M components/infobars/core/simple_alert_infobar_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M components/infobars/core/simple_alert_infobar_delegate.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/translate/core/browser/translate_infobar_delegate.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/translate/core/browser/translate_infobar_delegate.cc View 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
Peter Kasting
Adding OWNERS: finnur: chrome/browser/extensions/ timvolodine: chrome/browser/geolocation/ ddorwin: chrome/browser/media/ stevenjb: chrome/browser/notifications/ hajimehoshi: components/translate/
5 years, 7 months ago (2015-05-19 21:21:43 UTC) #3
ddorwin
chrome/browser/media/ LGTM
5 years, 7 months ago (2015-05-19 21:29:04 UTC) #4
Ilya Sherman
LGTM. Thanks for the cleanup, Peter =)
5 years, 7 months ago (2015-05-19 23:06:23 UTC) #5
hajimehoshi
translate lgtm
5 years, 7 months ago (2015-05-20 03:52:17 UTC) #6
timvolodine
chrome/browser/geolocation/ lgtm https://codereview.chromium.org/1142153002/diff/20001/chrome/browser/geolocation/geolocation_infobar_delegate.cc File chrome/browser/geolocation/geolocation_infobar_delegate.cc (left): https://codereview.chromium.org/1142153002/diff/20001/chrome/browser/geolocation/geolocation_infobar_delegate.cc#oldcode46 chrome/browser/geolocation/geolocation_infobar_delegate.cc:46: int contents_unique_id, wow looks like this was ...
5 years, 7 months ago (2015-05-20 11:44:01 UTC) #7
Finnur
chrome/browser/extensions/ LGTM
5 years, 7 months ago (2015-05-20 12:05:37 UTC) #8
Mike West
chrome/browser/password_manager LGTM.
5 years, 7 months ago (2015-05-20 12:06:25 UTC) #10
Peter Kasting
https://codereview.chromium.org/1142153002/diff/20001/chrome/browser/geolocation/geolocation_infobar_delegate.cc File chrome/browser/geolocation/geolocation_infobar_delegate.cc (left): https://codereview.chromium.org/1142153002/diff/20001/chrome/browser/geolocation/geolocation_infobar_delegate.cc#oldcode46 chrome/browser/geolocation/geolocation_infobar_delegate.cc:46: int contents_unique_id, On 2015/05/20 11:44:01, timvolodine wrote: > wow ...
5 years, 7 months ago (2015-05-20 18:22:00 UTC) #11
Dmitry Titov
c/b/notifications LGTM
5 years, 7 months ago (2015-05-20 20:26:02 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1142153002/20001
5 years, 7 months ago (2015-05-20 20:30:37 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 7 months ago (2015-05-20 22:27:51 UTC) #15
commit-bot: I haz the power
5 years, 7 months ago (2015-05-20 22:29:04 UTC) #16
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/34cc3c8d2b014a6413709ba88249eb2bd3c933a7
Cr-Commit-Position: refs/heads/master@{#330817}

Powered by Google App Engine
This is Rietveld 408576698