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

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

Issue 1150193004: Straighten up life cycle of native InfoBar pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed setNativeInfoBarPtr calls from child classes Created 5 years, 7 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
Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java
index 00d9d4024f892454557df6893835b1cfa76531e4..af7d82e299ff003faae43475b9e295621b3dc9f3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java
@@ -21,19 +21,17 @@ public class TranslateInfoBarDelegate {
@CalledByNative
boolean changeTranslateInfoBarTypeAndPointer(
- long newNativeInfoBar, int translateBarType) {
+ long newNativeInfoBar, long newNativeTranslateInfoBar, int translateBarType) {
mInfoBar.changeInfoBarTypeAndNativePointer(
- translateBarType, newNativeInfoBar);
+ translateBarType, newNativeInfoBar, newNativeTranslateInfoBar);
return true;
}
@CalledByNative
- InfoBar showTranslateInfoBar(
- long nativeInfoBar, int translateBarType,
+ InfoBar showTranslateInfoBar(long nativeTranslateInfoBarPtr, int translateBarType,
int sourceLanguageIndex, int targetLanguageIndex, boolean autoTranslatePair,
- boolean showNeverInfobar, boolean triggeredFromMenu,
- String[] languages) {
- mInfoBar = new TranslateInfoBar(nativeInfoBar, this, translateBarType,
+ boolean showNeverInfobar, boolean triggeredFromMenu, String[] languages) {
+ mInfoBar = new TranslateInfoBar(nativeTranslateInfoBarPtr, this, translateBarType,
sourceLanguageIndex, targetLanguageIndex, autoTranslatePair, showNeverInfobar,
triggeredFromMenu, languages);
return mInfoBar;

Powered by Google App Engine
This is Rietveld 408576698