views: Linux: Support CefWindowDelegate::CanResize restriction

This commit is contained in:
Marshall Greenblatt
2017-08-25 14:41:30 -07:00
parent 7f6c18af09
commit 64e6971099
4 changed files with 61 additions and 1 deletions

View File

@@ -436,6 +436,30 @@ bool CefWindowView::ShouldDescendIntoChildForEventHandling(
!draggable_region_->contains(location.x(), location.y());
}
bool CefWindowView::MaybeGetMinimumSize(gfx::Size* size) const {
#if defined(OS_LINUX)
// Resize is disabled on Linux by returning the preferred size as the min/max
// size.
if (!CanResize()) {
*size = CalculatePreferredSize();
return true;
}
#endif
return false;
}
bool CefWindowView::MaybeGetMaximumSize(gfx::Size* size) const {
#if defined(OS_LINUX)
// Resize is disabled on Linux by returning the preferred size as the min/max
// size.
if (!CanResize()) {
*size = CalculatePreferredSize();
return true;
}
#endif
return false;
}
void CefWindowView::ViewHierarchyChanged(
const views::View::ViewHierarchyChangedDetails& details) {
if (details.child == this) {