| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 gfx::Rect* clip) { | 1243 gfx::Rect* clip) { |
| 1243 // Bare RenderWidgets don't support optimized plugin painting. | 1244 // Bare RenderWidgets don't support optimized plugin painting. |
| 1244 return NULL; | 1245 return NULL; |
| 1245 } | 1246 } |
| 1246 | 1247 |
| 1247 gfx::Point RenderWidget::GetScrollOffset() { | 1248 gfx::Point RenderWidget::GetScrollOffset() { |
| 1248 // Bare RenderWidgets don't support scroll offset. | 1249 // Bare RenderWidgets don't support scroll offset. |
| 1249 return gfx::Point(0, 0); | 1250 return gfx::Point(0, 0); |
| 1250 } | 1251 } |
| 1251 | 1252 |
| 1253 gfx::Size RenderWidget::GetContentsSize() { |
| 1254 // Bare RenderWidgets don't support contents size. |
| 1255 return gfx::Size(0, 0); |
| 1256 } |
| 1257 |
| 1252 void RenderWidget::SetHidden(bool hidden) { | 1258 void RenderWidget::SetHidden(bool hidden) { |
| 1253 if (is_hidden_ == hidden) | 1259 if (is_hidden_ == hidden) |
| 1254 return; | 1260 return; |
| 1255 | 1261 |
| 1256 // The status has changed. Tell the RenderThread about it. | 1262 // The status has changed. Tell the RenderThread about it. |
| 1257 is_hidden_ = hidden; | 1263 is_hidden_ = hidden; |
| 1258 if (is_hidden_) | 1264 if (is_hidden_) |
| 1259 render_thread_->WidgetHidden(); | 1265 render_thread_->WidgetHidden(); |
| 1260 else | 1266 else |
| 1261 render_thread_->WidgetRestored(); | 1267 render_thread_->WidgetRestored(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 | 1398 |
| 1393 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1399 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
| 1394 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1400 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
| 1395 i != plugin_window_moves_.end(); ++i) { | 1401 i != plugin_window_moves_.end(); ++i) { |
| 1396 if (i->window == window) { | 1402 if (i->window == window) { |
| 1397 plugin_window_moves_.erase(i); | 1403 plugin_window_moves_.erase(i); |
| 1398 break; | 1404 break; |
| 1399 } | 1405 } |
| 1400 } | 1406 } |
| 1401 } | 1407 } |
| OLD | NEW |