| 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 e5181a84e0cffab5171f59fdce8eb28275beccce..523db1984df5f3bbedc7ee97c64b1118d54a63ab 100644
|
| --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
|
| @@ -265,6 +265,12 @@ void SetFullScreenCollectionBehavior(NSWindow* window, bool allow_fullscreen) {
|
| - (void)setMouseDownCanMoveWindow:(BOOL)can_move;
|
| @end
|
|
|
| +namespace {
|
| +
|
| +const NSInteger kAlwaysOnTopWindowLevel = NSFloatingWindowLevel;
|
| +
|
| +} // namespace
|
| +
|
| NativeAppWindowCocoa::NativeAppWindowCocoa(
|
| ShellWindow* shell_window,
|
| const ShellWindow::CreateParams& params)
|
| @@ -334,6 +340,9 @@ NativeAppWindowCocoa::NativeAppWindowCocoa(
|
| [window respondsToSelector:@selector(setBottomCornerRounded:)])
|
| [window setBottomCornerRounded:NO];
|
|
|
| + if (params.always_on_top)
|
| + [window setLevel:kAlwaysOnTopWindowLevel];
|
| +
|
| // Set the window to participate in Lion Fullscreen mode. Setting this flag
|
| // has no effect on Snow Leopard or earlier. UI controls for fullscreen are
|
| // only shown for apps that have unbounded size.
|
| @@ -807,7 +816,7 @@ void NativeAppWindowCocoa::FlashFrame(bool flash) {
|
| }
|
|
|
| bool NativeAppWindowCocoa::IsAlwaysOnTop() const {
|
| - return false;
|
| + return [window() level] == kAlwaysOnTopWindowLevel;
|
| }
|
|
|
| void NativeAppWindowCocoa::RenderViewHostChanged(
|
| @@ -977,6 +986,12 @@ void NativeAppWindowCocoa::ShowWithApp() {
|
| ShowInactive();
|
| }
|
|
|
| +void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) {
|
| + [window() setLevel:(always_on_top ? kAlwaysOnTopWindowLevel :
|
| + NSNormalWindowLevel)];
|
| + shell_window_->OnNativeWindowChanged();
|
| +}
|
| +
|
| void NativeAppWindowCocoa::HideWithoutMarkingHidden() {
|
| [window() orderOut:window_controller_];
|
| }
|
|
|