| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 RenderView::FromWebView(webview)->GetWidget()->convertViewportToWindow( | 370 RenderView::FromWebView(webview)->GetWidget()->convertViewportToWindow( |
| 371 &rect_in_css); | 371 &rect_in_css); |
| 372 view_rect_ = rect_in_css; | 372 view_rect_ = rect_in_css; |
| 373 | 373 |
| 374 if (!ready_) { | 374 if (!ready_) { |
| 375 if (delegate_) | 375 if (delegate_) |
| 376 delegate_->Ready(); | 376 delegate_->Ready(); |
| 377 ready_ = true; | 377 ready_ = true; |
| 378 } | 378 } |
| 379 | 379 |
| 380 if (delegate_ && (view_rect_.size() != old_view_rect.size())) | 380 bool rect_size_changed = view_rect_.size() != old_view_rect.size(); |
| 381 if (delegate_ && rect_size_changed) |
| 381 delegate_->DidResizeElement(view_rect_.size()); | 382 delegate_->DidResizeElement(view_rect_.size()); |
| 382 | 383 |
| 383 if (!attached()) | 384 if (!attached()) |
| 384 return; | 385 return; |
| 385 | 386 |
| 386 if (old_view_rect.size() == view_rect_.size()) { | 387 if ((!delegate_ && rect_size_changed) || |
| 388 view_rect_.origin() != old_view_rect.origin()) { |
| 387 // Let the browser know about the updated view rect. | 389 // Let the browser know about the updated view rect. |
| 388 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateGeometry( | 390 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateGeometry( |
| 389 browser_plugin_instance_id_, view_rect_)); | 391 browser_plugin_instance_id_, view_rect_)); |
| 390 return; | 392 return; |
| 391 } | 393 } |
| 392 } | 394 } |
| 393 | 395 |
| 394 void BrowserPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) { | 396 void BrowserPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) { |
| 395 plugin_focused_ = focused; | 397 plugin_focused_ = focused; |
| 396 UpdateGuestFocusState(focus_type); | 398 UpdateGuestFocusState(focus_type); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 570 |
| 569 bool BrowserPlugin::HandleMouseLockedInputEvent( | 571 bool BrowserPlugin::HandleMouseLockedInputEvent( |
| 570 const blink::WebMouseEvent& event) { | 572 const blink::WebMouseEvent& event) { |
| 571 BrowserPluginManager::Get()->Send( | 573 BrowserPluginManager::Get()->Send( |
| 572 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 574 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
| 573 &event)); | 575 &event)); |
| 574 return true; | 576 return true; |
| 575 } | 577 } |
| 576 | 578 |
| 577 } // namespace content | 579 } // namespace content |
| OLD | NEW |