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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1242 } | 1242 } |
1243 } | 1243 } |
1244 | 1244 |
1245 void BrowserPluginGuest::OnPluginDestroyed(int instance_id) { | 1245 void BrowserPluginGuest::OnPluginDestroyed(int instance_id) { |
1246 Destroy(); | 1246 Destroy(); |
1247 } | 1247 } |
1248 | 1248 |
1249 void BrowserPluginGuest::OnResizeGuest( | 1249 void BrowserPluginGuest::OnResizeGuest( |
1250 int instance_id, | 1250 int instance_id, |
1251 const BrowserPluginHostMsg_ResizeGuest_Params& params) { | 1251 const BrowserPluginHostMsg_ResizeGuest_Params& params) { |
1252 if (!params.size_changed) | |
Cris Neckar
2013/07/22 19:56:05
I don't understand why you need to send this? If t
Fady Samuel
2013/07/22 20:20:47
This method is called from multiple places (not ju
| |
1253 return; | |
1252 // BrowserPlugin manages resize flow control itself and does not depend | 1254 // BrowserPlugin manages resize flow control itself and does not depend |
1253 // on RenderWidgetHost's mechanisms for flow control, so we reset those flags | 1255 // on RenderWidgetHost's mechanisms for flow control, so we reset those flags |
1254 // here. If we are setting the size for the first time before navigating then | 1256 // here. If we are setting the size for the first time before navigating then |
1255 // BrowserPluginGuest does not yet have a RenderViewHost. | 1257 // BrowserPluginGuest does not yet have a RenderViewHost. |
1256 if (GetWebContents()->GetRenderViewHost()) { | 1258 if (GetWebContents()->GetRenderViewHost()) { |
1257 RenderWidgetHostImpl* render_widget_host = | 1259 RenderWidgetHostImpl* render_widget_host = |
1258 RenderWidgetHostImpl::From(GetWebContents()->GetRenderViewHost()); | 1260 RenderWidgetHostImpl::From(GetWebContents()->GetRenderViewHost()); |
1259 render_widget_host->ResetSizeAndRepaintPendingFlags(); | 1261 render_widget_host->ResetSizeAndRepaintPendingFlags(); |
1260 | 1262 |
1261 if (guest_device_scale_factor_ != params.scale_factor) { | 1263 if (guest_device_scale_factor_ != params.scale_factor) { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1472 request_info.Set( | 1474 request_info.Set( |
1473 browser_plugin::kURL, | 1475 browser_plugin::kURL, |
1474 base::Value::CreateStringValue(request.security_origin.spec())); | 1476 base::Value::CreateStringValue(request.security_origin.spec())); |
1475 SendMessageToEmbedder(new BrowserPluginMsg_RequestPermission( | 1477 SendMessageToEmbedder(new BrowserPluginMsg_RequestPermission( |
1476 instance_id(), BrowserPluginPermissionTypeMedia, | 1478 instance_id(), BrowserPluginPermissionTypeMedia, |
1477 request_id, request_info)); | 1479 request_id, request_info)); |
1478 } | 1480 } |
1479 | 1481 |
1480 void BrowserPluginGuest::OnUpdateRect( | 1482 void BrowserPluginGuest::OnUpdateRect( |
1481 const ViewHostMsg_UpdateRect_Params& params) { | 1483 const ViewHostMsg_UpdateRect_Params& params) { |
1482 | |
1483 BrowserPluginMsg_UpdateRect_Params relay_params; | 1484 BrowserPluginMsg_UpdateRect_Params relay_params; |
1484 relay_params.view_size = params.view_size; | 1485 relay_params.view_size = params.view_size; |
1485 relay_params.scale_factor = params.scale_factor; | 1486 relay_params.scale_factor = params.scale_factor; |
1486 relay_params.is_resize_ack = ViewHostMsg_UpdateRect_Flags::is_resize_ack( | 1487 relay_params.is_resize_ack = ViewHostMsg_UpdateRect_Flags::is_resize_ack( |
1487 params.flags); | 1488 params.flags); |
1488 relay_params.needs_ack = params.needs_ack; | 1489 relay_params.needs_ack = params.needs_ack; |
1489 | 1490 |
1490 // HW accelerated case, acknowledge resize only | 1491 // HW accelerated case, acknowledge resize only |
1491 if (!params.needs_ack || !damage_buffer_) { | 1492 if (!params.needs_ack || !damage_buffer_) { |
1492 relay_params.damage_buffer_sequence_id = 0; | 1493 relay_params.damage_buffer_sequence_id = 0; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1546 base::Value::CreateStringValue(request_method)); | 1547 base::Value::CreateStringValue(request_method)); |
1547 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1548 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
1548 | 1549 |
1549 SendMessageToEmbedder( | 1550 SendMessageToEmbedder( |
1550 new BrowserPluginMsg_RequestPermission(instance_id(), | 1551 new BrowserPluginMsg_RequestPermission(instance_id(), |
1551 BrowserPluginPermissionTypeDownload, permission_request_id, | 1552 BrowserPluginPermissionTypeDownload, permission_request_id, |
1552 request_info)); | 1553 request_info)); |
1553 } | 1554 } |
1554 | 1555 |
1555 } // namespace content | 1556 } // namespace content |
OLD | NEW |