OLD | NEW |
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 Loading... |
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( | 66 void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const { |
67 blink::WebScreenInfo* web_screen_info) const { | |
68 if (guest_->embedder_web_contents()) | 67 if (guest_->embedder_web_contents()) |
69 guest_->embedder_web_contents()->GetView()->GetScreenInfo(web_screen_info); | 68 guest_->embedder_web_contents()->GetView()->GetScreenInfo(screen_info); |
70 else | 69 else |
71 WebContentsView::GetDefaultScreenInfo(web_screen_info); | 70 WebContentsView::GetDefaultScreenInfo(screen_info); |
72 } | 71 } |
73 | 72 |
74 void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) { | 73 void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) { |
75 #if defined(USE_AURA) | 74 #if defined(USE_AURA) |
76 // In aura, ScreenPositionClient doesn't work properly if we do | 75 // In aura, ScreenPositionClient doesn't work properly if we do |
77 // not have the native view associated with this WebContentsViewGuest in the | 76 // not have the native view associated with this WebContentsViewGuest in the |
78 // view hierarchy. We add this view as embedder's child here. | 77 // view hierarchy. We add this view as embedder's child here. |
79 // This would go in WebContentsViewGuest::CreateView, but that is too early to | 78 // This would go in WebContentsViewGuest::CreateView, but that is too early to |
80 // access embedder_web_contents(). Therefore, we do it here. | 79 // access embedder_web_contents(). Therefore, we do it here. |
81 parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView()); | 80 parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView()); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 embedder_render_view_host->GetDelegate()->GetDelegateView(); | 241 embedder_render_view_host->GetDelegate()->GetDelegateView(); |
243 if (view) { | 242 if (view) { |
244 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.StartDrag")); | 243 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.StartDrag")); |
245 view->StartDragging(drop_data, ops, image, image_offset, event_info); | 244 view->StartDragging(drop_data, ops, image, image_offset, event_info); |
246 } else { | 245 } else { |
247 embedder_web_contents->SystemDragEnded(); | 246 embedder_web_contents->SystemDragEnded(); |
248 } | 247 } |
249 } | 248 } |
250 | 249 |
251 } // namespace content | 250 } // namespace content |
OLD | NEW |