OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1721 NSView* view = [contentView hitTest:[theEvent locationInWindow]]; | 1721 NSView* view = [contentView hitTest:[theEvent locationInWindow]]; |
1722 // Traverse the superview hierarchy as the hitTest will return the frontmost | 1722 // Traverse the superview hierarchy as the hitTest will return the frontmost |
1723 // view, such as an NSTextView, while nonWebContentView may be specified by | 1723 // view, such as an NSTextView, while nonWebContentView may be specified by |
1724 // its parent view. | 1724 // its parent view. |
1725 while (view) { | 1725 while (view) { |
1726 if ([view respondsToSelector:nonWebContentViewSelector] && | 1726 if ([view respondsToSelector:nonWebContentViewSelector] && |
1727 [view performSelector:nonWebContentViewSelector]) { | 1727 [view performSelector:nonWebContentViewSelector]) { |
1728 // The cursor is over a nonWebContentView - ignore this mouse event. | 1728 // The cursor is over a nonWebContentView - ignore this mouse event. |
1729 return YES; | 1729 return YES; |
1730 } | 1730 } |
1731 if ([view isKindOfClass:[self class]] && ![view isEqual:self]) { | |
Alexei Svitkine (slow)
2013/05/22 03:34:43
Is there a reason to use -isEqual: here rather tha
sail
2013/05/22 17:54:10
This a normal Objective-C convention. For example,
| |
1732 // The cursor is over an overlapping render widget. | |
Alexei Svitkine (slow)
2013/05/22 03:34:43
Please expand the comment to mention that given bo
sail
2013/05/22 17:54:10
Done.
| |
1733 return YES; | |
1734 } | |
1731 view = [view superview]; | 1735 view = [view superview]; |
1732 } | 1736 } |
1733 return NO; | 1737 return NO; |
1734 } | 1738 } |
1735 | 1739 |
1736 - (void)mouseEvent:(NSEvent*)theEvent { | 1740 - (void)mouseEvent:(NSEvent*)theEvent { |
1737 TRACE_EVENT0("browser", "RenderWidgetHostViewCocoa::mouseEvent"); | 1741 TRACE_EVENT0("browser", "RenderWidgetHostViewCocoa::mouseEvent"); |
1738 if (delegate_ && [delegate_ respondsToSelector:@selector(handleEvent:)]) { | 1742 if (delegate_ && [delegate_ respondsToSelector:@selector(handleEvent:)]) { |
1739 BOOL handled = [delegate_ handleEvent:theEvent]; | 1743 BOOL handled = [delegate_ handleEvent:theEvent]; |
1740 if (handled) | 1744 if (handled) |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3390 if (!string) return NO; | 3394 if (!string) return NO; |
3391 | 3395 |
3392 // If the user is currently using an IME, confirm the IME input, | 3396 // If the user is currently using an IME, confirm the IME input, |
3393 // and then insert the text from the service, the same as TextEdit and Safari. | 3397 // and then insert the text from the service, the same as TextEdit and Safari. |
3394 [self confirmComposition]; | 3398 [self confirmComposition]; |
3395 [self insertText:string]; | 3399 [self insertText:string]; |
3396 return YES; | 3400 return YES; |
3397 } | 3401 } |
3398 | 3402 |
3399 @end | 3403 @end |
OLD | NEW |