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

Side by Side Diff: content/browser/web_contents/web_contents_view_guest.cc

Issue 2695103003: Fix the position of context menu for BrowserPlugins inside OOPIF (Merge to M-57) (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
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/web_contents/web_contents_view_guest.h" 5 #include "content/browser/web_contents/web_contents_view_guest.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #if defined(USE_AURA) 85 #if defined(USE_AURA)
86 old_parent_view->GetNativeView()->RemoveChild( 86 old_parent_view->GetNativeView()->RemoveChild(
87 platform_view_->GetNativeView()); 87 platform_view_->GetNativeView());
88 #endif // defined(USE_AURA) 88 #endif // defined(USE_AURA)
89 } 89 }
90 90
91 void WebContentsViewGuest::GetContainerBounds(gfx::Rect* out) const { 91 void WebContentsViewGuest::GetContainerBounds(gfx::Rect* out) const {
92 if (guest_->embedder_web_contents()) { 92 if (guest_->embedder_web_contents()) {
93 // We need embedder container's bounds to calculate our bounds. 93 // We need embedder container's bounds to calculate our bounds.
94 guest_->embedder_web_contents()->GetView()->GetContainerBounds(out); 94 guest_->embedder_web_contents()->GetView()->GetContainerBounds(out);
95 gfx::Point guest_coordinates = guest_->GetScreenCoordinates(gfx::Point()); 95 gfx::Point guest_coordinates =
96 guest_->GetCoordinatesInEmbedderWebContents(gfx::Point());
96 out->Offset(guest_coordinates.x(), guest_coordinates.y()); 97 out->Offset(guest_coordinates.x(), guest_coordinates.y());
97 } else { 98 } else {
98 out->set_origin(gfx::Point()); 99 out->set_origin(gfx::Point());
99 } 100 }
100 101
101 out->set_size(size_); 102 out->set_size(size_);
102 } 103 }
103 104
104 void WebContentsViewGuest::SizeContents(const gfx::Size& size) { 105 void WebContentsViewGuest::SizeContents(const gfx::Size& size) {
105 size_ = size; 106 size_ = size;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 if (view) { 243 if (view) {
243 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.StartDrag")); 244 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.StartDrag"));
244 view->StartDragging( 245 view->StartDragging(
245 drop_data, ops, image, image_offset, event_info, source_rwh); 246 drop_data, ops, image, image_offset, event_info, source_rwh);
246 } else { 247 } else {
247 embedder_web_contents->SystemDragEnded(source_rwh); 248 embedder_web_contents->SystemDragEnded(source_rwh);
248 } 249 }
249 } 250 }
250 251
251 } // namespace content 252 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698