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

Unified Diff: extensions/browser/extension_host.cc

Issue 458323002: Change GuestViewInternalCreateGuestFunction to create the guest view using the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 6 years, 4 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/extension_host.cc
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc
index 2f0572e5330abb1ec9c2c937c011f5e162e71fc3..68515044edbe3727c795ef9ed41b824a3b92ab72 100644
--- a/extensions/browser/extension_host.cc
+++ b/extensions/browser/extension_host.cc
@@ -362,6 +362,12 @@ void ExtensionHost::OnDecrementLazyKeepaliveCount() {
pm->DecrementLazyKeepaliveCount(extension());
}
+// ExtensionFunctionDispatcher::Delegate
+
+content::WebContents* ExtensionHost::GetAssociatedWebContents() const {
+ return host_contents();
+}
+
// content::WebContentsObserver
void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) {
@@ -392,18 +398,22 @@ void ExtensionHost::AddNewContents(WebContents* source,
// the case of extensions in 'spanning' incognito mode, they can mismatch.
// We don't want to end up putting a normal tab into an incognito window, or
// vice versa.
+ //
// Note that we don't do this for popup windows, because we need to associate
// those with their extension_app_id.
if (disposition != NEW_POPUP) {
- WebContents* associated_contents = GetAssociatedWebContents();
- if (associated_contents &&
- associated_contents->GetBrowserContext() ==
+ WebContents* visible_contents = GetVisibleWebContents();
+ if (visible_contents &&
+ visible_contents->GetBrowserContext() ==
new_contents->GetBrowserContext()) {
- WebContentsDelegate* delegate = associated_contents->GetDelegate();
+ WebContentsDelegate* delegate = visible_contents->GetDelegate();
if (delegate) {
- delegate->AddNewContents(
- associated_contents, new_contents, disposition, initial_pos,
- user_gesture, was_blocked);
+ delegate->AddNewContents(visible_contents,
+ new_contents,
+ disposition,
+ initial_pos,
+ user_gesture,
+ was_blocked);
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698