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

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

Issue 2544223002: Fix the position of context menu for BrowserPlugins inside OOPIF (Closed)
Patch Set: Addressing lfg@'s comments Created 4 years 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
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 383 }
384 384
385 void BrowserPlugin::updateGeometry(const WebRect& plugin_rect_in_viewport, 385 void BrowserPlugin::updateGeometry(const WebRect& plugin_rect_in_viewport,
386 const WebRect& clip_rect, 386 const WebRect& clip_rect,
387 const WebRect& unobscured_rect, 387 const WebRect& unobscured_rect,
388 const WebVector<WebRect>& cut_outs_rects, 388 const WebVector<WebRect>& cut_outs_rects,
389 bool is_visible) { 389 bool is_visible) {
390 gfx::Rect old_view_rect = view_rect_; 390 gfx::Rect old_view_rect = view_rect_;
391 // Convert the plugin_rect_in_viewport to window coordinates, which is css. 391 // Convert the plugin_rect_in_viewport to window coordinates, which is css.
392 WebRect rect_in_css(plugin_rect_in_viewport); 392 WebRect rect_in_css(plugin_rect_in_viewport);
393 blink::WebView* webview = container()->document().frame()->view(); 393
394 RenderViewImpl::FromWebView(webview)->GetWidget()->convertViewportToWindow( 394 // We will use the local root's RenderWidget to convert coordinates to Window.
395 &rect_in_css); 395 // If this local root belongs to an OOPIF, on the browser side we will have to
396 // consider the displacement of the child frame in root window.
397 RenderFrameImpl::FromWebFrame(container()->document().frame())
398 ->GetRenderWidget()
399 ->convertViewportToWindow(&rect_in_css);
396 view_rect_ = rect_in_css; 400 view_rect_ = rect_in_css;
397 401
398 if (!ready_) { 402 if (!ready_) {
399 if (delegate_) 403 if (delegate_)
400 delegate_->Ready(); 404 delegate_->Ready();
401 ready_ = true; 405 ready_ = true;
402 } 406 }
403 407
404 bool rect_size_changed = view_rect_.size() != old_view_rect.size(); 408 bool rect_size_changed = view_rect_.size() != old_view_rect.size();
405 if (delegate_ && rect_size_changed) 409 if (delegate_ && rect_size_changed)
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 613
610 bool BrowserPlugin::HandleMouseLockedInputEvent( 614 bool BrowserPlugin::HandleMouseLockedInputEvent(
611 const blink::WebMouseEvent& event) { 615 const blink::WebMouseEvent& event) {
612 BrowserPluginManager::Get()->Send( 616 BrowserPluginManager::Get()->Send(
613 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, 617 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_,
614 &event)); 618 &event));
615 return true; 619 return true;
616 } 620 }
617 621
618 } // namespace content 622 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698