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

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

Issue 630363003: More NativeWidget -> Widget notifications: visibility, minimize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20140704-Mac-VIEWS-ActivationChanges
Patch Set: rebase on crrev/654393002 Created 6 years, 2 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/views/views.gyp ('k') | ui/views/widget/native_widget_mac_unittest.mm » ('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 b6aa7176a1163772804329ac8577fa0cf8146f31..e5e6de94b093142b71454b628ed8bb221d5d7e48 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -43,7 +43,7 @@
relativeTo:(NSInteger)otherWindowNumber {
[[self viewsNSWindowDelegate] onWindowOrderWillChange:orderingMode];
[super orderWindow:orderingMode relativeTo:otherWindowNumber];
- [[self viewsNSWindowDelegate] onWindowOrderChanged];
+ [[self viewsNSWindowDelegate] onWindowOrderChanged:nil];
}
@end
@@ -340,7 +340,7 @@ void NativeWidgetMac::Show() {
}
void NativeWidgetMac::Hide() {
- NOTIMPLEMENTED();
+ [GetNativeWindow() orderOut:nil];
}
void NativeWidgetMac::ShowMaximizedWithBounds(
@@ -428,7 +428,13 @@ void NativeWidgetMac::Maximize() {
}
void NativeWidgetMac::Minimize() {
- NOTIMPLEMENTED();
+ NSWindow* window = GetNativeWindow();
+ // Calling performMiniaturize: will momentarily highlight the button, but
+ // AppKit will reject it if there is no miniaturize button.
+ if ([window styleMask] & NSMiniaturizableWindowMask)
+ [window performMiniaturize:nil];
+ else
+ [window miniaturize:nil];
}
bool NativeWidgetMac::IsMaximized() const {
@@ -438,12 +444,11 @@ bool NativeWidgetMac::IsMaximized() const {
}
bool NativeWidgetMac::IsMinimized() const {
- NOTIMPLEMENTED();
- return false;
+ return [GetNativeWindow() isMiniaturized];
}
void NativeWidgetMac::Restore() {
- NOTIMPLEMENTED();
+ [GetNativeWindow() deminiaturize:nil];
}
void NativeWidgetMac::SetFullscreen(bool fullscreen) {
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698