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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
784 bool use_cross_process_frames = | 784 bool use_cross_process_frames = |
785 BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); | 785 BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); |
786 // If a RenderView has already been created for this new window, then we need | 786 // If a RenderView has already been created for this new window, then we need |
787 // to initialize the browser-side state now so that the RenderFrameHostManager | 787 // to initialize the browser-side state now so that the RenderFrameHostManager |
788 // does not create a new RenderView on navigation. | 788 // does not create a new RenderView on navigation. |
789 if (!use_cross_process_frames && has_render_view_) { | 789 if (!use_cross_process_frames && has_render_view_) { |
790 // This will trigger a callback to RenderViewReady after a round-trip IPC. | 790 // This will trigger a callback to RenderViewReady after a round-trip IPC. |
791 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()) | 791 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()) |
792 ->GetWidget() | 792 ->GetWidget() |
793 ->Init(); | 793 ->Init(); |
794 GetWebContents()->GetMainFrame()->Init(); | |
nasko
2016/01/07 19:58:39
Uh, this is unfortunate. Can we avoid calling this
Charlie Harrison
2016/01/07 22:47:05
Yeah this is extremely ugly. All the original code
| |
794 WebContentsViewGuest* web_contents_view = | 795 WebContentsViewGuest* web_contents_view = |
795 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); | 796 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
796 if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { | 797 if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { |
797 web_contents_view->CreateViewForWidget( | 798 web_contents_view->CreateViewForWidget( |
798 web_contents()->GetRenderViewHost()->GetWidget(), true); | 799 web_contents()->GetRenderViewHost()->GetWidget(), true); |
799 } | 800 } |
800 } | 801 } |
801 | 802 |
802 InitInternal(params, embedder_web_contents); | 803 InitInternal(params, embedder_web_contents); |
803 | 804 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1063 range, character_bounds); | 1064 range, character_bounds); |
1064 } | 1065 } |
1065 #endif | 1066 #endif |
1066 | 1067 |
1067 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1068 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1068 if (delegate_) | 1069 if (delegate_) |
1069 delegate_->SetContextMenuPosition(position); | 1070 delegate_->SetContextMenuPosition(position); |
1070 } | 1071 } |
1071 | 1072 |
1072 } // namespace content | 1073 } // namespace content |
OLD | NEW |