1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 package org.chromium.chrome.browser.omnibox;
6 
7 import android.content.Context;
8 import android.util.AttributeSet;
9 import android.view.ViewStructure;
10 
11 import org.chromium.base.annotations.VerifiesOnO;
12 
13 /**
14  * Sub-class of UrlBar that contains newer Android APIs to avoid verification errors.
15  *
16  * Only super calls to new Android APIs belong here - if it is a normal call to a new Android API,
17  * use ApiHelperForX. See crbug.com/999165 for more description of what verification errors are and
18  * why they are expensive.
19  */
20 @VerifiesOnO
21 public class UrlBarApi26 extends UrlBar {
UrlBarApi26(Context context, AttributeSet attrs)22     public UrlBarApi26(Context context, AttributeSet attrs) {
23         super(context, attrs);
24     }
25 
26     @Override
onProvideAutofillStructure(ViewStructure structure, int autofillFlags)27     public void onProvideAutofillStructure(ViewStructure structure, int autofillFlags) {
28         // https://crbug.com/996402: Prevent breaking autofill services on newer versions of
29         // Android.
30         mRequestingAutofillStructure = true;
31         super.onProvideAutofillStructure(structure, autofillFlags);
32         mRequestingAutofillStructure = false;
33     }
34 }
35