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

Unified Diff: extensions/browser/guest_view/web_view/web_view_content_script_manager.cc

Issue 1062963006: Make WebUI webview content script work with incognito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webui_api_4
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc b/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
index 15ede19ff331f09e80ce3c4bd568ea9fcfbe411b..7a3383dff703fe2d450b998d8cfbbd8c114cddc0 100644
--- a/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
+++ b/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
@@ -122,6 +122,8 @@ void WebViewContentScriptManager::AddContentScripts(
->GetDeclarativeUserScriptMasterByID(host_id);
DCHECK(master);
+ bool is_incognito = browser_context_->IsOffTheRecord();
+
// We need to update WebViewRenderState in the IO thread if the guest exists.
std::set<int> ids_to_add;
@@ -154,7 +156,8 @@ void WebViewContentScriptManager::AddContentScripts(
}
// Step 3: adds new scripts to the master.
- master->AddScripts(scripts, embedder_process_id, embedder_routing_id);
+ master->AddScripts(
+ scripts, embedder_process_id, embedder_routing_id, is_incognito);
// Step 4: creates owner web contents observer for the given
// |embedder_web_contents| if it doesn't exist.

Powered by Google App Engine
This is Rietveld 408576698