Commit 2bae692f authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

FilesApp extension dialog: prevent resize cursor in tablet mode

In tablet mode, the extensions dialog has a fixed sized, and cannot be
resized. However, non-client hit testing in Ash calls canResize(), and
the current dialog code returns true: that causes Ash to show a resize
cursor on the non-client window edges of the dialog for mouse users.

Prevent that: when the dialog is active in Chrome OS tablet mode, deny
canResize() requests to stop the resize cursor appearing at the dialog
window edges.

Bug: 453634
Change-Id: I551e145c169c9844d3ac090a4e99d9eb826e6e5a
Reviewed-on: https://chromium-review.googlesource.com/c/1280383Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599807}
parent adf1f029
......@@ -25,6 +25,10 @@
#include "ui/views/widget/widget.h"
#include "url/gurl.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/ui/ash/tablet_mode_client.h"
#endif
using content::BrowserContext;
using content::WebContents;
......@@ -153,6 +157,12 @@ int ExtensionDialog::GetDialogButtons() const {
}
bool ExtensionDialog::CanResize() const {
#if defined(OS_CHROMEOS)
// Prevent dialog resize mouse cursor in tablet mode, crbug.com/453634.
const auto* client = TabletModeClient::Get();
if (client && client->tablet_mode_enabled())
return false;
#endif
// Can resize only if minimum contents size set.
return GetExtensionView()->GetPreferredSize() != gfx::Size();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment