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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc

Issue 2541063002: Revert of Remove about:srcdoc url conversion. (Closed)
Patch Set: Created 4 years 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/api/web_navigation/web_navigation_api_helpers.cc
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
index c3dd31c658f254dd7413f5d62b6de9a0d672edf4..3f1e5a4aa9900b1928d6fb2b720e1357d11962f7 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
@@ -64,6 +64,8 @@
// Constructs and dispatches an onBeforeNavigate event.
void DispatchOnBeforeNavigate(content::NavigationHandle* navigation_handle) {
GURL url(navigation_handle->GetURL());
+ if (navigation_handle->IsSrcdoc())
+ url = GURL(content::kAboutSrcDocURL);
web_navigation::OnBeforeNavigate::Details details;
details.tab_id =
@@ -93,6 +95,9 @@
content::RenderFrameHost* frame_host =
navigation_handle->GetRenderFrameHost();
ui::PageTransition transition_type = navigation_handle->GetPageTransition();
+
+ if (navigation_handle->IsSrcdoc())
+ url = GURL(content::kAboutSrcDocURL);
std::unique_ptr<base::ListValue> args(new base::ListValue());
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

Powered by Google App Engine
This is Rietveld 408576698