| 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 "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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 } | 1663 } |
| 1664 | 1664 |
| 1665 - (void)setFrameSize:(NSSize)newSize { | 1665 - (void)setFrameSize:(NSSize)newSize { |
| 1666 // NB: -[NSView setFrame:] calls through -setFrameSize:, so overriding | 1666 // NB: -[NSView setFrame:] calls through -setFrameSize:, so overriding |
| 1667 // -setFrame: isn't neccessary. | 1667 // -setFrame: isn't neccessary. |
| 1668 [super setFrameSize:newSize]; | 1668 [super setFrameSize:newSize]; |
| 1669 if (renderWidgetHostView_->render_widget_host_) | 1669 if (renderWidgetHostView_->render_widget_host_) |
| 1670 renderWidgetHostView_->render_widget_host_->WasResized(); | 1670 renderWidgetHostView_->render_widget_host_->WasResized(); |
| 1671 } | 1671 } |
| 1672 | 1672 |
| 1673 - (void)setFrameWithDeferredUpdate:(NSRect)frameRect { | |
| 1674 [super setFrame:frameRect]; | |
| 1675 [self performSelector:@selector(renderWidgetHostWasResized) | |
| 1676 withObject:nil | |
| 1677 afterDelay:0]; | |
| 1678 } | |
| 1679 | |
| 1680 - (void)renderWidgetHostWasResized { | |
| 1681 if (renderWidgetHostView_->render_widget_host_) | |
| 1682 renderWidgetHostView_->render_widget_host_->WasResized(); | |
| 1683 } | |
| 1684 | |
| 1685 - (void)callSetNeedsDisplayInRect { | 1673 - (void)callSetNeedsDisplayInRect { |
| 1686 DCHECK([NSThread isMainThread]); | 1674 DCHECK([NSThread isMainThread]); |
| 1687 DCHECK(renderWidgetHostView_->call_set_needs_display_in_rect_pending_); | 1675 DCHECK(renderWidgetHostView_->call_set_needs_display_in_rect_pending_); |
| 1688 [self setNeedsDisplayInRect:renderWidgetHostView_->invalid_rect_]; | 1676 [self setNeedsDisplayInRect:renderWidgetHostView_->invalid_rect_]; |
| 1689 renderWidgetHostView_->call_set_needs_display_in_rect_pending_ = false; | 1677 renderWidgetHostView_->call_set_needs_display_in_rect_pending_ = false; |
| 1690 renderWidgetHostView_->invalid_rect_ = NSZeroRect; | 1678 renderWidgetHostView_->invalid_rect_ = NSZeroRect; |
| 1691 | 1679 |
| 1692 renderWidgetHostView_->HandleDelayedGpuViewHiding(); | 1680 renderWidgetHostView_->HandleDelayedGpuViewHiding(); |
| 1693 } | 1681 } |
| 1694 | 1682 |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2757 if (!string) return NO; | 2745 if (!string) return NO; |
| 2758 | 2746 |
| 2759 // If the user is currently using an IME, confirm the IME input, | 2747 // If the user is currently using an IME, confirm the IME input, |
| 2760 // and then insert the text from the service, the same as TextEdit and Safari. | 2748 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2761 [self confirmComposition]; | 2749 [self confirmComposition]; |
| 2762 [self insertText:string]; | 2750 [self insertText:string]; |
| 2763 return YES; | 2751 return YES; |
| 2764 } | 2752 } |
| 2765 | 2753 |
| 2766 @end | 2754 @end |
| OLD | NEW |