#include "ui/views/touchui/touch_selection_menu_views.h"
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/pointer/touch_editing_controller.h"
#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/text_utils.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/touch_selection/touch_selection_menu_runner.h"
#include "ui/touch_selection/touch_selection_metrics.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
namespace views {
namespace {
struct MenuCommand { … };
MenuCommand kMenuCommands[] = …;
MenuCommand kMenuSelectCommands[] = …;
constexpr gfx::Insets kMenuMargins = …;
constexpr gfx::Size kMenuButtonMinSize = …;
constexpr gfx::Insets kEmptyMenuMargins = …;
constexpr int kMenuCornerRadius = …;
constexpr int kMenuAnchorRectPadding = …;
constexpr int kButtonHorizontalPadding = …;
constexpr int kButtonMinHeight = …;
}
TouchSelectionMenuViews::TouchSelectionMenuViews(
TouchSelectionMenuRunnerViews* owner,
base::WeakPtr<ui::TouchSelectionMenuClient> client,
aura::Window* context)
: … { … }
void TouchSelectionMenuViews::ShowMenu(const gfx::Rect& anchor_rect,
const gfx::Size& handle_image_size) { … }
bool TouchSelectionMenuViews::IsMenuAvailable(
const ui::TouchSelectionMenuClient* client) { … }
void TouchSelectionMenuViews::CloseMenu() { … }
TouchSelectionMenuViews::~TouchSelectionMenuViews() = default;
void TouchSelectionMenuViews::CreateButtons() { … }
LabelButton* TouchSelectionMenuViews::CreateButton(
const std::u16string& title,
Button::PressedCallback callback) { … }
void TouchSelectionMenuViews::CreateSeparator() { … }
void TouchSelectionMenuViews::DisconnectOwner() { … }
void TouchSelectionMenuViews::WindowClosing() { … }
void TouchSelectionMenuViews::ButtonPressed(int command,
const ui::Event& event) { … }
void TouchSelectionMenuViews::EllipsisPressed(const ui::Event& event) { … }
BEGIN_METADATA(…)
}