summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-06 01:16:11 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-06 01:16:11 +0000
commit70c082045ecfc833ea29774dd7f7749c6fffabb0 (patch)
treeb89e504b97c928ce450b97b01d6eafd77e03d676
parentb373edf00dc229c40db9897f9d5d4d6ac6463445 (diff)
downloadchromium_src-70c082045ecfc833ea29774dd7f7749c6fffabb0.zip
chromium_src-70c082045ecfc833ea29774dd7f7749c6fffabb0.tar.gz
chromium_src-70c082045ecfc833ea29774dd7f7749c6fffabb0.tar.bz2
mac: Window buttons should keep "active" view when bubbles / tabpose are open on 10.7
This matches the behavior of NSPopover. This is done by overriding the SPI _sharesParentKeyState, which works on 10.7 but not on 10.6. If we want to get this right on 10.6, we could use the SPI described in http://code.google.com/p/chromium/issues/detail?id=44087#c42 , but since we didn't feel we need this until now, we can probably live with this being 10.7-only. I do need this functionality for the history-swipe-overlay. BUG=none TEST=Click e.g. bookmark star. Bookmark bubble should appear, browser window close button should still look active. Review URL: http://codereview.chromium.org/7585013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95708 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/info_bubble_window.mm6
-rw-r--r--chrome/browser/ui/cocoa/tabpose_window.mm6
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/info_bubble_window.mm b/chrome/browser/ui/cocoa/info_bubble_window.mm
index 40f173c..6e0e03a 100644
--- a/chrome/browser/ui/cocoa/info_bubble_window.mm
+++ b/chrome/browser/ui/cocoa/info_bubble_window.mm
@@ -139,6 +139,12 @@ class AppNotificationBridge : public NotificationObserver {
return YES;
}
+// Lets the traffic light buttons on the browser window keep their "active"
+// state while an info bubble is open. Only has an effect on 10.7.
+- (BOOL)_sharesParentKeyState {
+ return YES;
+}
+
- (void)close {
// Block the window from receiving events while it fades out.
closing_ = YES;
diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm
index 90672be..928c6e9 100644
--- a/chrome/browser/ui/cocoa/tabpose_window.mm
+++ b/chrome/browser/ui/cocoa/tabpose_window.mm
@@ -1196,6 +1196,12 @@ void AnimateCALayerOpacityFromTo(
return YES;
}
+// Lets the traffic light buttons on the browser window keep their "active"
+// state while an info bubble is open. Only has an effect on 10.7.
+- (BOOL)_sharesParentKeyState {
+ return YES;
+}
+
// Handle key events that should be executed repeatedly while the key is down.
- (void)keyDown:(NSEvent*)event {
if (state_ == tabpose::kFadingOut)