#include "chrome/browser/ui/views/autofill/popup/popup_row_with_button_view.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/i18n/rtl.h"
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
#include "chrome/browser/ui/views/autofill/popup/popup_row_content_view.h"
#include "chrome/browser/ui/views/autofill/popup/popup_row_view.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "components/input/native_web_keyboard_event.h"
#include "components/strings/grit/components_strings.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/controls/button/button_controller.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace autofill {
namespace {
class ButtonController : public views::ButtonController { … };
class ButtonPlaceholder : public views::View, public views::ViewObserver { … };
ButtonPlaceholder::ButtonPlaceholder(ButtonDelegate* button_delegate)
: … { … }
ButtonPlaceholder::~ButtonPlaceholder() = default;
void ButtonPlaceholder::OnPaint(gfx::Canvas* canvas) { … }
void ButtonPlaceholder::OnViewBoundsChanged(View* observed_view) { … }
BEGIN_METADATA(…)
}
PopupRowWithButtonView::PopupRowWithButtonView(
AccessibilitySelectionDelegate& a11y_selection_delegate,
SelectionDelegate& selection_delegate,
base::WeakPtr<AutofillPopupController> controller,
int line_number,
std::unique_ptr<PopupRowContentView> content_view,
std::unique_ptr<views::ImageButton> button,
ButtonBehavior button_behavior)
: … { … }
PopupRowWithButtonView::~PopupRowWithButtonView() = default;
views::View* PopupRowWithButtonView::GetButtonContainer() { … }
void PopupRowWithButtonView::HandleKeyPressEventFocusOnButton() { … }
void PopupRowWithButtonView::HandleKeyPressEventFocusOnContent() { … }
bool PopupRowWithButtonView::HandleKeyPressEvent(
const input::NativeWebKeyboardEvent& event) { … }
void PopupRowWithButtonView::SetSelectedCell(std::optional<CellType> cell) { … }
void PopupRowWithButtonView::OnMouseEnteredButton() { … }
void PopupRowWithButtonView::OnMouseExitedButton() { … }
void PopupRowWithButtonView::UpdateFocusedPartAndSelectedSuggestion(
std::optional<RowWithButtonPart> part) { … }
bool PopupRowWithButtonView::ShouldButtonBeVisible() const { … }
BEGIN_METADATA(…)
}