diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 20:56:36 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 20:56:36 +0000 |
commit | f2887ad8d57d8ff1c826bda4311f7acd4edf637e (patch) | |
tree | d84499494880d0d78ea6f7562728360cf2b7ea53 /views | |
parent | 560440269665f15714c2dd1cee17dc2a7ed501dd (diff) | |
download | chromium_src-f2887ad8d57d8ff1c826bda4311f7acd4edf637e.zip chromium_src-f2887ad8d57d8ff1c826bda4311f7acd4edf637e.tar.gz chromium_src-f2887ad8d57d8ff1c826bda4311f7acd4edf637e.tar.bz2 |
Host cookie modal dialog and js modal modal dialog in NativeDialogHost
- Enable modal dialog in NativeDialogHost. This is not fully work in ChromeOS
because e.g. user could still alt-tab away. However, setting modal would
block user from interacting with relevant browser window and avoid crashes;
- Move dialog close code from NativeHostDialog's destructor to WindowClosing
because a dialog's "response" signal handler could rely on the contents;
- Add "check-resize" signal handler to make GtkExpander work nicely with
NativeDialogHost;
- Add ShowModalDialogWithMinLocalizedWidth to gtk_util for cookie and js
modal dialog;
- Change in WidgetGtk::SetBounds to call gtk_window_move/resize always to
keep GtkWindow's geometry info up-to-date;
BUG=none
TEST=Verify cookie prompt and js dialog on ChromeOS is hosted in a Chrome window and not occupy the whole screen.
Review URL: http://codereview.chromium.org/1995001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index f7b35e0..4fa0f39 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -626,12 +626,16 @@ void WidgetGtk::SetBounds(const gfx::Rect& bounds) { if (parent != null_parent_) gtk_fixed_move(GTK_FIXED(parent), widget_, bounds.x(), bounds.y()); } - } else if (GTK_WIDGET_MAPPED(widget_)) { - // If the widget is mapped (on screen), we can move and resize with one - // call, which avoids two separate window manager steps. - gdk_window_move_resize(widget_->window, bounds.x(), bounds.y(), - bounds.width(), bounds.height()); } else { + if (GTK_WIDGET_MAPPED(widget_)) { + // If the widget is mapped (on screen), we can move and resize with one + // call, which avoids two separate window manager steps. + gdk_window_move_resize(widget_->window, bounds.x(), bounds.y(), + bounds.width(), bounds.height()); + } + + // Always call gtk_window_move and gtk_window_resize so that GtkWindow's + // geometry info is up-to-date. GtkWindow* gtk_window = GTK_WINDOW(widget_); // TODO: this may need to set an initial size if not showing. // TODO: need to constrain based on screen size. |