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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 bool use_cross_process_frames = | 780 bool use_cross_process_frames = |
781 BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); | 781 BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); |
782 // If a RenderView has already been created for this new window, then we need | 782 // If a RenderView has already been created for this new window, then we need |
783 // to initialize the browser-side state now so that the RenderFrameHostManager | 783 // to initialize the browser-side state now so that the RenderFrameHostManager |
784 // does not create a new RenderView on navigation. | 784 // does not create a new RenderView on navigation. |
785 if (!use_cross_process_frames && has_render_view_) { | 785 if (!use_cross_process_frames && has_render_view_) { |
786 // This will trigger a callback to RenderViewReady after a round-trip IPC. | 786 // This will trigger a callback to RenderViewReady after a round-trip IPC. |
787 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()) | 787 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()) |
788 ->GetWidget() | 788 ->GetWidget() |
789 ->Init(); | 789 ->Init(); |
| 790 GetWebContents()->GetMainFrame()->Init(); |
790 WebContentsViewGuest* web_contents_view = | 791 WebContentsViewGuest* web_contents_view = |
791 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); | 792 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
792 if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { | 793 if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { |
793 web_contents_view->CreateViewForWidget( | 794 web_contents_view->CreateViewForWidget( |
794 web_contents()->GetRenderViewHost()->GetWidget(), true); | 795 web_contents()->GetRenderViewHost()->GetWidget(), true); |
795 } | 796 } |
796 } | 797 } |
797 | 798 |
798 InitInternal(params, embedder_web_contents); | 799 InitInternal(params, embedder_web_contents); |
799 | 800 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 range, character_bounds); | 1060 range, character_bounds); |
1060 } | 1061 } |
1061 #endif | 1062 #endif |
1062 | 1063 |
1063 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1064 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1064 if (delegate_) | 1065 if (delegate_) |
1065 delegate_->SetContextMenuPosition(position); | 1066 delegate_->SetContextMenuPosition(position); |
1066 } | 1067 } |
1067 | 1068 |
1068 } // namespace content | 1069 } // namespace content |
OLD | NEW |