#include "chrome/browser/ui/views/autofill/popup/popup_row_view.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/i18n/rtl.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
#include "chrome/browser/ui/views/autofill/popup/popup_cell_utils.h"
#include "chrome/browser/ui/views/autofill/popup/popup_row_content_view.h"
#include "chrome/browser/ui/views/autofill/popup/popup_row_with_button_view.h"
#include "chrome/browser/ui/views/autofill/popup/popup_view_utils.h"
#include "chrome/browser/ui/views/autofill/popup/popup_view_views.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "components/autofill/core/browser/filling_product.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/browser/ui/suggestion_type.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/strings/grit/components_strings.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/base_type_conversion.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_id.h"
#include "ui/events/event_handler.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/events/types/event_type.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/outsets_f.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/background.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
namespace autofill {
namespace {
class EnterExitHandler : public ui::EventHandler { … };
constexpr int kExpandChildSuggestionsViewWidth = …;
constexpr int kExpandChildSuggestionsIconWidth = …;
constexpr int kExpandChildSuggestionsViewHorizontalPadding = …;
constexpr float kAcceptingGuardVisibleAreaPortion = …;
std::pair<int, int> ComputePositionInSet(
base::WeakPtr<AutofillPopupController> controller,
int suggestion_index) { … }
std::u16string GetSuggestionA11yString(const Suggestion& suggestion,
bool add_call_to_action_if_expandable) { … }
bool CanUpdateOpenSubPopupIconVisibilityOnHover(const Suggestion& suggestion) { … }
}
EnterExitHandler::EnterExitHandler(base::RepeatingClosure enter_callback,
base::RepeatingClosure exit_callback)
: … { … }
EnterExitHandler::~EnterExitHandler() = default;
void EnterExitHandler::OnEvent(ui::Event* event) { … }
int PopupRowView::GetHorizontalMargin() { … }
PopupRowView::PopupRowView(
AccessibilitySelectionDelegate& a11y_selection_delegate,
SelectionDelegate& selection_delegate,
base::WeakPtr<AutofillPopupController> controller,
int line_number,
std::unique_ptr<PopupRowContentView> content_view)
: … { … }
PopupRowView::~PopupRowView() = default;
bool PopupRowView::OnMouseDragged(const ui::MouseEvent& event) { … }
bool PopupRowView::OnMousePressed(const ui::MouseEvent& event) { … }
void PopupRowView::OnMouseExited(const ui::MouseEvent& event) { … }
void PopupRowView::OnMouseReleased(const ui::MouseEvent& event) { … }
void PopupRowView::OnGestureEvent(ui::GestureEvent* event) { … }
void PopupRowView::OnPaint(gfx::Canvas* canvas) { … }
bool PopupRowView::GetNeedsNotificationWhenVisibleBoundsChange() const { … }
void PopupRowView::OnVisibleBoundsChanged() { … }
void PopupRowView::GetAccessibleNodeData(ui::AXNodeData* node_data) { … }
void PopupRowView::OnViewFocused(views::View* view) { … }
void PopupRowView::SetSelectedCell(std::optional<CellType> new_cell) { … }
void PopupRowView::SetChildSuggestionsDisplayed(
bool child_suggestions_displayed) { … }
gfx::RectF PopupRowView::GetControlCellBounds() const { … }
bool PopupRowView::HandleKeyPressEvent(
const input::NativeWebKeyboardEvent& event) { … }
bool PopupRowView::IsSelectable() const { … }
void PopupRowView::UpdateUI() { … }
void PopupRowView::UpdateBackground() { … }
void PopupRowView::UpdateOpenSubPopupIconVisibility() { … }
bool PopupRowView::IsViewVisibleEnough() const { … }
BEGIN_METADATA(…)
}
DEFINE_ENUM_CONVERTERS(…)