| Index: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
|
| index 72407678984f0e95927ca4bbe1128cb97c1ac7df..365a0154f9aaaeb8ff770407c2cf0a1f1f0a8b89 100644
|
| --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2013 The Chromium Authors. All rights rerved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -60,6 +60,15 @@ void SetFullScreenCollectionBehavior(NSWindow* window, bool allow_fullscreen) {
|
| [window setCollectionBehavior:behavior];
|
| }
|
|
|
| +void SetWorkspacesCollectionBehavior(NSWindow* window, bool always_visible) {
|
| + NSWindowCollectionBehavior behavior = [window collectionBehavior];
|
| + if (always_visible)
|
| + behavior |= NSWindowCollectionBehaviorCanJoinAllSpaces;
|
| + else
|
| + behavior &= ~NSWindowCollectionBehaviorCanJoinAllSpaces;
|
| + [window setCollectionBehavior:behavior];
|
| +}
|
| +
|
| void InitCollectionBehavior(NSWindow* window) {
|
| // Since always-on-top windows have a higher window level
|
| // than NSNormalWindowLevel, they will default to
|
| @@ -380,6 +389,8 @@ NativeAppWindowCocoa::NativeAppWindowCocoa(
|
| [window setLevel:AlwaysOnTopWindowLevel()];
|
| InitCollectionBehavior(window);
|
|
|
| + SetWorkspacesCollectionBehavior(window, params.visible_on_all_workspaces);
|
| +
|
| window_controller_.reset(
|
| [[NativeAppWindowController alloc] initWithWindow:window.release()]);
|
|
|
| @@ -974,6 +985,10 @@ void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) {
|
| NSNormalWindowLevel)];
|
| }
|
|
|
| +void NativeAppWindowCocoa::SetVisibleOnAllWorkspaces(bool always_visible) {
|
| + SetWorkspacesCollectionBehavior(window(), always_visible);
|
| +}
|
| +
|
| NativeAppWindowCocoa::~NativeAppWindowCocoa() {
|
| }
|
|
|
|
|