| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
| 10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 caret_rect, WebKit::WebTextDirectionLeftToRight, | 1175 caret_rect, WebKit::WebTextDirectionLeftToRight, |
| 1176 caret_rect, WebKit::WebTextDirectionLeftToRight)); | 1176 caret_rect, WebKit::WebTextDirectionLeftToRight)); |
| 1177 } | 1177 } |
| 1178 #endif | 1178 #endif |
| 1179 | 1179 |
| 1180 void WebPluginDelegateProxy::OnCancelResource(int id) { | 1180 void WebPluginDelegateProxy::OnCancelResource(int id) { |
| 1181 if (plugin_) | 1181 if (plugin_) |
| 1182 plugin_->CancelResource(id); | 1182 plugin_->CancelResource(id); |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect, | 1185 void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) { |
| 1186 bool allow_buffer_flipping) { | |
| 1187 if (!plugin_) | 1186 if (!plugin_) |
| 1188 return; | 1187 return; |
| 1189 | 1188 |
| 1190 // Clip the invalidation rect to the plugin bounds; the plugin may have been | 1189 // Clip the invalidation rect to the plugin bounds; the plugin may have been |
| 1191 // resized since the invalidate message was sent. | 1190 // resized since the invalidate message was sent. |
| 1192 const gfx::Rect clipped_rect(rect.Intersect(gfx::Rect(plugin_rect_.size()))); | 1191 const gfx::Rect clipped_rect(rect.Intersect(gfx::Rect(plugin_rect_.size()))); |
| 1193 | 1192 |
| 1194 invalidate_pending_ = true; | 1193 invalidate_pending_ = true; |
| 1195 // The plugin is blocked on the renderer because the invalidate message it has | 1194 // The plugin is blocked on the renderer because the invalidate message it has |
| 1196 // sent us is synchronous, so we can use buffer flipping here if the caller | 1195 // sent us is synchronous, so we can use buffer flipping here if the caller |
| 1197 // allows it. | 1196 // allows it. |
| 1198 UpdateFrontBuffer(clipped_rect, allow_buffer_flipping); | 1197 UpdateFrontBuffer(clipped_rect, true); |
| 1199 plugin_->InvalidateRect(clipped_rect); | 1198 plugin_->InvalidateRect(clipped_rect); |
| 1200 } | 1199 } |
| 1201 | 1200 |
| 1202 void WebPluginDelegateProxy::OnGetWindowScriptNPObject( | 1201 void WebPluginDelegateProxy::OnGetWindowScriptNPObject( |
| 1203 int route_id, bool* success) { | 1202 int route_id, bool* success) { |
| 1204 *success = false; | 1203 *success = false; |
| 1205 NPObject* npobject = NULL; | 1204 NPObject* npobject = NULL; |
| 1206 if (plugin_) | 1205 if (plugin_) |
| 1207 npobject = plugin_->GetWindowScriptNPObject(); | 1206 npobject = plugin_->GetWindowScriptNPObject(); |
| 1208 | 1207 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 } | 1527 } |
| 1529 #endif | 1528 #endif |
| 1530 | 1529 |
| 1531 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1530 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
| 1532 int resource_id) { | 1531 int resource_id) { |
| 1533 if (!plugin_) | 1532 if (!plugin_) |
| 1534 return; | 1533 return; |
| 1535 | 1534 |
| 1536 plugin_->URLRedirectResponse(allow, resource_id); | 1535 plugin_->URLRedirectResponse(allow, resource_id); |
| 1537 } | 1536 } |
| OLD | NEW |