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

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

Issue 2122023002: Cross-process frames should be notified of device scale factor changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix RenderWidgetHostTest.ResizeScreenInfo. Created 4 years, 4 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); 56 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
57 if (!rwhv) 57 if (!rwhv)
58 return NULL; 58 return NULL;
59 return rwhv->GetNativeView(); 59 return rwhv->GetNativeView();
60 } 60 }
61 61
62 gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const { 62 gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
63 return guest_->embedder_web_contents()->GetTopLevelNativeWindow(); 63 return guest_->embedder_web_contents()->GetTopLevelNativeWindow();
64 } 64 }
65 65
66 void WebContentsViewGuest::GetScreenInfo(
67 blink::WebScreenInfo* web_screen_info) const {
68 if (guest_->embedder_web_contents())
69 guest_->embedder_web_contents()->GetView()->GetScreenInfo(web_screen_info);
oshima 2016/07/29 18:11:46 nit: indent
wjmaclean 2016/07/29 18:40:04 Done.
70 else
71 WebContentsView::GetDefaultScreenInfo(web_screen_info);
72 }
73
66 void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) { 74 void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
67 #if defined(USE_AURA) 75 #if defined(USE_AURA)
68 // In aura, ScreenPositionClient doesn't work properly if we do 76 // In aura, ScreenPositionClient doesn't work properly if we do
69 // not have the native view associated with this WebContentsViewGuest in the 77 // not have the native view associated with this WebContentsViewGuest in the
70 // view hierarchy. We add this view as embedder's child here. 78 // view hierarchy. We add this view as embedder's child here.
71 // This would go in WebContentsViewGuest::CreateView, but that is too early to 79 // This would go in WebContentsViewGuest::CreateView, but that is too early to
72 // access embedder_web_contents(). Therefore, we do it here. 80 // access embedder_web_contents(). Therefore, we do it here.
73 parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView()); 81 parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
74 #endif // defined(USE_AURA) 82 #endif // defined(USE_AURA)
75 } 83 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 embedder_render_view_host->GetDelegate()->GetDelegateView(); 242 embedder_render_view_host->GetDelegate()->GetDelegateView();
235 if (view) { 243 if (view) {
236 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.StartDrag")); 244 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.StartDrag"));
237 view->StartDragging(drop_data, ops, image, image_offset, event_info); 245 view->StartDragging(drop_data, ops, image, image_offset, event_info);
238 } else { 246 } else {
239 embedder_web_contents->SystemDragEnded(); 247 embedder_web_contents->SystemDragEnded();
240 } 248 }
241 } 249 }
242 250
243 } // namespace content 251 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698