This folder contains the internal parts of the Touch To Fill component. Files, classes and methods defined in here are not meant to be used outside of this package.
This document provides a brief overview of the architecture.
This component follows the typical MVC structure that is widely used in Chrome on Android. The MVC structures separates logic from representation:
//src/ui/android/java/src/org/chromium/ui/modelutil/A typical request to the Touch to Fill component API that intends to change the visible appearance involves all component parts. For example if the API caller requests to show new credentials:
credentials.credentials for display.CREDENTIAL_LIST property was changed.The model holds state and event listeners connected to the view. An MCP automatically notifies listener about any change made to a property. To automate this Observer structure, the model is a PropertyModel as defined in //src/ui/android/java/src/org/chromium/ui/modelutil/. It is build by defining readable and writable properties and constructing a model with them. The properties (and a simple factory method for the model) are located in the static TouchToFillProperties class.
The model contains writable and readable properties.The readable properties are guaranteed to never change for the lifetime of the Touch To Fill component:
The writable properties change over the course of the components lifetime:
The controller of this model implements the TouchToFillComponent interface as defined in public/ and contains all logic that affects the component's visual appearance. The controller consists of two parts:
Additional TouchToFillResourceProvider is used to select resources with any non-trivial logic that determines actual resource file/ID. It also allows overriding the selection logic by providing a different downstream implementation. Upstream implementation is defined in TouchToFillResourceProviderImpl. To support downstream overrides, corresponding build target is listed as dependency in //chrome/android/BUILD.gn, but have no any usages outside of this package.
The view contains all parts that are necessary to display the bottom sheet. It consists of two parts:
CREDENTIAL_LIST property to the RecyclerView inside the bottom sheet.