| 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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 InitInternal(params, embedder_web_contents); | 773 InitInternal(params, embedder_web_contents); |
| 774 | 774 |
| 775 attached_ = true; | 775 attached_ = true; |
| 776 has_attached_since_surface_set_ = true; | 776 has_attached_since_surface_set_ = true; |
| 777 SendQueuedMessages(); | 777 SendQueuedMessages(); |
| 778 | 778 |
| 779 delegate_->DidAttach(GetGuestProxyRoutingID()); | 779 delegate_->DidAttach(GetGuestProxyRoutingID()); |
| 780 RenderWidgetHostViewGuest* rwhv = static_cast<RenderWidgetHostViewGuest*>( | 780 RenderWidgetHostViewGuest* rwhv = static_cast<RenderWidgetHostViewGuest*>( |
| 781 web_contents()->GetRenderWidgetHostView()); | 781 web_contents()->GetRenderWidgetHostView()); |
| 782 if (rwhv) | 782 if (rwhv) |
| 783 rwhv->RegisterSurfaceNamespaceId(); | 783 rwhv->RegisterFrameSinkId(); |
| 784 has_render_view_ = true; | 784 has_render_view_ = true; |
| 785 | 785 |
| 786 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); | 786 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); |
| 787 } | 787 } |
| 788 | 788 |
| 789 void BrowserPluginGuest::OnDetach(int browser_plugin_instance_id) { | 789 void BrowserPluginGuest::OnDetach(int browser_plugin_instance_id) { |
| 790 if (!attached()) | 790 if (!attached()) |
| 791 return; | 791 return; |
| 792 | 792 |
| 793 // This tells BrowserPluginGuest to queue up all IPCs to BrowserPlugin until | 793 // This tells BrowserPluginGuest to queue up all IPCs to BrowserPlugin until |
| 794 // it's attached again. | 794 // it's attached again. |
| 795 attached_ = false; | 795 attached_ = false; |
| 796 | 796 |
| 797 RenderWidgetHostViewChildFrame* rwhv = | 797 RenderWidgetHostViewChildFrame* rwhv = |
| 798 static_cast<RenderWidgetHostViewChildFrame*>( | 798 static_cast<RenderWidgetHostViewChildFrame*>( |
| 799 web_contents()->GetRenderWidgetHostView()); | 799 web_contents()->GetRenderWidgetHostView()); |
| 800 // If the guest is terminated, our host may already be gone. | 800 // If the guest is terminated, our host may already be gone. |
| 801 if (rwhv) | 801 if (rwhv) |
| 802 rwhv->UnregisterSurfaceNamespaceId(); | 802 rwhv->UnregisterFrameSinkId(); |
| 803 | 803 |
| 804 delegate_->DidDetach(); | 804 delegate_->DidDetach(); |
| 805 } | 805 } |
| 806 | 806 |
| 807 void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, | 807 void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, |
| 808 blink::WebDragStatus drag_status, | 808 blink::WebDragStatus drag_status, |
| 809 const DropData& drop_data, | 809 const DropData& drop_data, |
| 810 blink::WebDragOperationsMask mask, | 810 blink::WebDragOperationsMask mask, |
| 811 const gfx::Point& location) { | 811 const gfx::Point& location) { |
| 812 RenderViewHost* host = GetWebContents()->GetRenderViewHost(); | 812 RenderViewHost* host = GetWebContents()->GetRenderViewHost(); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 range, character_bounds); | 1026 range, character_bounds); |
| 1027 } | 1027 } |
| 1028 #endif | 1028 #endif |
| 1029 | 1029 |
| 1030 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1030 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 1031 if (delegate_) | 1031 if (delegate_) |
| 1032 delegate_->SetContextMenuPosition(position); | 1032 delegate_->SetContextMenuPosition(position); |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 } // namespace content | 1035 } // namespace content |
| OLD | NEW |