Skip to content

Commit

Permalink
[cr133] DetachAndAttachToNewContext arg list reduced
Browse files Browse the repository at this point in the history
This function has dropped the unnecessary two last arguments that were
being provided. This has to be matched with our override of it.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/d778cfb0a2f3ffec08056bf1db1326201e4ef82c

commit d778cfb0a2f3ffec08056bf1db1326201e4ef82c
Author: Taylor Bergquist <[email protected]>
Date:   Fri Dec 6 23:05:16 2024 +0000

    Clean up TabDragController::Attach

    - Remove unused parameter `point_in_screen`
    - Remove always-true parameter `set_capture`
    - Split the two use cases (starting dragging and attaching to new strip)
    into two methods that share an impl method. They were very different!
    - Promote several DCHECKs to CHECKs. I commented on the CL for each
    explaining why I think it's safe to do w/o using NotFatalUntil.

    Bug: 382754501
  • Loading branch information
cdesouza-chromium committed Dec 9, 2024
1 parent 36ce5c0 commit 31bc91e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 7 additions & 9 deletions browser/ui/views/tabs/tab_drag_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ TabDragController::Liveness TabDragController::GetLocalProcessWindow(

void TabDragController::DetachAndAttachToNewContext(
ReleaseCapture release_capture,
TabDragContext* target_context,
const gfx::Point& point_in_screen,
bool set_capture) {
TabDragContext* target_context) {
auto* browser_widget = GetAttachedBrowserWidget();
auto* browser = BrowserView::GetBrowserViewForNativeWindow(
browser_widget->GetNativeWindow())
Expand All @@ -199,8 +197,8 @@ void TabDragController::DetachAndAttachToNewContext(
}

if (!is_showing_vertical_tabs_) {
TabDragControllerChromium::DetachAndAttachToNewContext(
release_capture, target_context, point_in_screen, set_capture);
TabDragControllerChromium::DetachAndAttachToNewContext(release_capture,
target_context);

if (old_split_view_browser_data) {
auto* new_browser = BrowserView::GetBrowserViewForNativeWindow(
Expand Down Expand Up @@ -236,8 +234,8 @@ void TabDragController::DetachAndAttachToNewContext(
vertical_tab_state_resetter_ = region_view->ExpandTabStripForDragging();
}

TabDragControllerChromium::DetachAndAttachToNewContext(
release_capture, target_context, point_in_screen, set_capture);
TabDragControllerChromium::DetachAndAttachToNewContext(release_capture,
target_context);

auto* region_view = get_region_view();

Expand All @@ -252,8 +250,8 @@ void TabDragController::DetachAndAttachToNewContext(
}

attached_context_->LayoutDraggedViewsAt(
std::move(views), source_view_drag_data()->attached_view, point_in_screen,
initial_move_);
std::move(views), source_view_drag_data()->attached_view,
GetCursorScreenPoint(), initial_move_);

if (old_split_view_browser_data) {
auto* new_browser = BrowserView::GetBrowserViewForNativeWindow(
Expand Down
4 changes: 1 addition & 3 deletions browser/ui/views/tabs/tab_drag_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ class TabDragController : public TabDragControllerChromium {
gfx::NativeWindow* window) override;

void DetachAndAttachToNewContext(ReleaseCapture release_capture,
TabDragContext* target_context,
const gfx::Point& point_in_screen,
bool set_capture = true) override;
TabDragContext* target_context) override;

gfx::Rect CalculateNonMaximizedDraggedBrowserBounds(
views::Widget* widget,
Expand Down

0 comments on commit 31bc91e

Please sign in to comment.