Commit 5737ebb1 authored by Clark DuVall's avatar Clark DuVall Committed by Chromium LUCI CQ

Fix autofill_assistant DFM crashing when inflating layouts

With isolated splits enabled, the classes from a DFM will not be
available in the base ClassLoader. This change makes sure all of the
calls to inflate in autofill_assistant are able to access the classes
defined in the DFM.

Bug: 1158028, b/174219371
Change-Id: I6e6599f0831b089d97d5041864ce9df41c00e0f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587872Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836722}
parent 47d4c253
......@@ -35,6 +35,7 @@ android_library("java") {
":java_resources",
"//base:base_java",
"//base:jni_java",
"//chrome/android:base_module_java",
"//chrome/android:chrome_java",
"//chrome/browser/browser_controls/android:java",
"//chrome/browser/feedback/android:java",
......@@ -111,6 +112,7 @@ android_library("java") {
"java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/BottomSheetUtils.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/FeedbackContext.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/LayoutUtils.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/SizeListenableLinearLayout.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantActionsCarouselCoordinator.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantActionsDecoration.java",
......
......@@ -9,7 +9,6 @@ import android.transition.ChangeBounds;
import android.transition.Fade;
import android.transition.TransitionManager;
import android.transition.TransitionSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
......@@ -125,8 +124,9 @@ class AssistantBottomBarCoordinator implements AssistantPeekHeightCoordinator.De
}
// Replace or set the content to the actual Autofill Assistant views.
mRootViewContainer = (AssistantRootViewContainer) LayoutInflater.from(activity).inflate(
R.layout.autofill_assistant_bottom_sheet_content, /* root= */ null);
mRootViewContainer =
(AssistantRootViewContainer) LayoutUtils.createInflater(activity).inflate(
R.layout.autofill_assistant_bottom_sheet_content, /* root= */ null);
mScrollableContent = mRootViewContainer.findViewById(R.id.scrollable_content);
ViewGroup scrollableContentContainer =
mScrollableContent.findViewById(R.id.scrollable_content_container);
......
......@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.autofill_assistant;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;
......@@ -31,7 +30,7 @@ public class AssistantBottomSheetContent implements BottomSheetContent {
public AssistantBottomSheetContent(
Context context, Supplier<AssistantBottomBarDelegate> supplier) {
mToolbarView = LayoutInflater.from(context).inflate(
mToolbarView = LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_bottom_sheet_toolbar, /* root= */ null);
mContentView = new SizeListenableLinearLayout(context);
mContentView.setLayoutParams(new ViewGroup.LayoutParams(
......
......@@ -8,7 +8,6 @@ import android.content.Context;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.widget.ScrollView;
import android.widget.TextView;
......@@ -258,7 +257,7 @@ class AssistantOnboardingCoordinator {
* Set the content of the bottom sheet to be the Autofill Assistant onboarding.
*/
private void initContent(Callback<Boolean> callback) {
mView = (ScrollView) LayoutInflater.from(mContext).inflate(
mView = (ScrollView) LayoutUtils.createInflater(mContext).inflate(
R.layout.autofill_assistant_onboarding, /* root= */ null);
// Set focusable for accessibility.
......
......@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.autofill_assistant;
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
......@@ -11,6 +12,7 @@ import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import org.chromium.base.ContextUtils;
import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
import org.chromium.chrome.browser.util.ChromeAccessibilityUtil;
......@@ -28,8 +30,9 @@ public class AssistantRootViewContainer
public AssistantRootViewContainer(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
assert context instanceof ChromeActivity;
mActivity = (ChromeActivity) context;
Activity activity = ContextUtils.activityFromContext(context);
assert activity instanceof ChromeActivity;
mActivity = (ChromeActivity) activity;
mBrowserControlsStateProvider = mActivity.getBrowserControlsManager();
mBrowserControlsStateProvider.addObserver(this);
}
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.autofill_assistant;
import android.content.Context;
import android.view.LayoutInflater;
import org.chromium.chrome.browser.base.SplitCompatUtils;
/** Utilities for dealing with layouts and inflation. */
public class LayoutUtils {
private static final String ASSISTANT_SPLIT_NAME = "autofill_assistant";
/**
* Creates a LayoutInflater which can be used to inflate layouts from the autofill_assistant
* module.
*/
public static LayoutInflater createInflater(Context context) {
return LayoutInflater.from(
SplitCompatUtils.createContextForInflation(context, ASSISTANT_SPLIT_NAME));
}
}
......@@ -14,6 +14,7 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
/**
* The {@link ViewHolder} responsible for reflecting an {@link AssistantChip} to a {@link
......@@ -33,7 +34,7 @@ public class AssistantChipViewHolder extends ViewHolder {
}
public static AssistantChipViewHolder create(ViewGroup parent, int viewType) {
LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
LayoutInflater layoutInflater = LayoutUtils.createInflater(parent.getContext());
ButtonView view = null;
switch (viewType) {
case AssistantChip.Type.CHIP_ASSISTIVE:
......
......@@ -5,13 +5,13 @@
package org.chromium.chrome.browser.autofill_assistant.details;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.VisibleForTesting;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AutofillAssistantUiController;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.details.AssistantDetailsViewBinder.ViewHolder;
import org.chromium.chrome.browser.image_fetcher.ImageFetcher;
import org.chromium.chrome.browser.image_fetcher.ImageFetcherConfig;
......@@ -34,7 +34,7 @@ public class AssistantDetailsCoordinator {
@VisibleForTesting
public AssistantDetailsCoordinator(
Context context, AssistantDetailsModel model, ImageFetcher imageFetcher) {
mView = LayoutInflater.from(context).inflate(
mView = LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_details, /* root= */ null);
mModel = model;
ViewHolder viewHolder = new ViewHolder(context, mView);
......
......@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.autofill_assistant.form;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
......@@ -13,6 +12,7 @@ import android.widget.TextView;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
/**
* A coordinator responsible for showing a form to the user.
......@@ -32,7 +32,7 @@ public class AssistantFormCoordinator {
mFormView = makeLinearLayout(context);
mInfoView = (LinearLayout) LayoutInflater.from(context).inflate(
mInfoView = (LinearLayout) LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_form_information, mRootView,
/* attachToRoot= */ false);
......
......@@ -10,13 +10,13 @@ import android.transition.Fade;
import android.transition.Transition;
import android.transition.TransitionManager;
import android.transition.TransitionSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.util.ChromeAccessibilityUtil;
import java.util.ArrayList;
......@@ -48,7 +48,7 @@ class AssistantFormCounterInput extends AssistantFormInput {
private final View mIncreaseButtonView;
private CounterViewHolder(Context context) {
mView = LayoutInflater.from(context).inflate(
mView = LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_form_counter, /*root= */ null);
mLabelView = mView.findViewById(R.id.label);
mDescriptionLine1View = mView.findViewById(R.id.description_line_1);
......@@ -95,7 +95,7 @@ class AssistantFormCounterInput extends AssistantFormInput {
@Override
public View createView(Context context, ViewGroup parent) {
ViewGroup root = (ViewGroup) LayoutInflater.from(context).inflate(
ViewGroup root = (ViewGroup) LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_form_counter_input, parent, /* attachToRoot= */ false);
TextView label = root.findViewById(R.id.label);
if (mLabel.isEmpty()) {
......
......@@ -13,6 +13,7 @@ import android.widget.TextView;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.user_data.AssistantChoiceList;
import java.util.ArrayList;
......@@ -41,7 +42,7 @@ class AssistantFormSelectionInput extends AssistantFormInput {
@Override
public View createView(Context context, ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(context);
LayoutInflater inflater = LayoutUtils.createInflater(context);
ViewGroup root = (ViewGroup) inflater.inflate(
R.layout.autofill_assistant_form_selection_input, parent,
/* attachToRoot= */ false);
......
......@@ -9,7 +9,6 @@ import static org.chromium.chrome.browser.autofill_assistant.AssistantAccessibil
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
......@@ -23,6 +22,7 @@ import org.chromium.base.annotations.JNINamespace;
import org.chromium.chrome.browser.autofill.prefeditor.EditorFieldModel;
import org.chromium.chrome.browser.autofill.prefeditor.EditorTextField;
import org.chromium.chrome.browser.autofill_assistant.AssistantChevronStyle;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.user_data.AssistantVerticalExpander;
import org.chromium.chrome.browser.autofill_assistant.user_data.AssistantVerticalExpanderAccordion;
import org.chromium.ui.widget.ChromeImageView;
......@@ -116,7 +116,7 @@ public class AssistantViewFactory {
/** Creates a divider widget as used in the {@code AssistantCollectUserData} action. */
@CalledByNative
public static View createDividerView(Context context, String identifier) {
View divider = LayoutInflater.from(context).inflate(
View divider = LayoutUtils.createInflater(context).inflate(
org.chromium.chrome.autofill_assistant.R.layout
.autofill_assistant_payment_request_section_divider,
null, false);
......
......@@ -6,7 +6,6 @@ package org.chromium.chrome.browser.autofill_assistant.header;
import android.content.Context;
import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
......@@ -17,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AutofillAssistantUiController;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChipAdapter;
import org.chromium.chrome.browser.autofill_assistant.header.AssistantHeaderViewBinder.ViewHolder;
import org.chromium.chrome.browser.signin.services.DisplayableProfileData;
......@@ -44,7 +44,7 @@ public class AssistantHeaderCoordinator implements ProfileDataCache.Observer {
// Create the poodle and insert it before the status message. We have to create a view
// bigger than the desired poodle size (24dp) because the actual downstream implementation
// needs extra space for the animation.
mView = (ViewGroup) LayoutInflater.from(context).inflate(
mView = (ViewGroup) LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_header, /* root= */ null);
AnimatedPoodle poodle = new AnimatedPoodle(context,
context.getResources().getDimensionPixelSize(
......
......@@ -5,11 +5,11 @@
package org.chromium.chrome.browser.autofill_assistant.infobox;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AutofillAssistantUiController;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.infobox.AssistantInfoBoxViewBinder.ViewHolder;
import org.chromium.chrome.browser.image_fetcher.ImageFetcher;
import org.chromium.chrome.browser.image_fetcher.ImageFetcherConfig;
......@@ -32,7 +32,7 @@ public class AssistantInfoBoxCoordinator {
/** Used for testing to inject an image fetcher. */
public AssistantInfoBoxCoordinator(
Context context, AssistantInfoBoxModel model, ImageFetcher imageFetcher) {
mView = LayoutInflater.from(context).inflate(
mView = LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_info_box, /* root= */ null);
ViewHolder viewHolder = new ViewHolder(context, mView);
mViewBinder = new AssistantInfoBoxViewBinder(context, imageFetcher);
......
......@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.autofill_assistant.trigger_scripts;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
......@@ -20,6 +19,7 @@ import org.chromium.chrome.browser.autofill_assistant.AssistantBottomBarDelegate
import org.chromium.chrome.browser.autofill_assistant.AssistantBottomSheetContent;
import org.chromium.chrome.browser.autofill_assistant.AssistantRootViewContainer;
import org.chromium.chrome.browser.autofill_assistant.BottomSheetUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChip;
import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChipViewHolder;
import org.chromium.chrome.browser.autofill_assistant.generic_ui.AssistantDimension;
......@@ -140,7 +140,7 @@ public class AssistantTriggerScript {
horizontalMargin, verticalMargin, horizontalMargin, verticalMargin);
AssistantRootViewContainer rootViewContainer =
(AssistantRootViewContainer) LayoutInflater.from(mContext).inflate(
(AssistantRootViewContainer) LayoutUtils.createInflater(mContext).inflate(
R.layout.autofill_assistant_bottom_sheet_content, /* root= */ null);
ScrollView scrollableContent = rootViewContainer.findViewById(R.id.scrollable_content);
rootViewContainer.addView(mHeaderCoordinator.getView(), 0);
......
......@@ -6,7 +6,6 @@ package org.chromium.chrome.browser.autofill_assistant.user_data;
import android.app.Activity;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
......@@ -15,6 +14,7 @@ import androidx.annotation.VisibleForTesting;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTagsForTesting;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.user_data.additional_sections.AssistantAdditionalSectionContainer;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
......@@ -167,7 +167,7 @@ public class AssistantCollectUserDataCoordinator {
}
private void createSeparator(ViewGroup parent) {
View divider = LayoutInflater.from(mActivity).inflate(
View divider = LayoutUtils.createInflater(mActivity).inflate(
R.layout.autofill_assistant_payment_request_section_divider, parent, false);
divider.setTag(DIVIDER_TAG);
parent.addView(divider);
......
......@@ -19,6 +19,7 @@ import org.chromium.base.Callback;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTagsForTesting;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.components.autofill.EditableOption;
import java.util.ArrayList;
......@@ -82,7 +83,7 @@ public abstract class AssistantCollectUserDataSection<T extends EditableOption>
mItems = new ArrayList<>();
mTitleToContentPadding = titleToContentPadding;
LayoutInflater inflater = LayoutInflater.from(context);
LayoutInflater inflater = LayoutUtils.createInflater(context);
mSectionExpander = new AssistantVerticalExpander(context, null);
View sectionTitle =
inflater.inflate(R.layout.autofill_assistant_payment_request_section_title, null);
......@@ -290,7 +291,7 @@ public abstract class AssistantCollectUserDataSection<T extends EditableOption>
* Creates a new item from {@code option}.
*/
private Item createItem(T option) {
View fullView = LayoutInflater.from(mContext).inflate(mFullViewResId, null);
View fullView = LayoutUtils.createInflater(mContext).inflate(mFullViewResId, null);
updateFullView(fullView, option);
Item item = new Item(fullView, option);
return item;
......
......@@ -16,6 +16,7 @@ import androidx.annotation.Nullable;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantChevronStyle;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.content.browser.input.PopupItemType;
import org.chromium.content.browser.input.SelectPopupDialog;
import org.chromium.content.browser.input.SelectPopupItem;
......@@ -62,7 +63,7 @@ public class AssistantDateSection {
mTitleToContentPadding = context.getResources().getDimensionPixelSize(
R.dimen.autofill_assistant_payment_request_title_padding);
LayoutInflater inflater = LayoutInflater.from(context);
LayoutInflater inflater = LayoutUtils.createInflater(context);
mRootLayout = (LinearLayout) inflater.inflate(R.layout.autofill_assistant_datetime, null);
mRootLayout.setVisibility(View.GONE);
......@@ -139,7 +140,7 @@ public class AssistantDateSection {
/** Common view configuration for the vertical expanders. */
private void setupExpander(Context context, AssistantVerticalExpander expander) {
View titleView = LayoutInflater.from(context).inflate(
View titleView = LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_payment_request_section_title, null);
TextView summaryView = new TextView(context);
summaryView.setSingleLine();
......
......@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.autofill_assistant.user_data;
import android.content.Context;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
......@@ -19,6 +18,7 @@ import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTagsForTesting;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
/**
* The third party terms and conditions section of the Autofill Assistant payment request.
......@@ -40,7 +40,7 @@ public class AssistantTermsSection {
private Delegate mDelegate;
AssistantTermsSection(Context context, ViewGroup parent, boolean showAsSingleCheckbox) {
mView = LayoutInflater.from(context).inflate(
mView = LayoutUtils.createInflater(context).inflate(
R.layout.autofill_assistant_payment_request_terms_and_conditions, parent, false);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
......
......@@ -11,6 +11,7 @@ import android.view.ViewGroup;
import android.widget.Space;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.user_data.AssistantCollectUserDataCoordinator;
import org.chromium.chrome.browser.autofill_assistant.user_data.additional_sections.AssistantAdditionalSection.Delegate;
......@@ -44,7 +45,7 @@ public class AssistantAdditionalSectionContainer {
mSections.clear();
int index = mParent.indexOfChild(mPlaceholderView);
LayoutInflater inflater = LayoutInflater.from(mContext);
LayoutInflater inflater = LayoutUtils.createInflater(mContext);
for (int i = sections.size() - 1; i >= 0; i--) {
View divider = inflater.inflate(
R.layout.autofill_assistant_payment_request_section_divider, mParent, false);
......
......@@ -16,6 +16,7 @@ import androidx.annotation.Nullable;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantChevronStyle;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.generic_ui.AssistantValue;
import org.chromium.chrome.browser.autofill_assistant.user_data.AssistantVerticalExpander;
import org.chromium.content.browser.input.PopupItemType;
......@@ -77,7 +78,7 @@ public class AssistantPopupListSection implements AssistantAdditionalSection {
mTitleToContentPadding = context.getResources().getDimensionPixelSize(
R.dimen.autofill_assistant_payment_request_title_padding);
LayoutInflater inflater = LayoutInflater.from(context);
LayoutInflater inflater = LayoutUtils.createInflater(context);
mSectionExpander = new AssistantVerticalExpander(context, null);
View sectionTitle =
inflater.inflate(R.layout.autofill_assistant_payment_request_section_title, null);
......
......@@ -13,6 +13,7 @@ import android.widget.TextView;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
/** A section which displays a simple static text message. */
public class AssistantStaticTextSection implements AssistantAdditionalSection {
......@@ -40,7 +41,7 @@ public class AssistantStaticTextSection implements AssistantAdditionalSection {
mTitleToContentPadding = context.getResources().getDimensionPixelSize(
R.dimen.autofill_assistant_payment_request_title_padding);
LayoutInflater inflater = LayoutInflater.from(context);
LayoutInflater inflater = LayoutUtils.createInflater(context);
mRootLayout = (LinearLayout) inflater.inflate(
R.layout.autofill_assistant_static_text_section, null);
......
......@@ -25,6 +25,7 @@ import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill.prefeditor.EditorFieldModel;
import org.chromium.chrome.browser.autofill.prefeditor.EditorTextField;
import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils;
import org.chromium.chrome.browser.autofill_assistant.LayoutUtils;
import org.chromium.chrome.browser.autofill_assistant.generic_ui.AssistantValue;
import org.chromium.chrome.browser.autofill_assistant.user_data.AssistantVerticalExpander;
......@@ -113,7 +114,7 @@ public class AssistantTextInputSection implements AssistantAdditionalSection {
mTitleToContentPadding = context.getResources().getDimensionPixelSize(
R.dimen.autofill_assistant_payment_request_title_padding);
LayoutInflater inflater = LayoutInflater.from(context);
LayoutInflater inflater = LayoutUtils.createInflater(context);
mSectionExpander = new AssistantVerticalExpander(context, null);
View sectionTitle =
inflater.inflate(R.layout.autofill_assistant_payment_request_section_title, null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment