The popup classes in this directory are used to display the following types of data on Desktop platforms:
Additionally, PopupBaseView is also re-used for the popup in which password generation prompts are rendered.
The main classes for the popup have the following hierarchy:
┌───────────────────────┐ │ PopupBaseView │ └──▲────────────────────┘ │ extends ┌──┴────────────────────┐ │ PopupViewViews │ └──┬────────────────────┘ │creates (via CreatePopupRowView()) and owns N ┌──▼────────────────────┐ │ PopupRowView │ └──┬────────────────────┘ │owns ┌──▼────────────────────┐ │ PopupRowContentView │ └───────────────────────┘ ┌───────────────────────┐ │ PopupRowView │ └──▲────────────────────┘ │ extends ┌──┴─────────────────────┐ │ PopupRowWithButtonView │ └────────────────────────┘
These classes serve the following purposes:
PopupBaseView: Serves as the common base class for both PopupViewViews and PasswordGenerationPopupViewViews.PopupViewViews: Implements the AutofillPopupView interface that the AutofillPopupController interacts with.ScrollView). Rows with selectable cells are represented by PopupRowView, but PopupViewViews can also contain rows that cannot be selected (e.g. a PopupSeparatorView).PopupRowView: Represents a single row in a PopupViewViews.PopupRowContentView in its constructor and takes ownership of it. This content view occupies the majority of the row view area and basically determines its appearance.RenderWidgetHost) to control suggestion selection (form preview) and acceptance (form filling).PopupViewViewsPopupRowWithButtonView: An extension of PopupRowView that supports a single button in the content view layout.CreatePopupRowView(): Row construction method.PopupItemId) it instantiates a row class and its content view.There are currently about ~30 different PopupItemIds, that correspond to a different type of popup row. When a new type is added and it cannot be properly processed by CreatePopupRowView(), use the following steps to support it by the popup UI:
PopupRowContentView (or even for PopupRowView if needed, e.g. CreateAutocompleteRowWithDeleteButton()), e.g. CreatePasswordPopupRowContentView() in popup_row_factory_utils.cc.CreatePopupRowView().popup_row_factory_utils_unittest.cc if some testable logic was affected.popup_row_factory_utils_browsertest.cc. In most cases adding the newly added suggestion type to kSuggestions will suffice.