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

Unified Diff: ui/views/window/dialog_delegate.cc

Issue 319013002: Reland Fix Views web-modal dialog widget creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert MediaGalleriesScanResultDialogViews::AcceptDialogForTesting. 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 | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index aabfa6d15e85febe5a1269d23f4dc0c701a01bdb..6c69b35443307685382fe77d81acc8727879c9b6 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -23,20 +23,24 @@ DialogDelegate::~DialogDelegate() {
}
// static
-Widget* DialogDelegate::CreateDialogWidget(DialogDelegate* dialog,
+Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
gfx::NativeView context,
gfx::NativeView parent) {
views::Widget* widget = new views::Widget;
views::Widget::InitParams params;
- params.delegate = dialog;
+ params.delegate = delegate;
+ DialogDelegate* dialog = delegate->AsDialogDelegate();
if (!dialog || dialog->UseNewStyleForThisDialog()) {
params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW;
params.remove_standard_frame = true;
+ // The bubble frame includes its own shadow; remove any native shadowing.
+ params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
}
params.context = context;
params.parent = parent;
- // TODO(msw): Add a matching shadow type and remove the bubble frame border?
- params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
+ // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child
+ // widgets to prevent top-level window behavior (independent movement, etc).
+ params.child = parent && (delegate->GetModalType() == ui::MODAL_TYPE_CHILD);
widget->Init(params);
return widget;
}
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698