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

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

Issue 2165523004: Force MimeHandlerView to always use BrowserPlugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return Top-Level WebContents View's NativeView rather than Owners Created 4 years, 5 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_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 ui::Window* mus_window = aura::GetMusWindow(params.context); 1531 ui::Window* mus_window = aura::GetMusWindow(params.context);
1532 if (mus_window) { 1532 if (mus_window) {
1533 view_.reset(new WebContentsViewMus(mus_window, this, delegate, 1533 view_.reset(new WebContentsViewMus(mus_window, this, delegate,
1534 &render_view_host_delegate_view_)); 1534 &render_view_host_delegate_view_));
1535 } 1535 }
1536 } 1536 }
1537 #endif 1537 #endif
1538 1538
1539 if (!view_) { 1539 if (!view_) {
1540 if (browser_plugin_guest_ && 1540 if (browser_plugin_guest_ &&
1541 !browser_plugin_guest_->IsMimeHandlerViewGuest() &&
1541 BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 1542 BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
1542 view_.reset(new WebContentsViewChildFrame( 1543 view_.reset(new WebContentsViewChildFrame(
1543 this, delegate, &render_view_host_delegate_view_)); 1544 this, delegate, &render_view_host_delegate_view_));
1544 } else { 1545 } else {
1545 view_.reset(CreateWebContentsView(this, delegate, 1546 view_.reset(CreateWebContentsView(this, delegate,
1546 &render_view_host_delegate_view_)); 1547 &render_view_host_delegate_view_));
1547 } 1548 }
1548 } 1549 }
1549 1550
1550 if (browser_plugin_guest_ && 1551 if (browser_plugin_guest_ &&
1551 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 1552 (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests() ||
1553 browser_plugin_guest_->IsMimeHandlerViewGuest())) {
1552 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), 1554 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
1553 std::move(view_), 1555 std::move(view_),
1554 &render_view_host_delegate_view_)); 1556 &render_view_host_delegate_view_));
1555 } 1557 }
1556 CHECK(render_view_host_delegate_view_); 1558 CHECK(render_view_host_delegate_view_);
1557 CHECK(view_.get()); 1559 CHECK(view_.get());
1558 1560
1559 gfx::Size initial_size = params.initial_size; 1561 gfx::Size initial_size = params.initial_size;
1560 view_->CreateView(initial_size, params.context); 1562 view_->CreateView(initial_size, params.context);
1561 1563
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after
4574 4576
4575 void WebContentsImpl::EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) { 4577 void WebContentsImpl::EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) {
4576 WebContentsImpl* source_web_contents = static_cast<WebContentsImpl*>( 4578 WebContentsImpl* source_web_contents = static_cast<WebContentsImpl*>(
4577 WebContents::FromRenderFrameHost(source_rfh)); 4579 WebContents::FromRenderFrameHost(source_rfh));
4578 4580
4579 if (source_web_contents) { 4581 if (source_web_contents) {
4580 // If this message is going to outer WebContents from inner WebContents, 4582 // If this message is going to outer WebContents from inner WebContents,
4581 // then we should not create a RenderView. AttachToOuterWebContentsFrame() 4583 // then we should not create a RenderView. AttachToOuterWebContentsFrame()
4582 // already created a RenderFrameProxyHost for that purpose. 4584 // already created a RenderFrameProxyHost for that purpose.
4583 if (GetBrowserPluginEmbedder() && 4585 if (GetBrowserPluginEmbedder() &&
4584 BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 4586 BrowserPluginGuestMode::UseCrossProcessFramesForGuests() &&
4587 !source_web_contents->GetBrowserPluginGuest()
4588 ->IsMimeHandlerViewGuest()) {
4585 return; 4589 return;
4586 } 4590 }
4587 4591
4588 if (this != source_web_contents && GetBrowserPluginGuest()) { 4592 if (this != source_web_contents && GetBrowserPluginGuest()) {
4589 // We create a RenderFrameProxyHost for the embedder in the guest's render 4593 // We create a RenderFrameProxyHost for the embedder in the guest's render
4590 // process but we intentionally do not expose the embedder's opener chain 4594 // process but we intentionally do not expose the embedder's opener chain
4591 // to it. 4595 // to it.
4592 source_web_contents->GetRenderManager()->CreateRenderFrameProxy( 4596 source_web_contents->GetRenderManager()->CreateRenderFrameProxy(
4593 GetSiteInstance()); 4597 GetSiteInstance());
4594 } else { 4598 } else {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
4977 return node_->outer_contents_frame_tree_node_id(); 4981 return node_->outer_contents_frame_tree_node_id();
4978 4982
4979 return FrameTreeNode::kFrameTreeNodeInvalidId; 4983 return FrameTreeNode::kFrameTreeNodeInvalidId;
4980 } 4984 }
4981 4985
4982 RenderFrameHostManager* WebContentsImpl::GetRenderManager() const { 4986 RenderFrameHostManager* WebContentsImpl::GetRenderManager() const {
4983 return frame_tree_.root()->render_manager(); 4987 return frame_tree_.root()->render_manager();
4984 } 4988 }
4985 4989
4986 WebContentsImpl* WebContentsImpl::GetOuterWebContents() { 4990 WebContentsImpl* WebContentsImpl::GetOuterWebContents() {
4987 if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 4991 if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() &&
4992 (!GetBrowserPluginGuest() ||
4993 !GetBrowserPluginGuest()->IsMimeHandlerViewGuest())) {
4988 if (node_) 4994 if (node_)
4989 return node_->outer_web_contents(); 4995 return node_->outer_web_contents();
4990 } else { 4996 } else {
4991 if (GetBrowserPluginGuest()) 4997 if (GetBrowserPluginGuest())
4992 return GetBrowserPluginGuest()->embedder_web_contents(); 4998 return GetBrowserPluginGuest()->embedder_web_contents();
4993 } 4999 }
4994 return nullptr; 5000 return nullptr;
4995 } 5001 }
4996 5002
4997 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { 5003 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
5176 for (RenderViewHost* render_view_host : render_view_host_set) 5182 for (RenderViewHost* render_view_host : render_view_host_set)
5177 render_view_host->OnWebkitPreferencesChanged(); 5183 render_view_host->OnWebkitPreferencesChanged();
5178 } 5184 }
5179 5185
5180 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5186 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5181 JavaScriptDialogManager* dialog_manager) { 5187 JavaScriptDialogManager* dialog_manager) {
5182 dialog_manager_ = dialog_manager; 5188 dialog_manager_ = dialog_manager;
5183 } 5189 }
5184 5190
5185 } // namespace content 5191 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698