Add SetVisibleOnAllWorkspaces/IsVisibleOnAllWorkspaces API.
These two APIs are only available on OS X/Linux platforms.
This commit is contained in:
parent
1804466334
commit
476b61322f
8 changed files with 74 additions and 0 deletions
|
@ -310,6 +310,7 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
|
|||
const mate::Dictionary& options)
|
||||
: NativeWindow(web_contents, options),
|
||||
is_kiosk_(false),
|
||||
is_visible_on_all_workspaces_(false),
|
||||
attention_request_id_(0) {
|
||||
int width = 800, height = 600;
|
||||
options.Get(switches::kWidth, &width);
|
||||
|
@ -692,6 +693,21 @@ void NativeWindowMac::ShowDefinitionForSelection() {
|
|||
rwhv->ShowDefinitionForSelection();
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible) {
|
||||
NSUInteger collectionBehavior = [window_ collectionBehavior];
|
||||
is_visible_on_all_workspaces_ = visible;
|
||||
if (visible) {
|
||||
collectionBehavior |= NSWindowCollectionBehaviorCanJoinAllSpaces;
|
||||
} else {
|
||||
collectionBehavior &= ~NSWindowCollectionBehaviorCanJoinAllSpaces;
|
||||
}
|
||||
[window_ setCollectionBehavior:collectionBehavior];
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsVisibleOnAllWorkspaces() {
|
||||
return is_visible_on_all_workspaces_;
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
|
||||
if (!draggable_region_)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue