diff options
Diffstat (limited to 'chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm')
-rw-r--r-- | chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm | 17 |
1 files changed, 16 insertions, 1 deletions
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 5023194..fd18e0c 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. @@ -810,7 +819,7 @@ void NativeAppWindowCocoa::FlashFrame(bool flash) { } bool NativeAppWindowCocoa::IsAlwaysOnTop() const { - return false; + return [window() level] == kAlwaysOnTopWindowLevel; } void NativeAppWindowCocoa::RenderViewHostChanged( @@ -986,6 +995,12 @@ void NativeAppWindowCocoa::ShowWithApp() { shell_window_->OnNativeWindowChanged(); } +void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) { + [window() setLevel:(always_on_top ? kAlwaysOnTopWindowLevel : + NSNormalWindowLevel)]; + shell_window_->OnNativeWindowChanged(); +} + void NativeAppWindowCocoa::HideWithoutMarkingHidden() { [window() orderOut:window_controller_]; } |