OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/renderer/render_widget.h" | 5 #include "chrome/renderer/render_widget.h" |
6 | 6 |
7 #include "base/gfx/point.h" | 7 #include "base/gfx/point.h" |
8 #include "base/gfx/size.h" | 8 #include "base/gfx/size.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/common/render_messages.h" |
13 #include "chrome/renderer/render_process.h" | 14 #include "chrome/renderer/render_process.h" |
14 #include "skia/ext/platform_canvas.h" | 15 #include "skia/ext/platform_canvas.h" |
15 | 16 |
16 #if defined(OS_POSIX) | 17 #if defined(OS_POSIX) |
17 #include "skia/include/SkPixelRef.h" | 18 #include "skia/include/SkPixelRef.h" |
18 #include "skia/include/SkMallocPixelRef.h" | 19 #include "skia/include/SkMallocPixelRef.h" |
19 #endif // defined(OS_POSIX) | 20 #endif // defined(OS_POSIX) |
20 | 21 |
21 #include "webkit/glue/webinputevent.h" | 22 #include "webkit/glue/webinputevent.h" |
22 #include "webkit/glue/webwidget.h" | 23 #include "webkit/glue/webwidget.h" |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) { | 721 void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) { |
721 // During shutdown we can just ignore this message. | 722 // During shutdown we can just ignore this message. |
722 if (!webwidget_) | 723 if (!webwidget_) |
723 return; | 724 return; |
724 | 725 |
725 set_next_paint_is_repaint_ack(); | 726 set_next_paint_is_repaint_ack(); |
726 gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height()); | 727 gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height()); |
727 DidInvalidateRect(webwidget_, repaint_rect); | 728 DidInvalidateRect(webwidget_, repaint_rect); |
728 } | 729 } |
729 | 730 |
| 731 bool RenderWidget::next_paint_is_resize_ack() const { |
| 732 return ViewHostMsg_PaintRect_Flags::is_resize_ack(next_paint_flags_); |
| 733 } |
| 734 |
| 735 bool RenderWidget::next_paint_is_restore_ack() const { |
| 736 return ViewHostMsg_PaintRect_Flags::is_restore_ack(next_paint_flags_); |
| 737 } |
| 738 |
| 739 void RenderWidget::set_next_paint_is_resize_ack() { |
| 740 next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_RESIZE_ACK; |
| 741 } |
| 742 |
| 743 void RenderWidget::set_next_paint_is_restore_ack() { |
| 744 next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_RESTORE_ACK; |
| 745 } |
| 746 |
| 747 void RenderWidget::set_next_paint_is_repaint_ack() { |
| 748 next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_REPAINT_ACK; |
| 749 } |
| 750 |
730 void RenderWidget::UpdateIME() { | 751 void RenderWidget::UpdateIME() { |
731 // If a browser process does not have IMEs, its IMEs are not active, or there | 752 // If a browser process does not have IMEs, its IMEs are not active, or there |
732 // are not any attached widgets. | 753 // are not any attached widgets. |
733 // a renderer process does not have to retrieve information of the focused | 754 // a renderer process does not have to retrieve information of the focused |
734 // control or send notification messages to a browser process. | 755 // control or send notification messages to a browser process. |
735 if (!ime_is_active_) { | 756 if (!ime_is_active_) { |
736 return; | 757 return; |
737 } | 758 } |
738 // Retrieve the caret position from the focused widget and verify we should | 759 // Retrieve the caret position from the focused widget and verify we should |
739 // enabled IMEs attached to the browser process. | 760 // enabled IMEs attached to the browser process. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 for (; i < plugin_window_moves_.size(); ++i) { | 826 for (; i < plugin_window_moves_.size(); ++i) { |
806 if (plugin_window_moves_[i].window == move.window) { | 827 if (plugin_window_moves_[i].window == move.window) { |
807 plugin_window_moves_[i] = move; | 828 plugin_window_moves_[i] = move; |
808 break; | 829 break; |
809 } | 830 } |
810 } | 831 } |
811 | 832 |
812 if (i == plugin_window_moves_.size()) | 833 if (i == plugin_window_moves_.size()) |
813 plugin_window_moves_.push_back(move); | 834 plugin_window_moves_.push_back(move); |
814 } | 835 } |
OLD | NEW |