| 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" | |
| 14 #include "chrome/renderer/render_process.h" | 13 #include "chrome/renderer/render_process.h" |
| 15 #include "skia/ext/platform_canvas.h" | 14 #include "skia/ext/platform_canvas.h" |
| 16 | 15 |
| 17 #if defined(OS_POSIX) | 16 #if defined(OS_POSIX) |
| 18 #include "skia/include/SkPixelRef.h" | 17 #include "skia/include/SkPixelRef.h" |
| 19 #include "skia/include/SkMallocPixelRef.h" | 18 #include "skia/include/SkMallocPixelRef.h" |
| 20 #endif // defined(OS_POSIX) | 19 #endif // defined(OS_POSIX) |
| 21 | 20 |
| 22 #include "webkit/glue/webinputevent.h" | 21 #include "webkit/glue/webinputevent.h" |
| 23 #include "webkit/glue/webwidget.h" | 22 #include "webkit/glue/webwidget.h" |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) { | 720 void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) { |
| 722 // During shutdown we can just ignore this message. | 721 // During shutdown we can just ignore this message. |
| 723 if (!webwidget_) | 722 if (!webwidget_) |
| 724 return; | 723 return; |
| 725 | 724 |
| 726 set_next_paint_is_repaint_ack(); | 725 set_next_paint_is_repaint_ack(); |
| 727 gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height()); | 726 gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height()); |
| 728 DidInvalidateRect(webwidget_, repaint_rect); | 727 DidInvalidateRect(webwidget_, repaint_rect); |
| 729 } | 728 } |
| 730 | 729 |
| 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 | |
| 751 void RenderWidget::UpdateIME() { | 730 void RenderWidget::UpdateIME() { |
| 752 // If a browser process does not have IMEs, its IMEs are not active, or there | 731 // If a browser process does not have IMEs, its IMEs are not active, or there |
| 753 // are not any attached widgets. | 732 // are not any attached widgets. |
| 754 // a renderer process does not have to retrieve information of the focused | 733 // a renderer process does not have to retrieve information of the focused |
| 755 // control or send notification messages to a browser process. | 734 // control or send notification messages to a browser process. |
| 756 if (!ime_is_active_) { | 735 if (!ime_is_active_) { |
| 757 return; | 736 return; |
| 758 } | 737 } |
| 759 // Retrieve the caret position from the focused widget and verify we should | 738 // Retrieve the caret position from the focused widget and verify we should |
| 760 // enabled IMEs attached to the browser process. | 739 // enabled IMEs attached to the browser process. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 for (; i < plugin_window_moves_.size(); ++i) { | 805 for (; i < plugin_window_moves_.size(); ++i) { |
| 827 if (plugin_window_moves_[i].window == move.window) { | 806 if (plugin_window_moves_[i].window == move.window) { |
| 828 plugin_window_moves_[i] = move; | 807 plugin_window_moves_[i] = move; |
| 829 break; | 808 break; |
| 830 } | 809 } |
| 831 } | 810 } |
| 832 | 811 |
| 833 if (i == plugin_window_moves_.size()) | 812 if (i == plugin_window_moves_.size()) |
| 834 plugin_window_moves_.push_back(move); | 813 plugin_window_moves_.push_back(move); |
| 835 } | 814 } |
| OLD | NEW |