Chromium Code Reviews| 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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1421 } | 1421 } |
| 1422 // When autosize is turned off and as a result there is a layout change, we | 1422 // When autosize is turned off and as a result there is a layout change, we |
| 1423 // send a sizechanged event. | 1423 // send a sizechanged event. |
| 1424 if (!auto_size_enabled_ && last_seen_auto_size_enabled_ && | 1424 if (!auto_size_enabled_ && last_seen_auto_size_enabled_ && |
| 1425 !params.view_rect.size().IsEmpty() && delegate_) { | 1425 !params.view_rect.size().IsEmpty() && delegate_) { |
| 1426 delegate_->SizeChanged(last_seen_view_size_, params.view_rect.size()); | 1426 delegate_->SizeChanged(last_seen_view_size_, params.view_rect.size()); |
| 1427 last_seen_auto_size_enabled_ = false; | 1427 last_seen_auto_size_enabled_ = false; |
| 1428 } | 1428 } |
| 1429 // Invalid damage buffer means we are in HW compositing mode, | 1429 // Invalid damage buffer means we are in HW compositing mode, |
| 1430 // so just resize the WebContents and repaint if needed. | 1430 // so just resize the WebContents and repaint if needed. |
| 1431 if (!base::SharedMemory::IsHandleValid(params.damage_buffer_handle)) { | 1431 if (base::SharedMemory::IsHandleValid(params.damage_buffer_handle)) |
| 1432 if (!params.view_rect.size().IsEmpty()) | 1432 SetDamageBuffer(params); |
| 1433 GetWebContents()->GetView()->SizeContents(params.view_rect.size()); | 1433 if (!params.view_rect.size().IsEmpty()) |
| 1434 if (params.repaint) | 1434 GetWebContents()->GetView()->SizeContents(params.view_rect.size()); |
|
alexst (slow to review)
2013/12/03 17:10:30
Seems like the old code sized contents and set the
| |
| 1435 Send(new ViewMsg_Repaint(routing_id(), params.view_rect.size())); | |
| 1436 return; | |
| 1437 } | |
| 1438 SetDamageBuffer(params); | |
| 1439 GetWebContents()->GetView()->SizeContents(params.view_rect.size()); | |
| 1440 if (params.repaint) | 1435 if (params.repaint) |
| 1441 Send(new ViewMsg_Repaint(routing_id(), params.view_rect.size())); | 1436 Send(new ViewMsg_Repaint(routing_id(), params.view_rect.size())); |
| 1442 } | 1437 } |
| 1443 | 1438 |
| 1444 void BrowserPluginGuest::OnSetFocus(int instance_id, bool focused) { | 1439 void BrowserPluginGuest::OnSetFocus(int instance_id, bool focused) { |
| 1445 if (focused_ == focused) | 1440 if (focused_ == focused) |
| 1446 return; | 1441 return; |
| 1447 focused_ = focused; | 1442 focused_ = focused; |
| 1448 Send(new InputMsg_SetFocus(routing_id(), focused)); | 1443 Send(new InputMsg_SetFocus(routing_id(), focused)); |
| 1449 if (!focused && mouse_locked_) | 1444 if (!focused && mouse_locked_) |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1758 request_info.Set(browser_plugin::kRequestMethod, | 1753 request_info.Set(browser_plugin::kRequestMethod, |
| 1759 base::Value::CreateStringValue(request_method)); | 1754 base::Value::CreateStringValue(request_method)); |
| 1760 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1755 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
| 1761 | 1756 |
| 1762 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, | 1757 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, |
| 1763 new DownloadRequest(callback), | 1758 new DownloadRequest(callback), |
| 1764 request_info); | 1759 request_info); |
| 1765 } | 1760 } |
| 1766 | 1761 |
| 1767 } // namespace content | 1762 } // namespace content |
| OLD | NEW |