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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java

Issue 26176007: [InfoBar] Always close native infobars from C++ (Part I) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 2 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 | chrome/browser/ui/android/infobars/confirm_infobar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
index e35d302650cec272c96b7ccfad30cdcc9c0adb76..77e5c0393e98aba8222b27d04dd3ba99dc98feb3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
@@ -98,9 +98,11 @@ public abstract class InfoBar implements InfoBarView {
// Determine if the infobar should be dismissed when |url| is loaded. Calling
// setExpireOnNavigation(true/false) causes this method always to return true/false.
- // For more control, subclasses can override this method and take the url into account.
- public boolean shouldExpire(String url) {
- return mExpireOnNavigation;
+ // This only applies to java-only infobars. C++ infobars will use the same logic
+ // as other platforms so they are not attempted to be dismissed twice.
+ // It should really be removed once all infobars have a C++ counterpart.
+ public final boolean shouldExpire(String url) {
+ return mExpireOnNavigation && mNativeInfoBarPtr == 0;
}
// Sets whether the bar should be dismissed when a navigation occurs.
« no previous file with comments | « no previous file | chrome/browser/ui/android/infobars/confirm_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698