Remove aura::client::kMenuType
That property was used to position Wayland popups. However, it's no longer in use as Wayland has switched to use a window anchor instead some time ago. Thus, it's safe to remove all the code related to that property. Bug: 578890 Change-Id: I0bed6e3fc5565cdc7240709cf10692f3989a2eeb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5233143 Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: Maksim Sisov <msisov@igalia.com> Cr-Commit-Position: refs/heads/main@{#1252525}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e854c3ca8d
commit
03084e0203
ui
aura
base
ozone
platform
test
platform_window
views
@ -31,7 +31,6 @@ DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(AURA_EXPORT, int64_t)
|
||||
DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(AURA_EXPORT, aura::client::FocusClient*)
|
||||
DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(AURA_EXPORT, aura::Window*)
|
||||
DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(AURA_EXPORT, std::vector<aura::Window*>*)
|
||||
DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(AURA_EXPORT, ui::MenuType)
|
||||
|
||||
namespace aura {
|
||||
namespace client {
|
||||
@ -56,9 +55,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kDrawAttentionKey, false)
|
||||
DEFINE_UI_CLASS_PROPERTY_KEY(FocusClient*, kFocusClientKey, nullptr)
|
||||
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, kHeadlessBoundsKey, nullptr)
|
||||
DEFINE_UI_CLASS_PROPERTY_KEY(Window*, kHostWindowKey, nullptr)
|
||||
DEFINE_UI_CLASS_PROPERTY_KEY(ui::MenuType,
|
||||
kMenuType,
|
||||
ui::MenuType::kRootContextMenu)
|
||||
DEFINE_UI_CLASS_PROPERTY_KEY(Window*, kChildModalParentKey, nullptr)
|
||||
DEFINE_UI_CLASS_PROPERTY_KEY(ui::ModalType, kModalKey, ui::MODAL_TYPE_NONE)
|
||||
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(std::string, kNameKey, nullptr)
|
||||
|
@ -102,10 +102,6 @@ AURA_EXPORT extern const WindowProperty<gfx::Rect*>* const kHeadlessBoundsKey;
|
||||
// WebContentsViews find the windows that should constrain NPAPI plugins.
|
||||
AURA_EXPORT extern const WindowProperty<Window*>* const kHostWindowKey;
|
||||
|
||||
// A property key to store menu type of the window. Valid only for the menu
|
||||
// windows.
|
||||
AURA_EXPORT extern const WindowProperty<ui::MenuType>* const kMenuType;
|
||||
|
||||
// The modal parent of a child modal window.
|
||||
AURA_EXPORT extern const WindowProperty<Window*>* const kChildModalParentKey;
|
||||
|
||||
|
@ -140,19 +140,6 @@ enum MenuSourceType {
|
||||
MENU_SOURCE_TYPE_LAST = MENU_SOURCE_ADJUST_SELECTION_RESET
|
||||
};
|
||||
|
||||
// Menu types that are used to position menu windows correctly.
|
||||
enum class MenuType {
|
||||
// A context menu opened either via a right click or a long tap.
|
||||
kRootContextMenu = 0,
|
||||
|
||||
// A root non-context menu. Example: The three dot menu.
|
||||
kRootMenu,
|
||||
|
||||
// A child menu opened by clicking on a nested menu entry of either
|
||||
// |kRootContextMenu| or |kRootParentMenu|.
|
||||
kChildMenu,
|
||||
};
|
||||
|
||||
// Where an owned anchored window should be anchored to. Used by such backends
|
||||
// as Wayland, which doesn't provide clients with on screen coordinates, but
|
||||
// rather forces them to position children windows relative to toplevel windows.
|
||||
|
@ -27,8 +27,6 @@ struct ShellPopupParams {
|
||||
~ShellPopupParams();
|
||||
|
||||
gfx::Rect bounds;
|
||||
MenuType menu_type = MenuType::kRootContextMenu;
|
||||
|
||||
// This parameter is temporarily optional. Later, when all the clients
|
||||
// start to pass these parameters, absl::optional type will be removed.
|
||||
absl::optional<OwnedWindowAnchor> anchor;
|
||||
|
@ -65,8 +65,6 @@ bool WaylandPopup::CreateShellPopup() {
|
||||
|
||||
ShellPopupParams params;
|
||||
params.bounds = bounds_dip;
|
||||
params.menu_type =
|
||||
delegate()->GetMenuType().value_or(MenuType::kRootContextMenu);
|
||||
params.anchor = delegate()->GetOwnedWindowAnchorAndRectInDIP();
|
||||
if (params.anchor.has_value()) {
|
||||
// The anchor should originate from the window geometry, not from the
|
||||
|
@ -2066,8 +2066,6 @@ TEST_P(WaylandWindowTest, OnAcceleratedWidgetDestroy) {
|
||||
|
||||
TEST_P(WaylandWindowTest, CanCreateMenuWindow) {
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kRootContextMenu));
|
||||
|
||||
// SetPointerFocus(true) requires a WaylandPointer.
|
||||
PostToServerAndWait([](wl::TestWaylandServerThread* server) {
|
||||
@ -2104,8 +2102,6 @@ TEST_P(WaylandWindowTest, CreateAndDestroyNestedMenuWindow) {
|
||||
gfx::AcceleratedWidget menu_window_widget;
|
||||
EXPECT_CALL(menu_window_delegate, OnAcceleratedWidgetAvailable(_))
|
||||
.WillOnce(SaveArg<0>(&menu_window_widget));
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kRootContextMenu));
|
||||
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(10, 10), &menu_window_delegate,
|
||||
@ -2123,8 +2119,6 @@ TEST_P(WaylandWindowTest, CreateAndDestroyNestedMenuWindow) {
|
||||
|
||||
TEST_P(WaylandWindowTest, DispatchesLocatedEventsToCapturedWindow) {
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(10, 10, 10, 10),
|
||||
&menu_window_delegate, widget_);
|
||||
@ -2199,8 +2193,6 @@ TEST_P(WaylandWindowTest, DispatchesLocatedEventsToCapturedWindow) {
|
||||
// If nested menu window is added, the events are still correctly translated
|
||||
// to the captured window.
|
||||
MockWaylandPlatformWindowDelegate nested_menu_window_delegate;
|
||||
EXPECT_CALL(nested_menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
std::unique_ptr<WaylandWindow> nested_menu_window =
|
||||
CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(15, 18, 10, 10),
|
||||
@ -2260,8 +2252,6 @@ TEST_P(WaylandWindowTest, ConvertEventToTarget) {
|
||||
// Create a menu.
|
||||
constexpr gfx::Rect kMenuBounds{100, 100, 80, 50};
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, kMenuBounds, &menu_window_delegate, widget_);
|
||||
EXPECT_TRUE(menu_window);
|
||||
@ -2289,8 +2279,6 @@ TEST_P(WaylandWindowTest, ConvertEventToTarget) {
|
||||
TEST_P(WaylandWindowTest,
|
||||
DispatchesLocatedEventsToCapturedWindowInTheSameStack) {
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(30, 40, 20, 50),
|
||||
&menu_window_delegate, widget_);
|
||||
@ -2364,8 +2352,6 @@ TEST_P(WaylandWindowTest,
|
||||
|
||||
TEST_P(WaylandWindowTest, DispatchesKeyboardEventToToplevelWindow) {
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(10, 10, 10, 10),
|
||||
&menu_window_delegate, widget_);
|
||||
@ -2438,8 +2424,6 @@ TEST_P(WaylandWindowTest, CanDispatchEvent) {
|
||||
gfx::AcceleratedWidget menu_window_widget;
|
||||
EXPECT_CALL(menu_window_delegate, OnAcceleratedWidgetAvailable(_))
|
||||
.WillOnce(SaveArg<0>(&menu_window_widget));
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(10, 10), &menu_window_delegate,
|
||||
@ -2447,8 +2431,6 @@ TEST_P(WaylandWindowTest, CanDispatchEvent) {
|
||||
EXPECT_TRUE(menu_window);
|
||||
|
||||
MockWaylandPlatformWindowDelegate nested_menu_window_delegate;
|
||||
EXPECT_CALL(nested_menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
std::unique_ptr<WaylandWindow> nested_menu_window =
|
||||
CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, gfx::Rect(20, 0, 10, 10),
|
||||
@ -3386,8 +3368,6 @@ TEST_P(WaylandWindowTest, PopupPassesDefaultAnchorInformation) {
|
||||
// be used as anchor rect and anchor position, gravity and constraints should
|
||||
// be normal.
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootMenu));
|
||||
EXPECT_CALL(menu_window_delegate, GetOwnedWindowAnchorAndRectInDIP())
|
||||
.WillOnce(Return(absl::nullopt));
|
||||
gfx::Rect menu_window_bounds(gfx::Point(439, 46),
|
||||
@ -3406,8 +3386,6 @@ TEST_P(WaylandWindowTest, PopupPassesDefaultAnchorInformation) {
|
||||
|
||||
// Case 2: the nested menu window is positioned normally.
|
||||
MockWaylandPlatformWindowDelegate nested_menu_window_delegate;
|
||||
EXPECT_CALL(nested_menu_window_delegate, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kChildMenu));
|
||||
gfx::Rect nested_menu_window_bounds(gfx::Point(724, 47),
|
||||
nested_menu_window_positioner.size);
|
||||
std::unique_ptr<WaylandWindow> nested_menu_window =
|
||||
@ -3439,8 +3417,6 @@ TEST_P(WaylandWindowTest, PopupPassesSetAnchorInformation) {
|
||||
toplevel_window->SetBoundsInDIP(gfx::Rect(508, 212));
|
||||
|
||||
MockWaylandPlatformWindowDelegate menu_window_delegate;
|
||||
EXPECT_CALL(menu_window_delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootMenu));
|
||||
ui::OwnedWindowAnchor anchor = {
|
||||
gfx::Rect(menu_window_positioner.anchor_rect),
|
||||
OwnedWindowAnchorPosition::kBottomRight,
|
||||
@ -3458,8 +3434,6 @@ TEST_P(WaylandWindowTest, PopupPassesSetAnchorInformation) {
|
||||
VerifyXdgPopupPosition(menu_window.get(), menu_window_positioner);
|
||||
|
||||
MockWaylandPlatformWindowDelegate nested_menu_window_delegate;
|
||||
EXPECT_CALL(nested_menu_window_delegate, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kChildMenu));
|
||||
anchor = {{180, 157, 312, 1},
|
||||
OwnedWindowAnchorPosition::kTopRight,
|
||||
OwnedWindowAnchorGravity::kBottomRight,
|
||||
@ -3543,8 +3517,6 @@ TEST_P(WaylandWindowTest, OnCloseRequest) {
|
||||
TEST_P(WaylandWindowTest, WaylandPopupSimpleParent) {
|
||||
VerifyAndClearExpectations();
|
||||
|
||||
EXPECT_CALL(delegate_, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kRootContextMenu));
|
||||
// WaylandPopup must ignore the parent provided by aura and should always
|
||||
// use focused window instead.
|
||||
gfx::Rect wayland_popup_bounds(gfx::Point(15, 15), gfx::Size(10, 10));
|
||||
@ -3747,8 +3719,6 @@ TEST_P(WaylandWindowTest, DestroysCreatesSurfaceOnHideShow) {
|
||||
|
||||
TEST_P(WaylandWindowTest, DestroysCreatesPopupsOnHideShow) {
|
||||
MockWaylandPlatformWindowDelegate delegate;
|
||||
EXPECT_CALL(delegate, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kRootContextMenu));
|
||||
auto window = CreateWaylandWindowWithParams(PlatformWindowType::kMenu,
|
||||
gfx::Rect(50, 50), &delegate,
|
||||
window_->GetWidget());
|
||||
@ -4006,8 +3976,6 @@ TEST_P(WaylandWindowTest, CreatesPopupOnButtonPressSerial) {
|
||||
|
||||
// Create a popup window and verify the client used correct serial.
|
||||
MockWaylandPlatformWindowDelegate delegate;
|
||||
EXPECT_CALL(delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
auto popup = CreateWaylandWindowWithParams(PlatformWindowType::kMenu,
|
||||
gfx::Rect(50, 50), &delegate,
|
||||
window_->GetWidget());
|
||||
@ -4077,8 +4045,6 @@ TEST_P(WaylandWindowTest, CreatesPopupOnTouchDownSerial) {
|
||||
|
||||
// Create a popup window and verify the client used correct serial.
|
||||
MockWaylandPlatformWindowDelegate delegate;
|
||||
EXPECT_CALL(delegate, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kRootContextMenu));
|
||||
auto popup = CreateWaylandWindowWithParams(PlatformWindowType::kMenu,
|
||||
gfx::Rect(50, 50), &delegate,
|
||||
window_->GetWidget());
|
||||
@ -4184,8 +4150,6 @@ TEST_P(WaylandWindowTest, NestedPopupWindowsGetCorrectParent) {
|
||||
TEST_P(WaylandWindowTest, DoesNotGrabPopupIfNoSeat) {
|
||||
// Create a popup window and verify the grab serial is not set.
|
||||
MockWaylandPlatformWindowDelegate delegate;
|
||||
EXPECT_CALL(delegate, GetMenuType())
|
||||
.WillOnce(Return(MenuType::kRootContextMenu));
|
||||
auto popup = CreateWaylandWindowWithParams(PlatformWindowType::kMenu,
|
||||
gfx::Rect(50, 50), &delegate,
|
||||
window_->GetWidget());
|
||||
@ -4214,7 +4178,6 @@ TEST_P(WaylandWindowTest, DoesNotGrabPopupUnlessParentHasGrab) {
|
||||
|
||||
MockWaylandPlatformWindowDelegate delegate;
|
||||
std::unique_ptr<WaylandWindow> root_menu;
|
||||
EXPECT_CALL(delegate, GetMenuType()).WillOnce(Return(MenuType::kRootMenu));
|
||||
root_menu = CreateWaylandWindowWithParams(PlatformWindowType::kMenu,
|
||||
gfx::Rect(50, 50), &delegate,
|
||||
window_->GetWidget());
|
||||
@ -4252,7 +4215,6 @@ TEST_P(WaylandWindowTest, DoesNotGrabPopupUnlessParentHasGrab) {
|
||||
|
||||
MockWaylandPlatformWindowDelegate delegate_2;
|
||||
std::unique_ptr<WaylandWindow> child_menu;
|
||||
EXPECT_CALL(delegate_2, GetMenuType()).WillOnce(Return(MenuType::kChildMenu));
|
||||
child_menu = CreateWaylandWindowWithParams(PlatformWindowType::kMenu,
|
||||
gfx::Rect(10, 10), &delegate_2,
|
||||
root_menu->GetWidget());
|
||||
@ -4665,8 +4627,6 @@ TEST_P(WaylandWindowTest, NoDuplicateViewporterRequests) {
|
||||
TEST_P(WaylandWindowTest, RepositionPopups) {
|
||||
VerifyAndClearExpectations();
|
||||
|
||||
EXPECT_CALL(delegate_, GetMenuType())
|
||||
.WillRepeatedly(Return(MenuType::kRootContextMenu));
|
||||
gfx::Rect menu_window_bounds(gfx::Rect(6, 20, 8, 20));
|
||||
std::unique_ptr<WaylandWindow> menu_window = CreateWaylandWindowWithParams(
|
||||
PlatformWindowType::kMenu, menu_window_bounds, &delegate_,
|
||||
|
@ -49,7 +49,6 @@ class MockPlatformWindowDelegate : public PlatformWindowDelegate {
|
||||
MOCK_METHOD1(OnActivationChanged, void(bool active));
|
||||
MOCK_METHOD0(GetMinimumSizeForWindow, absl::optional<gfx::Size>());
|
||||
MOCK_METHOD0(GetMaximumSizeForWindow, absl::optional<gfx::Size>());
|
||||
MOCK_METHOD0(GetMenuType, absl::optional<MenuType>());
|
||||
MOCK_METHOD0(GetOwnedWindowAnchorAndRectInDIP,
|
||||
absl::optional<OwnedWindowAnchor>());
|
||||
MOCK_METHOD0(OnMouseEnter, void());
|
||||
|
@ -75,10 +75,6 @@ SkPath PlatformWindowDelegate::GetWindowMaskForWindowShapeInPixels() {
|
||||
|
||||
void PlatformWindowDelegate::OnSurfaceFrameLockingChanged(bool lock) {}
|
||||
|
||||
absl::optional<MenuType> PlatformWindowDelegate::GetMenuType() {
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
void PlatformWindowDelegate::OnOcclusionStateChanged(
|
||||
PlatformWindowOcclusionState occlusion_state) {}
|
||||
|
||||
|
@ -217,9 +217,6 @@ class COMPONENT_EXPORT(PLATFORM_WINDOW) PlatformWindowDelegate {
|
||||
// with lacros-chrome.
|
||||
virtual void OnSurfaceFrameLockingChanged(bool lock);
|
||||
|
||||
// Returns a menu type of the window. Valid only for the menu windows.
|
||||
virtual absl::optional<MenuType> GetMenuType();
|
||||
|
||||
// Called when the location of mouse pointer entered the window. This is
|
||||
// different from ui::ET_MOUSE_ENTERED which may not be generated when mouse
|
||||
// is captured either by implicitly or explicitly.
|
||||
|
@ -2239,7 +2239,6 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
// (crbug.com/1414232) The item to be open is a submenu. Make sure
|
||||
// params.context is set.
|
||||
DCHECK(params.context);
|
||||
params.menu_type = ui::MenuType::kChildMenu;
|
||||
} else if (state_.context_menu) {
|
||||
if (!menu_stack_.empty()) {
|
||||
auto* last_menu_item = menu_stack_.back().first.item.get();
|
||||
@ -2250,10 +2249,8 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
} else {
|
||||
params.context = owner_;
|
||||
}
|
||||
params.menu_type = ui::MenuType::kRootContextMenu;
|
||||
} else {
|
||||
params.context = owner_;
|
||||
params.menu_type = ui::MenuType::kRootMenu;
|
||||
}
|
||||
item->GetSubmenu()->ShowAt(params);
|
||||
|
||||
|
@ -2574,12 +2574,15 @@ TEST_F(MenuControllerTest, DragFromViewIntoMenuAndExit) {
|
||||
// Tests that |MenuHost::InitParams| are correctly forwarded to the created
|
||||
// |aura::Window|.
|
||||
TEST_F(MenuControllerTest, AuraWindowIsInitializedWithMenuHostInitParams) {
|
||||
ShowSubmenu(nullptr,
|
||||
[](auto& params) { params.menu_type = ui::MenuType::kRootMenu; });
|
||||
EXPECT_EQ(
|
||||
ui::MenuType::kRootMenu,
|
||||
constexpr gfx::Rect kAnchorRect(1, 5, 2, 5);
|
||||
ShowSubmenu(nullptr, [anchor_rect = kAnchorRect](auto& params) {
|
||||
params.owned_window_anchor.anchor_rect = anchor_rect;
|
||||
});
|
||||
auto* property =
|
||||
menu_item()->GetSubmenu()->GetWidget()->GetNativeWindow()->GetProperty(
|
||||
aura::client::kMenuType));
|
||||
aura::client::kOwnedWindowAnchor);
|
||||
ASSERT_TRUE(property);
|
||||
EXPECT_EQ(kAnchorRect, property->anchor_rect);
|
||||
}
|
||||
|
||||
// Tests that |aura::Window| has the correct properties when a context menu is
|
||||
@ -2593,8 +2596,6 @@ TEST_F(MenuControllerTest, ContextMenuInitializesAuraWindowWhenShown) {
|
||||
|
||||
SubmenuView* const submenu = menu_item()->GetSubmenu();
|
||||
const aura::Window* window = submenu->GetWidget()->GetNativeWindow();
|
||||
EXPECT_EQ(ui::MenuType::kRootContextMenu,
|
||||
window->GetProperty(aura::client::kMenuType));
|
||||
const ui::OwnedWindowAnchor* anchor =
|
||||
window->GetProperty(aura::client::kOwnedWindowAnchor);
|
||||
EXPECT_TRUE(anchor);
|
||||
@ -2622,8 +2623,6 @@ TEST_F(MenuControllerTest, ContextMenuInitializesAuraWindowWhenShown) {
|
||||
|
||||
anchor = window->GetProperty(aura::client::kOwnedWindowAnchor);
|
||||
EXPECT_TRUE(anchor);
|
||||
EXPECT_EQ(ui::MenuType::kChildMenu,
|
||||
window->GetProperty(aura::client::kMenuType));
|
||||
EXPECT_EQ(ui::OwnedWindowAnchorPosition::kTopRight, anchor->anchor_position);
|
||||
EXPECT_EQ(ui::OwnedWindowAnchorGravity::kBottomRight, anchor->anchor_gravity);
|
||||
EXPECT_EQ((ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideY |
|
||||
@ -2650,8 +2649,6 @@ TEST_F(MenuControllerTest, RootAndChildMenusInitializeAuraWindowWhenShown) {
|
||||
const ui::OwnedWindowAnchor* anchor =
|
||||
window->GetProperty(aura::client::kOwnedWindowAnchor);
|
||||
EXPECT_TRUE(anchor);
|
||||
EXPECT_EQ(ui::MenuType::kRootMenu,
|
||||
window->GetProperty(aura::client::kMenuType));
|
||||
EXPECT_EQ(ui::OwnedWindowAnchorPosition::kBottomLeft,
|
||||
anchor->anchor_position);
|
||||
EXPECT_EQ(ui::OwnedWindowAnchorGravity::kBottomRight, anchor->anchor_gravity);
|
||||
@ -2678,8 +2675,6 @@ TEST_F(MenuControllerTest, RootAndChildMenusInitializeAuraWindowWhenShown) {
|
||||
|
||||
anchor = window->GetProperty(aura::client::kOwnedWindowAnchor);
|
||||
EXPECT_TRUE(anchor);
|
||||
EXPECT_EQ(ui::MenuType::kChildMenu,
|
||||
window->GetProperty(aura::client::kMenuType));
|
||||
EXPECT_EQ(ui::OwnedWindowAnchorPosition::kTopRight, anchor->anchor_position);
|
||||
EXPECT_EQ(ui::OwnedWindowAnchorGravity::kBottomRight, anchor->anchor_gravity);
|
||||
EXPECT_EQ((ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideY |
|
||||
|
@ -142,10 +142,6 @@ void MenuHost::InitMenuHost(const InitParams& init_params) {
|
||||
params.bounds = init_params.bounds;
|
||||
|
||||
#if defined(USE_AURA)
|
||||
// TODO(msisov): remove kMenutype once positioning of anchored windows
|
||||
// finally migrates to a new path.
|
||||
params.init_properties_container.SetProperty(aura::client::kMenuType,
|
||||
init_params.menu_type);
|
||||
params.init_properties_container.SetProperty(aura::client::kOwnedWindowAnchor,
|
||||
init_params.owned_window_anchor);
|
||||
#endif
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "base/scoped_observation.h"
|
||||
#include "build/build_config.h"
|
||||
#include "ui/base/owned_window_anchor.h"
|
||||
#include "ui/base/ui_base_types.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/widget/widget_observer.h"
|
||||
@ -47,7 +46,6 @@ class MenuHost : public Widget, public WidgetObserver {
|
||||
raw_ptr<View> contents_view = nullptr;
|
||||
bool do_capture = false;
|
||||
gfx::NativeView native_view_for_gestures;
|
||||
ui::MenuType menu_type = ui::MenuType::kRootContextMenu;
|
||||
// Window that is stacked below a new menu window (can be different from the
|
||||
// |parent|).
|
||||
raw_ptr<Widget> context = nullptr;
|
||||
|
@ -958,10 +958,6 @@ SkPath DesktopWindowTreeHostPlatform::GetWindowMaskForWindowShapeInPixels() {
|
||||
return window_mask;
|
||||
}
|
||||
|
||||
absl::optional<ui::MenuType> DesktopWindowTreeHostPlatform::GetMenuType() {
|
||||
return GetContentWindow()->GetProperty(aura::client::kMenuType);
|
||||
}
|
||||
|
||||
absl::optional<ui::OwnedWindowAnchor>
|
||||
DesktopWindowTreeHostPlatform::GetOwnedWindowAnchorAndRectInDIP() {
|
||||
const auto* anchor =
|
||||
|
@ -160,7 +160,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostPlatform
|
||||
absl::optional<gfx::Size> GetMinimumSizeForWindow() override;
|
||||
absl::optional<gfx::Size> GetMaximumSizeForWindow() override;
|
||||
SkPath GetWindowMaskForWindowShapeInPixels() override;
|
||||
absl::optional<ui::MenuType> GetMenuType() override;
|
||||
absl::optional<ui::OwnedWindowAnchor> GetOwnedWindowAnchorAndRectInDIP()
|
||||
override;
|
||||
gfx::Rect ConvertRectToPixels(const gfx::Rect& rect_in_dip) const override;
|
||||
|
Reference in New Issue
Block a user