OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 5 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
10 #include "content/common/content_notification_types.h" | 10 #include "content/common/content_notification_types.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 // According to | 133 // According to |
134 // http://www.cocoabuilder.com/archive/message/cocoa/2006/6/19/165953, | 134 // http://www.cocoabuilder.com/archive/message/cocoa/2006/6/19/165953, |
135 // NSBorderlessWindowMask windows cannot become key or main. In this | 135 // NSBorderlessWindowMask windows cannot become key or main. In this |
136 // case, this is not a desired behavior. As an example, the bubble could have | 136 // case, this is not a desired behavior. As an example, the bubble could have |
137 // buttons. | 137 // buttons. |
138 - (BOOL)canBecomeKeyWindow { | 138 - (BOOL)canBecomeKeyWindow { |
139 return YES; | 139 return YES; |
140 } | 140 } |
141 | 141 |
| 142 // Lets the traffic light buttons on the browser window keep their "active" |
| 143 // state while an info bubble is open. Only has an effect on 10.7. |
| 144 - (BOOL)_sharesParentKeyState { |
| 145 return YES; |
| 146 } |
| 147 |
142 - (void)close { | 148 - (void)close { |
143 // Block the window from receiving events while it fades out. | 149 // Block the window from receiving events while it fades out. |
144 closing_ = YES; | 150 closing_ = YES; |
145 | 151 |
146 if (!delayOnClose_) { | 152 if (!delayOnClose_) { |
147 [self finishCloseAfterAnimation]; | 153 [self finishCloseAfterAnimation]; |
148 } else { | 154 } else { |
149 // Apply animations to hide self. | 155 // Apply animations to hide self. |
150 [NSAnimationContext beginGrouping]; | 156 [NSAnimationContext beginGrouping]; |
151 [[NSAnimationContext currentContext] | 157 [[NSAnimationContext currentContext] |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 - (void)sendEvent:(NSEvent*)theEvent { | 219 - (void)sendEvent:(NSEvent*)theEvent { |
214 if (!closing_) | 220 if (!closing_) |
215 [super sendEvent:theEvent]; | 221 [super sendEvent:theEvent]; |
216 } | 222 } |
217 | 223 |
218 - (BOOL)isClosing { | 224 - (BOOL)isClosing { |
219 return closing_; | 225 return closing_; |
220 } | 226 } |
221 | 227 |
222 @end | 228 @end |
OLD | NEW |