| Index: extensions/browser/guest_view/web_view/web_view_guest.cc
|
| diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
|
| index 43f68b924cfc13f792bb28c3f1cbeb0edef603f5..515323efb41a8868e657e915d4fe500ade811e6c 100644
|
| --- a/extensions/browser/guest_view/web_view/web_view_guest.cc
|
| +++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
|
|
| +#include "base/command_line.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| @@ -30,6 +31,7 @@
|
| #include "content/public/browser/user_metrics.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/browser/web_contents_delegate.h"
|
| +#include "content/public/common/content_switches.h"
|
| #include "content/public/common/media_stream_request.h"
|
| #include "content/public/common/page_zoom.h"
|
| #include "content/public/common/result_codes.h"
|
| @@ -341,7 +343,11 @@ void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) {
|
| // requests.
|
| PushWebViewStateToIOThread();
|
|
|
| - ApplyAttributes(create_params);
|
| + // TODO(lazyboy): Fix this, site-per-process should also use this code path.
|
| + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kSitePerProcess)) {
|
| + ApplyAttributes(create_params);
|
| + }
|
| }
|
|
|
| void WebViewGuest::AttachWebViewHelpers(WebContents* contents) {
|
| @@ -836,7 +842,7 @@ void WebViewGuest::FrameNameChanged(RenderFrameHost* render_frame_host,
|
| if (name_ == name)
|
| return;
|
|
|
| - ReportFrameNameChange(name);
|
| + // ReportFrameNameChange(name);
|
| }
|
|
|
| void WebViewGuest::ReportFrameNameChange(const std::string& name) {
|
| @@ -1046,8 +1052,8 @@ void WebViewGuest::ApplyAttributes(const base::DictionaryValue& params) {
|
| if (name_.empty())
|
| SetName(name);
|
| }
|
| - if (attached())
|
| - ReportFrameNameChange(name_);
|
| + // if (attached())
|
| + // ReportFrameNameChange(name_);
|
|
|
| std::string user_agent_override;
|
| params.GetString(webview::kParameterUserAgentOverride, &user_agent_override);
|
| @@ -1222,6 +1228,11 @@ content::WebContents* WebViewGuest::OpenURLFromTab(
|
| owner_web_contents(), params);
|
| }
|
|
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kSitePerProcess)) {
|
| + return OpenURLFromTabForSitePerProcess(source, params);
|
| + }
|
| +
|
| // If the guest wishes to navigate away prior to attachment then we save the
|
| // navigation to perform upon attachment. Navigation initializes a lot of
|
| // state that assumes an embedder exists, such as RenderWidgetHostViewGuest.
|
| @@ -1261,6 +1272,23 @@ content::WebContents* WebViewGuest::OpenURLFromTab(
|
| return nullptr;
|
| }
|
|
|
| +content::WebContents* WebViewGuest::OpenURLFromTabForSitePerProcess(
|
| + content::WebContents* source,
|
| + const content::OpenURLParams& params) {
|
| + // site-per-process
|
| + LOG(WARNING) << "source: " << source << ", web_contents: " << web_contents();
|
| + // CHECK(0);
|
| + content::NavigationController::LoadURLParams load_url_params(params.url);
|
| + load_url_params.referrer = params.referrer;
|
| + load_url_params.transition_type = params.transition;
|
| + load_url_params.extra_headers = std::string();
|
| + // load_url_params.frame_tree_node_id = params.frame_tree_node_id;
|
| + load_url_params.transferred_global_request_id =
|
| + params.transferred_global_request_id;
|
| + source->GetController().LoadURLWithParams(load_url_params);
|
| + return source;
|
| +}
|
| +
|
| void WebViewGuest::WebContentsCreated(WebContents* source_contents,
|
| int opener_render_frame_id,
|
| const base::string16& frame_name,
|
|
|