Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 2021363002: Fix positioning of widgets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698