[Android] Fixed assert on url bar focus change
Chromium change: https://github.com/chromium/chromium/commit/b964b99f01113d8f0107f81cbdea03c98429e874 Add logic to track suggestions list scroll events. This change allows us to learn how frequently our users need to scroll the suggestions list in order to find what they are looking for. Bug: 1291761
This commit is contained in:
committed by
Claudio DeSouza
parent
ded3e30a24
commit
852a600f71
@@ -434,6 +434,7 @@
|
||||
}
|
||||
|
||||
-keep class org.chromium.chrome.browser.omnibox.suggestions.AutocompleteMediator {
|
||||
*** mNativeInitialized;
|
||||
public <init>(...);
|
||||
}
|
||||
|
||||
|
||||
@@ -697,6 +697,9 @@ public class BytecodeTest {
|
||||
Assert.assertTrue(fieldExists(
|
||||
"org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings", "mSite",
|
||||
true, Website.class));
|
||||
Assert.assertTrue(
|
||||
fieldExists("org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator",
|
||||
"mNativeInitialized", true, boolean.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+9
@@ -30,6 +30,8 @@ import org.chromium.ui.modelutil.PropertyModel;
|
||||
class BraveAutocompleteMediator extends AutocompleteMediator {
|
||||
private static final String AUTOCOMPLETE_ENABLED = "brave.autocomplete_enabled";
|
||||
|
||||
private boolean mNativeInitialized;
|
||||
|
||||
public BraveAutocompleteMediator(@NonNull Context context,
|
||||
@NonNull AutocompleteDelegate delegate,
|
||||
@NonNull UrlBarEditingTextStateProvider textProvider,
|
||||
@@ -59,4 +61,11 @@ class BraveAutocompleteMediator extends AutocompleteMediator {
|
||||
|
||||
super.onTextChanged(textWithoutAutocomplete, textWithAutocomplete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUrlFocusChange(boolean hasFocus) {
|
||||
if (!mNativeInitialized) return;
|
||||
|
||||
super.onUrlFocusChange(hasFocus);
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -17,5 +17,8 @@ public class BraveAutocompleteMediatorClassAdapter extends BraveClassVisitor {
|
||||
super(visitor);
|
||||
|
||||
redirectConstructor(sAutocompleteMediator, sBraveAutocompleteMediator);
|
||||
|
||||
deleteField(sBraveAutocompleteMediator, "mNativeInitialized");
|
||||
makeProtectedField(sAutocompleteMediator, "mNativeInitialized");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user