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

Unified Diff: chrome/browser/extensions/extension_tab_util.cc

Issue 2830903003: PS - Scrub URL down to origin in Public Sessions (Closed)
Patch Set: Rebase Created 3 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: chrome/browser/extensions/extension_tab_util.cc
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index c22806a407507bcf19179492e270684ccf551860..58fc3b70de4117408bfc241bea5680a626da2cdc 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -115,6 +115,8 @@ int GetTabIdForExtensions(const WebContents* web_contents) {
return SessionTabHelper::IdForTab(web_contents);
}
+ExtensionTabUtil::Delegate* g_delegate = nullptr;
+
} // namespace
ExtensionTabUtil::OpenTabParams::OpenTabParams()
@@ -449,6 +451,14 @@ std::unique_ptr<api::tabs::MutedInfo> ExtensionTabUtil::CreateMutedInfo(
}
// static
+void ExtensionTabUtil::SetPlatformDelegate(Delegate* delegate) {
+ // Allow setting it only once (also allow reset to nullptr, but then take
+ // special care to free it).
+ CHECK(!g_delegate || !delegate);
+ g_delegate = delegate;
+}
+
+// static
void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension,
content::WebContents* contents,
api::tabs::Tab* tab) {
@@ -475,6 +485,8 @@ void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension,
tab->title.reset();
tab->fav_icon_url.reset();
}
+ if (g_delegate)
+ g_delegate->ScrubTabForExtension(extension, contents, tab);
}
bool ExtensionTabUtil::GetTabStripModel(const WebContents* web_contents,

Powered by Google App Engine
This is Rietveld 408576698