#include "ui/views/controls/combobox/combobox.h"
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/menu_source_utils.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_types.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/text_utils.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/button_controller.h"
#include "ui/views/controls/combobox/combobox_menu_model.h"
#include "ui/views/controls/combobox/combobox_util.h"
#include "ui/views/controls/combobox/empty_combobox_model.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/focusable_border.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/controls/prefix_selector.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/mouse_constants.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/style/typography.h"
#include "ui/views/style/typography_provider.h"
#include "ui/views/view_utils.h"
#include "ui/views/widget/widget.h"
namespace views {
namespace {
constexpr int kBorderThickness = …;
float GetCornerRadius() { … }
SkColor GetTextColorForEnableState(const Combobox& combobox, bool enabled) { … }
class TransparentButton : public Button { … };
BEGIN_METADATA(…)
}
Combobox::Combobox()
: … { … }
Combobox::Combobox(std::unique_ptr<ui::ComboboxModel> model)
: … { … }
Combobox::Combobox(ui::ComboboxModel* model) { … }
Combobox::~Combobox() { … }
const gfx::FontList& Combobox::GetFontList() const { … }
void Combobox::SetSelectedIndex(std::optional<size_t> index) { … }
base::CallbackListSubscription Combobox::AddSelectedIndexChangedCallback(
views::PropertyChangedCallback callback) { … }
bool Combobox::SelectValue(const std::u16string& value) { … }
void Combobox::SetOwnedModel(std::unique_ptr<ui::ComboboxModel> model) { … }
void Combobox::SetModel(ui::ComboboxModel* model) { … }
std::u16string Combobox::GetTooltipTextAndAccessibleName() const { … }
void Combobox::SetTooltipTextAndAccessibleName(
const std::u16string& tooltip_text) { … }
void Combobox::SetInvalid(bool invalid) { … }
void Combobox::SetBorderColorId(ui::ColorId color_id) { … }
void Combobox::SetBackgroundColorId(ui::ColorId color_id) { … }
void Combobox::SetForegroundColorId(ui::ColorId color_id) { … }
void Combobox::SetForegroundIconColorId(ui::ColorId color_id) { … }
void Combobox::SetForegroundTextStyle(style::TextStyle text_style) { … }
void Combobox::SetEventHighlighting(bool should_highlight) { … }
void Combobox::SetSizeToLargestLabel(bool size_to_largest_label) { … }
bool Combobox::IsMenuRunning() const { … }
void Combobox::OnThemeChanged() { … }
size_t Combobox::GetRowCount() { … }
std::optional<size_t> Combobox::GetSelectedRow() { … }
void Combobox::SetSelectedRow(std::optional<size_t> row) { … }
std::u16string Combobox::GetTextForRow(size_t row) { … }
base::CallbackListSubscription Combobox::AddMenuWillShowCallback(
MenuWillShowCallback callback) { … }
gfx::Size Combobox::CalculatePreferredSize(
const SizeBounds& ) const { … }
void Combobox::OnBoundsChanged(const gfx::Rect& previous_bounds) { … }
bool Combobox::SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) { … }
bool Combobox::OnKeyPressed(const ui::KeyEvent& e) { … }
void Combobox::OnPaint(gfx::Canvas* canvas) { … }
void Combobox::OnFocus() { … }
void Combobox::OnBlur() { … }
bool Combobox::HandleAccessibleAction(const ui::AXActionData& action_data) { … }
void Combobox::OnComboboxModelChanged(ui::ComboboxModel* model) { … }
void Combobox::OnComboboxModelDestroying(ui::ComboboxModel* model) { … }
const base::RepeatingClosure& Combobox::GetCallback() const { … }
const std::unique_ptr<ui::ComboboxModel>& Combobox::GetOwnedModel() const { … }
void Combobox::UpdateBorder() { … }
void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const { … }
void Combobox::PaintIconAndText(gfx::Canvas* canvas) { … }
void Combobox::ArrowButtonPressed(const ui::Event& event) { … }
void Combobox::ShowDropDownMenu(ui::MenuSourceType source_type) { … }
void Combobox::OnMenuClosed(Button::ButtonState original_button_state) { … }
void Combobox::MenuSelectionAt(size_t index) { … }
void Combobox::OnPerformAction() { … }
gfx::Size Combobox::GetContentSize() const { … }
int Combobox::MaybeAdjustWidthForCheckmarks(int original_width) const { … }
void Combobox::OnContentSizeMaybeChanged() { … }
PrefixSelector* Combobox::GetPrefixSelector() { … }
const gfx::FontList& Combobox::GetForegroundFontList() const { … }
void Combobox::UpdateExpandedCollapsedAccessibleState() const { … }
void Combobox::UpdateAccessibleValue() const { … }
void Combobox::UpdateAccessibleDefaultActionVerb() { … }
BEGIN_METADATA(…)
}