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

Unified Diff: ui/views/cocoa/native_widget_mac_nswindow.mm

Issue 1614663002: MacViews: Bubbles and dialogs behave more like sheets wrt main status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK -> EXPECT Created 4 years, 11 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/cocoa/bridged_native_widget.mm ('k') | ui/views/widget/native_widget_mac_interactive_uitest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/native_widget_mac_nswindow.mm
diff --git a/ui/views/cocoa/native_widget_mac_nswindow.mm b/ui/views/cocoa/native_widget_mac_nswindow.mm
index 678e4d58440a13fb33614e264dc17c22c36afed9..4acbd946877d34fb72ef43e079333fb492bb95d6 100644
--- a/ui/views/cocoa/native_widget_mac_nswindow.mm
+++ b/ui/views/cocoa/native_widget_mac_nswindow.mm
@@ -5,6 +5,7 @@
#import "ui/views/cocoa/native_widget_mac_nswindow.h"
#include "base/mac/foundation_util.h"
+#import "ui/views/cocoa/bridged_native_widget.h"
#import "ui/base/cocoa/user_interface_item_command_handler.h"
#import "ui/views/cocoa/views_nswindow_delegate.h"
#include "ui/views/controls/menu/menu_controller.h"
@@ -83,9 +84,17 @@
if (![self delegate])
return NO;
- // Dialogs shouldn't take large shadows away from their parent window.
+ // Dialogs and bubbles shouldn't take large shadows away from their parent.
views::Widget* widget = [self viewsWidget];
- return widget->CanActivate() && !widget->IsDialogBox();
+ return widget->CanActivate() &&
+ !views::NativeWidgetMac::GetBridgeForNativeWindow(self)->parent();
+}
+
+// Lets the traffic light buttons on the parent window keep their active state.
+- (BOOL)_sharesParentKeyState {
+ // Follow -canBecomeMainWindow unless the window provides its own buttons.
+ return ([self styleMask] & NSClosableWindowMask) == 0 &&
+ ![self canBecomeMainWindow];
}
// Override sendEvent to allow key events to be forwarded to a toolkit-views
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/widget/native_widget_mac_interactive_uitest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698