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

Unified Diff: chrome/browser/ui/views/constrained_window_views.cc

Issue 321193003: Fix print preview dialog for <webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mac import Created 6 years, 6 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
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/constrained_window_views.cc
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 7a9a3f22053a3f09d7460092725d4cdd572ccf01..5dde7612b929b4466263b40727f0519371fac40e 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/ui/browser_finder.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
@@ -120,8 +121,16 @@ void UpdateBrowserModalDialogPosition(views::Widget* widget,
widget->GetRootView()->GetPreferredSize());
}
-views::Widget* ShowWebModalDialogViews(views::WidgetDelegate* dialog,
- content::WebContents* web_contents) {
+views::Widget* ShowWebModalDialogViews(
+ views::WidgetDelegate* dialog,
+ content::WebContents* initiator_web_contents) {
+ WebViewGuest* web_view_guest = WebViewGuest::FromWebContents(
+ initiator_web_contents);
+ // For embedded WebContents, use the embedder's WebContents for constrained
+ // window.
+ content::WebContents* web_contents =
+ web_view_guest && web_view_guest->embedder_web_contents() ?
+ web_view_guest->embedder_web_contents() : initiator_web_contents;
views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents);
web_modal::WebContentsModalDialogManager::FromWebContents(web_contents)->
ShowModalDialog(widget->GetNativeWindow());
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698