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

Issue 1596713003: Discourage creation of Java infobars without InfoBarDelegates (Closed)

Created:
4 years, 11 months ago by gone
Modified:
4 years, 11 months ago
CC:
chromium-reviews, asanka, asvitkine+watch_chromium.org, dfalcantara+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Discourage creation of Java infobars without InfoBarDelegates Java: * Make InfoBarContainer#addInfoBar() a private method so it can't be abused anymore. * Get rid of InfoBar.dismissJavaOnlyInfoBar() and the assorted InfoBarListeners to prevent them from being used incorrectly. * Introduce a SimpleConfirmInfoBarBuilder class that makes it easier for devs to create infobars that operate mostly in Java that are still backed by native InfoBarDelegates. C++: * Expose InfoBarIdentifier enum to Java-side code. Although the end goal is to get rid of Java-only infobars entirely, we're still stuck with a generic infobar for popping up errors from ChromeWindow#showCallbackNonExistentError() (e.g.). * Introduce an Android-specific SimpleConfirmInfoBarDelegate class that listens for button clicks and alerts a Java-side listener. Tests: * Renames InfoBarTest2 to InfoBarContainerTest. These weren't running at all because the test filters look for Java classes ending with the word Test, not Test2. * Deletes a few InfoBarTest2 tests that need to be rewritten for the stacking world (on newt@'s agenda). * Edited tests that directly accessed the InfoBarContainer#addInfoBar() to use the new SimpleConfirmInfoBarBuilder instead. BUG=172427, 543205, 569776 Committed: https://crrev.com/7e344082f74a50857d7c2441d1816f69c55b2ae5 Cr-Commit-Position: refs/heads/master@{#370792}

Patch Set 1 #

Total comments: 12

Patch Set 2 : pkasting@'s comments #

Patch Set 3 : Rebasing #

Total comments: 10

Patch Set 4 : Missed GN files #

Patch Set 5 : Comments, gn build fix #

Patch Set 6 : Rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+523 lines, -851 lines) Patch
M chrome/android/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java View 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java View 4 chunks +75 lines, -73 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/AutoSigninFirstRunInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBar.java View 4 chunks +4 lines, -13 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/DownloadOverwriteInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/GeneratedPasswordSavedInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java View 6 chunks +5 lines, -52 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java View 1 2 3 4 5 4 chunks +4 lines, -29 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarLayout.java View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
D chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarListeners.java View 1 chunk +0 lines, -28 lines 0 comments Download
D chrome/android/java/src/org/chromium/chrome/browser/infobar/MessageInfoBar.java View 1 chunk +0 lines, -35 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/infobar/SimpleConfirmInfoBarBuilder.java View 1 chunk +92 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
A + chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarContainerTest.java View 1 2 3 4 9 chunks +99 lines, -172 lines 0 comments Download
D chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest2.java View 1 chunk +0 lines, -432 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
A chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.h View 1 chunk +13 lines, -0 lines 0 comments Download
A chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.cc View 1 2 3 4 1 chunk +174 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M components/infobars.gypi View 1 chunk +14 lines, -0 lines 0 comments Download
M components/infobars/core/BUILD.gn View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M components/infobars/core/infobar_delegate.h View 2 chunks +5 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (9 generated)
gone
pkasting@: I had to expose the InfoBarIdentifier enum we introduced to Java code. I also ...
4 years, 11 months ago (2016-01-16 00:55:21 UTC) #2
Peter Kasting
LGTM https://codereview.chromium.org/1596713003/diff/1/chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.cc File chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.cc (right): https://codereview.chromium.org/1596713003/diff/1/chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.cc#newcode36 chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.cc:36: // InfoBarDelegate overrides: Nit: You don't directly subclass ...
4 years, 11 months ago (2016-01-16 01:00:56 UTC) #3
newt (away)
Thank you, sir. Just a few minor comments. https://codereview.chromium.org/1596713003/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java File chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java (right): https://codereview.chromium.org/1596713003/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java#newcode225 chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java:225: public ...
4 years, 11 months ago (2016-01-19 21:54:44 UTC) #4
gone
Alright, comments hopefully addressed. Thanks! * Changed infobar_delegate.cc slightly to account for null JNI string ...
4 years, 11 months ago (2016-01-19 23:43:03 UTC) #6
gone
On 2016/01/19 23:43:03, dfalcantara wrote: > * Changed infobar_delegate.cc slightly to account for null JNI ...
4 years, 11 months ago (2016-01-19 23:44:00 UTC) #7
newt (away)
lgtm
4 years, 11 months ago (2016-01-20 00:21:10 UTC) #8
Ilya Sherman
histograms.xml lgtm
4 years, 11 months ago (2016-01-20 01:26:38 UTC) #9
gone
Really, really adding thakis@chromium.org for chrome.gyp owner.
4 years, 11 months ago (2016-01-20 03:51:21 UTC) #11
Nico
lgtm
4 years, 11 months ago (2016-01-21 19:36:52 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596713003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596713003/80001
4 years, 11 months ago (2016-01-21 19:40:15 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/11191) chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, ...
4 years, 11 months ago (2016-01-21 19:44:24 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596713003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596713003/100001
4 years, 11 months ago (2016-01-21 20:04:44 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 11 months ago (2016-01-21 21:39:11 UTC) #21
commit-bot: I haz the power
4 years, 11 months ago (2016-01-21 21:40:29 UTC) #23
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/7e344082f74a50857d7c2441d1816f69c55b2ae5
Cr-Commit-Position: refs/heads/master@{#370792}

Powered by Google App Engine
This is Rietveld 408576698