Update to Chromium version 122.0.6261.69

This commit is contained in:
Marshall Greenblatt
2024-02-22 17:24:43 -05:00
parent dd187af001
commit 40272b5bc5
6 changed files with 44 additions and 36 deletions

View File

@@ -12,7 +12,7 @@ index b169371e4d42f..509e4bda85b47 100644
// on the screen, we can't actually attach to it.
parent_window = nullptr;
diff --git components/constrained_window/constrained_window_views.cc components/constrained_window/constrained_window_views.cc
index 3daf40d463e32..2d84ad7a43c96 100644
index 7eda0c852bb51..744452bf6c00c 100644
--- components/constrained_window/constrained_window_views.cc
+++ components/constrained_window/constrained_window_views.cc
@@ -105,15 +105,24 @@ void UpdateModalDialogPosition(views::Widget* widget,
@@ -41,37 +41,45 @@ index 3daf40d463e32..2d84ad7a43c96 100644
return;
}
@@ -123,36 +132,22 @@ void UpdateModalDialogPosition(views::Widget* widget,
@@ -123,44 +132,22 @@ void UpdateModalDialogPosition(views::Widget* widget,
position.set_y(position.y() -
widget->non_client_view()->frame_view()->GetInsets().top());
- gfx::Rect dialog_bounds(position, size);
-
if (widget->is_top_level() && SupportsGlobalScreenCoordinates()) {
- const gfx::Rect initial_dialog_bounds =
- gfx::Rect dialog_screen_bounds =
- dialog_bounds +
- host_widget->GetClientAreaBoundsInScreen().OffsetFromOrigin();
- const gfx::Rect initial_host_bounds =
- host_widget->GetWindowBoundsInScreen();
- const gfx::Rect host_screen_bounds = host_widget->GetWindowBoundsInScreen();
-
- // TODO(crbug.com/1341530): The requested dialog bounds should never fall
- // outside the bounds of the transient parent.
- DCHECK(initial_dialog_bounds.Intersects(initial_host_bounds));
- DCHECK(dialog_screen_bounds.Intersects(host_screen_bounds));
-
- // We should not show a window-modal dialog for a window that exists outside
- // the bounds of the screen. This risks the modal window becoming
- // effectively deadlocked as controls to dismiss the dialog may become
- // inaccessible.
- // It is also insufficient to reposition only the dialog but not the host
- // window as many systems will clip child dialogs to their transient
- // parents. Further, if the window-constrained dialog is visually
- // disassociated with its parent window it may be difficult to discern which
- // window the dialog is modal to.
- host_widget->SetBoundsConstrained(initial_host_bounds);
- const gfx::Rect adjusted_host_bounds =
- host_widget->GetClientAreaBoundsInScreen();
- dialog_bounds += adjusted_host_bounds.OffsetFromOrigin();
- dialog_bounds.AdjustToFit(adjusted_host_bounds);
- // Adjust the dialog bound to ensure it remains visible on the display.
- const gfx::Rect display_work_area =
- display::Screen::GetScreen()
- ->GetDisplayNearestView(dialog_host->GetHostView())
- .work_area();
- if (!display_work_area.Contains(dialog_screen_bounds)) {
- dialog_screen_bounds.AdjustToFit(display_work_area);
- }
-
- // For platforms that clip transient children to the viewport we must
- // maximize its bounds on the display whilst keeping it within the host
- // bounds to avoid viewport clipping.
- // In the case that the host window bounds do not have sufficient overlap
- // with the display, and the dialog cannot be shown in its entirety, this is
- // a recoverable state as users are still able to reposition the host window
- // back onto the display.
- if (PlatformClipsChildrenToViewport() &&
- !host_screen_bounds.Contains(dialog_screen_bounds)) {
- dialog_screen_bounds.AdjustToFit(host_screen_bounds);
- }
-
- // Readjust the position of the dialog.
- dialog_bounds.set_origin(dialog_screen_bounds.origin());
+ position += host_widget->GetClientAreaBoundsInScreen().OffsetFromOrigin();
+ // If the dialog extends partially off any display, clamp its position to
+ // be fully visible within that display. If the dialog doesn't intersect
@@ -91,7 +99,7 @@ index 3daf40d463e32..2d84ad7a43c96 100644
}
} // namespace
@@ -234,7 +229,8 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
@@ -242,7 +229,8 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
views::Widget* widget = views::DialogDelegate::CreateDialogWidget(
dialog, nullptr,
@@ -101,7 +109,7 @@ index 3daf40d463e32..2d84ad7a43c96 100644
widget->SetNativeWindowProperty(
views::kWidgetIdentifierKey,
const_cast<void*>(kConstrainedWindowWidgetIdentifier));
@@ -256,8 +252,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -264,8 +252,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeView parent_view =
parent ? CurrentClient()->GetDialogHostView(parent) : nullptr;
@@ -116,7 +124,7 @@ index 3daf40d463e32..2d84ad7a43c96 100644
widget->SetNativeWindowProperty(
views::kWidgetIdentifierKey,
const_cast<void*>(kConstrainedWindowWidgetIdentifier));
@@ -273,8 +274,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -281,8 +274,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
if (!requires_positioning)
return widget;