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

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm

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 | « no previous file | chrome/browser/ui/views/constrained_window_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
index 92a7b68cf992b1cbefa54ab5c814fa38d1a5a16a..7e6031b1c5d93e04d81ec73d54470025f30e0bb3 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
#include "base/logging.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h"
@@ -22,13 +23,18 @@ ConstrainedWindowMac::ConstrainedWindowMac(
content::WebContents* web_contents,
id<ConstrainedWindowSheet> sheet)
: delegate_(delegate),
- web_contents_(web_contents),
+ web_contents_(NULL),
sheet_([sheet retain]),
shown_(false) {
DCHECK(web_contents);
+ WebViewGuest* web_view_guest = WebViewGuest::FromWebContents(web_contents);
+ // For embedded WebContents, use the embedder's WebContents for constrained
+ // window.
+ web_contents_ = web_view_guest && web_view_guest->embedder_web_contents() ?
+ web_view_guest->embedder_web_contents() : web_contents;
DCHECK(sheet_.get());
WebContentsModalDialogManager* web_contents_modal_dialog_manager =
- WebContentsModalDialogManager::FromWebContents(web_contents);
+ WebContentsModalDialogManager::FromWebContents(web_contents_);
web_contents_modal_dialog_manager->ShowModalDialog(this);
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/constrained_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698