Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: ui/views/widget/native_widget_mac.mm

Issue 1105613002: [MacViews] Implement AlwaysOnTop and VisibleOnAllWorkspaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/mac/nswindow_frame_controls.mm ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_mac.mm
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
index 10a1c9f7475a336beebc5d09e4fb5849a64a3520..8f0d841a1b4a372c2e629d57b3193685f9a0c5a1 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -12,6 +12,7 @@
#import "ui/base/cocoa/window_size_constants.h"
#include "ui/gfx/font_list.h"
#import "ui/gfx/mac/coordinate_conversion.h"
+#import "ui/gfx/mac/nswindow_frame_controls.h"
#include "ui/native_theme/native_theme.h"
#import "ui/views/cocoa/bridged_content_view.h"
#import "ui/views/cocoa/bridged_native_widget.h"
@@ -83,6 +84,11 @@ void NativeWidgetMac::InitNativeWidget(const Widget::InitParams& params) {
[window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject.
bridge_->Init(window, params);
+ // Only set always-on-top here if it is true since setting it may affect how
+ // the window is treated by Expose.
+ if (params.keep_on_top)
+ SetAlwaysOnTop(true);
+
delegate_->OnNativeWidgetCreated(true);
bridge_->SetFocusManager(GetWidget()->GetFocusManager());
@@ -377,16 +383,15 @@ bool NativeWidgetMac::IsActive() const {
}
void NativeWidgetMac::SetAlwaysOnTop(bool always_on_top) {
- NOTIMPLEMENTED();
+ gfx::SetNSWindowAlwaysOnTop(GetNativeWindow(), always_on_top);
}
bool NativeWidgetMac::IsAlwaysOnTop() const {
- NOTIMPLEMENTED();
- return false;
+ return gfx::IsNSWindowAlwaysOnTop(GetNativeWindow());
}
void NativeWidgetMac::SetVisibleOnAllWorkspaces(bool always_visible) {
- NOTIMPLEMENTED();
+ gfx::SetNSWindowVisibleOnAllWorkspaces(GetNativeWindow(), always_visible);
}
void NativeWidgetMac::Maximize() {
« no previous file with comments | « ui/gfx/mac/nswindow_frame_controls.mm ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698