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