views: Make frameless window work.
This commit is contained in:
parent
e7feafb2cc
commit
a5e2ea2899
3 changed files with 11 additions and 3 deletions
|
@ -62,8 +62,7 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
|
||||||
views::Widget::InitParams params;
|
views::Widget::InitParams params;
|
||||||
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
||||||
params.delegate = this;
|
params.delegate = this;
|
||||||
params.type = has_frame_ ? views::Widget::InitParams::TYPE_WINDOW :
|
params.type = views::Widget::InitParams::TYPE_WINDOW;
|
||||||
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
|
|
||||||
params.top_level = true;
|
params.top_level = true;
|
||||||
params.remove_standard_frame = true;
|
params.remove_standard_frame = true;
|
||||||
window_->Init(params);
|
window_->Init(params);
|
||||||
|
|
|
@ -140,6 +140,12 @@ int LinuxFrameView::NonClientHitTest(const gfx::Point& point) {
|
||||||
if (!bounds().Contains(point))
|
if (!bounds().Contains(point))
|
||||||
return HTNOWHERE;
|
return HTNOWHERE;
|
||||||
|
|
||||||
|
// Check for possible draggable region in the client area for the frameless
|
||||||
|
// window.
|
||||||
|
SkRegion* draggable_region = window_->draggable_region();
|
||||||
|
if (draggable_region && draggable_region->contains(point.x(), point.y()))
|
||||||
|
return HTCAPTION;
|
||||||
|
|
||||||
int frame_component = frame_->client_view()->NonClientHitTest(point);
|
int frame_component = frame_->client_view()->NonClientHitTest(point);
|
||||||
|
|
||||||
// See if we're in the sysmenu region. (We check the ClientView first to be
|
// See if we're in the sysmenu region. (We check the ClientView first to be
|
||||||
|
@ -323,6 +329,9 @@ gfx::Rect LinuxFrameView::IconBounds() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LinuxFrameView::ShouldShowTitleBarAndBorder() const {
|
bool LinuxFrameView::ShouldShowTitleBarAndBorder() const {
|
||||||
|
if (!window_->has_frame())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (frame_->IsFullscreen())
|
if (frame_->IsFullscreen())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
|
['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
|
||||||
'sources/': [
|
'sources/': [
|
||||||
['exclude', '_linux(_unittest)?\\.(h|cc)$'],
|
['exclude', '_linux(_unittest)?\\.(h|cc)$'],
|
||||||
['exclude', '(^|/)linux/'],
|
['exclude', '(^|/)linux_[^/]*\\.(h|cc)$'],
|
||||||
['exclude', '(^|/)linux/'],
|
['exclude', '(^|/)linux/'],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
|
Loading…
Reference in a new issue