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

Unified Diff: chrome/browser/renderer_host/chrome_navigation_ui_data.cc

Issue 2401443002: Fix nested URL blocking needs with PlzNavigate. (Closed)
Patch Set: Created 4 years, 2 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/renderer_host/chrome_navigation_ui_data.cc
diff --git a/chrome/browser/renderer_host/chrome_navigation_ui_data.cc b/chrome/browser/renderer_host/chrome_navigation_ui_data.cc
index cffc26b69a09c795f2632fe1f2b96cb444bc5fe3..c60be91d088935e7d1f11abd967451e13d7c798a 100644
--- a/chrome/browser/renderer_host/chrome_navigation_ui_data.cc
+++ b/chrome/browser/renderer_host/chrome_navigation_ui_data.cc
@@ -7,19 +7,37 @@
#include "base/memory/ptr_util.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "content/public/browser/navigation_handle.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/site_instance.h"
+#include "content/public/browser/web_contents.h"
+
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/browser/extension_registry.h"
+#endif
ChromeNavigationUIData::ChromeNavigationUIData() {}
ChromeNavigationUIData::ChromeNavigationUIData(
content::NavigationHandle* navigation_handle) {
#if defined(ENABLE_EXTENSIONS)
+ content::WebContents* web_contents = navigation_handle->GetWebContents();
SessionTabHelper* session_tab_helper =
- SessionTabHelper::FromWebContents(navigation_handle->GetWebContents());
+ SessionTabHelper::FromWebContents(web_contents);
int tab_id = session_tab_helper ? session_tab_helper->session_id().id() : -1;
int window_id =
session_tab_helper ? session_tab_helper->window_id().id() : -1;
+ bool from_extension = false;
+ extensions::ExtensionRegistry* registry = extensions::ExtensionRegistry::Get(
+ web_contents->GetBrowserContext());
+ if (registry) {
+ const extensions::Extension* extension =
+ registry->enabled_extensions().GetExtensionOrAppByURL(
+ web_contents->GetSiteInstance()->GetSiteURL());
alexmos 2016/10/06 22:37:28 Wouldn't going via web_contents be wrong for OOP s
jam 2016/10/06 22:54:31 Right we wouldn't have a RenderFrameHost yet. Are
alexmos 2016/10/07 01:47:47 Yes, with --isolate-extensions, a top-level extens
jam 2016/10/10 15:36:50 Do you have steps I can use to repro this? i.e. if
alexmos 2016/10/10 17:04:21 AFAIK extensions aren't allowed to use <webview>,
jam 2016/10/10 21:48:15 I should have been more precise, I meant guestview
+ from_extension = !!extension;
+ }
extension_data_ = base::MakeUnique<extensions::ExtensionNavigationUIData>(
- navigation_handle, tab_id, window_id);
+ navigation_handle, from_extension, tab_id, window_id);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698