Skip to content

Commit

Permalink
Revert "Prevent sending client area for custom-frame widgets"
Browse files Browse the repository at this point in the history
This reverts commit 9f396dd.

Reason for revert: crbug.com/939663

Original change's description:
> Prevent sending client area for custom-frame widgets
> 
> When custom frame is used for a widget, the "client area" shouldn't
> be sent based on the client-area, otherwise the located event on the
> frame will be handled incorrectly.
> 
> With this CL, DesktopWindowTreeHostMus checks remove_standard_frame
> of Widget::InitParams and adopts that behavior, thus dialogs of
> using custom frame and bubbles will not send client area anymore.
> 
> This property is already used in BrowserFrameMash, so
> set_auto_update_client_area method is now gone.
> 
> Bug: 935338
> Test: manually
> Change-Id: I285954a53fea3f9f32d2fc24847cd869e5d5f939
> Reviewed-on: https://chromium-review.googlesource.com/c/1488179
> Auto-Submit: Jun Mukai <[email protected]>
> Reviewed-by: Scott Violet <[email protected]>
> Reviewed-by: Evan Stade <[email protected]>
> Commit-Queue: Jun Mukai <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#636248}

[email protected],[email protected],[email protected]

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 935338
Change-Id: I58f0c9ac298485ff8603e52af3a15f3b51f75452
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1510757
Reviewed-by: Wenzhao (Colin) Zang <[email protected]>
Commit-Queue: Wenzhao (Colin) Zang <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#638916}(cherry picked from commit 9f2aff2392146f578449a2413c91512d838bc12d)
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1519123
Reviewed-by: Jun Mukai <[email protected]>
Cr-Commit-Position: refs/branch-heads/3729@{#65}
Cr-Branched-From: d4a8972-refs/heads/master@{#638880}
  • Loading branch information
Wenzhao (Colin) Zang authored and jmuk committed Mar 12, 2019
1 parent c6ae198 commit cd9c25b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions chrome/browser/ui/views/frame/browser_frame_mash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ views::Widget::InitParams BrowserFrameMash::GetWidgetParams() {
std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host =
std::make_unique<views::DesktopWindowTreeHostMus>(
std::move(window_tree_host_init_params), browser_frame_, this);
// BrowserNonClientFrameViewAsh::OnBoundsChanged() takes care of updating
// the insets.
desktop_window_tree_host->set_auto_update_client_area(false);
SetDesktopWindowTreeHost(std::move(desktop_window_tree_host));
return params;
}
Expand Down
1 change: 0 additions & 1 deletion ui/views/bubble/bubble_dialog_delegate_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ Widget* CreateBubbleWidget(BubbleDialogDelegateView* bubble) {
? Widget::InitParams::TRANSLUCENT_WINDOW
: Widget::InitParams::OPAQUE_WINDOW;
bubble_params.accept_events = bubble->accept_events();
bubble_params.remove_standard_frame = true;
// Use a window default shadow if the bubble doesn't provides its own.
if (bubble->GetShadow() == BubbleBorder::NO_ASSETS)
bubble_params.shadow_type = Widget::InitParams::SHADOW_TYPE_DEFAULT;
Expand Down
5 changes: 0 additions & 5 deletions ui/views/mus/desktop_window_tree_host_mus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,6 @@ void DesktopWindowTreeHostMus::Init(const Widget::InitParams& params) {
SetBoundsInDIP(params.bounds);
}

// If the standard frame is not used, the frame area (rendered by the client)
// should be handled by the client, so it shouldn't update the client area
// by itself. See https://crbug.com/935338.
auto_update_client_area_ = !params.remove_standard_frame;

cursor_manager_owner_ = std::make_unique<CursorManagerOwner>(window());
InitHost();

Expand Down
5 changes: 5 additions & 0 deletions ui/views/mus/desktop_window_tree_host_mus.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus
// Called when the window was deleted on the server.
void ServerDestroyedWindow() { CloseNow(); }

// Controls whether the client area is automatically updated as necessary.
void set_auto_update_client_area(bool value) {
auto_update_client_area_ = value;
}

private:
class WindowTreeHostWindowObserver;

Expand Down

0 comments on commit cd9c25b

Please sign in to comment.