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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 params.copy_rects.clear(); | 824 params.copy_rects.clear(); |
825 } else { | 825 } else { |
826 params.scroll_rect = update.scroll_rect; | 826 params.scroll_rect = update.scroll_rect; |
827 params.copy_rects.swap(copy_rects); // TODO(darin): clip to bounds? | 827 params.copy_rects.swap(copy_rects); // TODO(darin): clip to bounds? |
828 } | 828 } |
829 params.view_size = size_; | 829 params.view_size = size_; |
830 params.resizer_rect = resizer_rect_; | 830 params.resizer_rect = resizer_rect_; |
831 params.plugin_window_moves.swap(plugin_window_moves_); | 831 params.plugin_window_moves.swap(plugin_window_moves_); |
832 params.flags = next_paint_flags_; | 832 params.flags = next_paint_flags_; |
833 params.scroll_offset = GetScrollOffset(); | 833 params.scroll_offset = GetScrollOffset(); |
| 834 params.contents_size = GetContentsSize(); |
834 | 835 |
835 update_reply_pending_ = true; | 836 update_reply_pending_ = true; |
836 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); | 837 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); |
837 next_paint_flags_ = 0; | 838 next_paint_flags_ = 0; |
838 | 839 |
839 UpdateInputMethod(); | 840 UpdateInputMethod(); |
840 | 841 |
841 // Let derived classes know we've painted. | 842 // Let derived classes know we've painted. |
842 DidInitiatePaint(); | 843 DidInitiatePaint(); |
843 } | 844 } |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 gfx::Rect* clip) { | 1242 gfx::Rect* clip) { |
1242 // Bare RenderWidgets don't support optimized plugin painting. | 1243 // Bare RenderWidgets don't support optimized plugin painting. |
1243 return NULL; | 1244 return NULL; |
1244 } | 1245 } |
1245 | 1246 |
1246 gfx::Point RenderWidget::GetScrollOffset() { | 1247 gfx::Point RenderWidget::GetScrollOffset() { |
1247 // Bare RenderWidgets don't support scroll offset. | 1248 // Bare RenderWidgets don't support scroll offset. |
1248 return gfx::Point(0, 0); | 1249 return gfx::Point(0, 0); |
1249 } | 1250 } |
1250 | 1251 |
| 1252 gfx::Size RenderWidget::GetContentsSize() { |
| 1253 // Bare RenderWidgets don't support contents size. |
| 1254 return gfx::Size(0, 0); |
| 1255 } |
| 1256 |
1251 void RenderWidget::SetHidden(bool hidden) { | 1257 void RenderWidget::SetHidden(bool hidden) { |
1252 if (is_hidden_ == hidden) | 1258 if (is_hidden_ == hidden) |
1253 return; | 1259 return; |
1254 | 1260 |
1255 // The status has changed. Tell the RenderThread about it. | 1261 // The status has changed. Tell the RenderThread about it. |
1256 is_hidden_ = hidden; | 1262 is_hidden_ = hidden; |
1257 if (is_hidden_) | 1263 if (is_hidden_) |
1258 render_thread_->WidgetHidden(); | 1264 render_thread_->WidgetHidden(); |
1259 else | 1265 else |
1260 render_thread_->WidgetRestored(); | 1266 render_thread_->WidgetRestored(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1391 | 1397 |
1392 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1398 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
1393 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1399 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
1394 i != plugin_window_moves_.end(); ++i) { | 1400 i != plugin_window_moves_.end(); ++i) { |
1395 if (i->window == window) { | 1401 if (i->window == window) { |
1396 plugin_window_moves_.erase(i); | 1402 plugin_window_moves_.erase(i); |
1397 break; | 1403 break; |
1398 } | 1404 } |
1399 } | 1405 } |
1400 } | 1406 } |
OLD | NEW |