#include "ui/views/controls/menu/menu_runner_impl.h"
#include <memory>
#include <utility>
#include "build/build_config.h"
#include "ui/accessibility/platform/ax_platform_node_base.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/menu_button_controller.h"
#include "ui/views/controls/menu/menu_controller.h"
#include "ui/views/controls/menu/menu_delegate.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/menu_runner_impl_adapter.h"
#include "ui/views/widget/widget.h"
#if BUILDFLAG(IS_WIN)
#include "ui/events/win/system_event_state_lookup.h"
#endif
#if BUILDFLAG(IS_OZONE)
#include "ui/base/ui_base_features.h"
#include "ui/events/event_constants.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/platform_menu_utils.h"
#endif
namespace views {
namespace {
void FireFocusAfterMenuClose(base::WeakPtr<Widget> widget) { … }
#if BUILDFLAG(IS_OZONE)
bool IsAltPressed() { … }
#endif
}
namespace internal {
#if !BUILDFLAG(IS_MAC)
MenuRunnerImplInterface* MenuRunnerImplInterface::Create(
ui::MenuModel* menu_model,
int32_t run_types,
base::RepeatingClosure on_menu_closed_callback) { … }
#endif
MenuRunnerImpl::MenuRunnerImpl(std::unique_ptr<MenuItemView> menu)
: … { … }
bool MenuRunnerImpl::IsRunning() const { … }
void MenuRunnerImpl::Release() { … }
void MenuRunnerImpl::RunMenuAt(
Widget* parent,
MenuButtonController* button_controller,
const gfx::Rect& bounds,
MenuAnchorPosition anchor,
int32_t run_types,
gfx::NativeView native_view_for_gestures,
std::optional<gfx::RoundedCornersF> corners,
std::optional<std::string> show_menu_host_duration_histogram) { … }
void MenuRunnerImpl::Cancel() { … }
base::TimeTicks MenuRunnerImpl::GetClosingEventTime() const { … }
void MenuRunnerImpl::OnMenuClosed(NotifyType type,
MenuItemView* menu,
int mouse_event_flags) { … }
void MenuRunnerImpl::SiblingMenuCreated(MenuItemView* menu) { … }
MenuRunnerImpl::~MenuRunnerImpl() { … }
bool MenuRunnerImpl::ShouldShowMnemonics(int32_t run_types) { … }
}
}