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 #include <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
6 | 6 |
7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 NSMakeRect(-offset.x(), -offset.y(), size.width(), size.height()); | 1633 NSMakeRect(-offset.x(), -offset.y(), size.width(), size.height()); |
1634 NSRect frameRect = [self frame]; | 1634 NSRect frameRect = [self frame]; |
1635 frameRect.origin = NSMakePoint(0, 0); | 1635 frameRect.origin = NSMakePoint(0, 0); |
1636 return NSIntersectionRect(frameRect, contentRect); | 1636 return NSIntersectionRect(frameRect, contentRect); |
1637 } | 1637 } |
1638 | 1638 |
1639 - (void)fillOverScrollAreas:(NSRect)dirtyRect { | 1639 - (void)fillOverScrollAreas:(NSRect)dirtyRect { |
1640 if (![NSColor respondsToSelector:@selector(_linenPatternImage)]) | 1640 if (![NSColor respondsToSelector:@selector(_linenPatternImage)]) |
1641 return; | 1641 return; |
1642 | 1642 |
| 1643 // Don't paint over-scroll areas if |contents_size| is empty, which indicates |
| 1644 // that the render widget is not a RenderView. |
| 1645 if (renderWidgetHostView_->render_widget_host_->contents_size().IsEmpty()) |
| 1646 return; |
| 1647 |
1643 NSRect visibleContentRect = [self computeVisibleContentRect]; | 1648 NSRect visibleContentRect = [self computeVisibleContentRect]; |
1644 NSSize frameSize = [self frame].size; | 1649 NSSize frameSize = [self frame].size; |
1645 bool hasHorizontalOverflow = (NSWidth(visibleContentRect) < frameSize.width); | 1650 bool hasHorizontalOverflow = (NSWidth(visibleContentRect) < frameSize.width); |
1646 bool hasVerticalOverflow = (NSHeight(visibleContentRect) < frameSize.height); | 1651 bool hasVerticalOverflow = (NSHeight(visibleContentRect) < frameSize.height); |
1647 | 1652 |
1648 if (!hasHorizontalOverflow && !hasVerticalOverflow) | 1653 if (!hasHorizontalOverflow && !hasVerticalOverflow) |
1649 return; | 1654 return; |
1650 | 1655 |
1651 NSRect xRect = NSMakeRect(0, | 1656 NSRect xRect = NSMakeRect(0, |
1652 0, | 1657 0, |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 if (!string) return NO; | 2761 if (!string) return NO; |
2757 | 2762 |
2758 // If the user is currently using an IME, confirm the IME input, | 2763 // If the user is currently using an IME, confirm the IME input, |
2759 // and then insert the text from the service, the same as TextEdit and Safari. | 2764 // and then insert the text from the service, the same as TextEdit and Safari. |
2760 [self confirmComposition]; | 2765 [self confirmComposition]; |
2761 [self insertText:string]; | 2766 [self insertText:string]; |
2762 return YES; | 2767 return YES; |
2763 } | 2768 } |
2764 | 2769 |
2765 @end | 2770 @end |
OLD | NEW |