Chromium Code Reviews| 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 - (BOOL)_sharesParentKeyState { | |
|
Robert Sesek
2011/08/05 19:19:43
Should comment what this does and on which OSes it
| |
| 143 return YES; | |
| 144 } | |
| 145 | |
| 142 - (void)close { | 146 - (void)close { |
| 143 // Block the window from receiving events while it fades out. | 147 // Block the window from receiving events while it fades out. |
| 144 closing_ = YES; | 148 closing_ = YES; |
| 145 | 149 |
| 146 if (!delayOnClose_) { | 150 if (!delayOnClose_) { |
| 147 [self finishCloseAfterAnimation]; | 151 [self finishCloseAfterAnimation]; |
| 148 } else { | 152 } else { |
| 149 // Apply animations to hide self. | 153 // Apply animations to hide self. |
| 150 [NSAnimationContext beginGrouping]; | 154 [NSAnimationContext beginGrouping]; |
| 151 [[NSAnimationContext currentContext] | 155 [[NSAnimationContext currentContext] |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 - (void)sendEvent:(NSEvent*)theEvent { | 217 - (void)sendEvent:(NSEvent*)theEvent { |
| 214 if (!closing_) | 218 if (!closing_) |
| 215 [super sendEvent:theEvent]; | 219 [super sendEvent:theEvent]; |
| 216 } | 220 } |
| 217 | 221 |
| 218 - (BOOL)isClosing { | 222 - (BOOL)isClosing { |
| 219 return closing_; | 223 return closing_; |
| 220 } | 224 } |
| 221 | 225 |
| 222 @end | 226 @end |
| OLD | NEW |