Chromium Code Reviews| Index: chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc |
| index 045a8e0f47cb3e2a8e50d4f4150c9104d6e11f85..0aa671f3dad21701bf2f61d625467b42588e5bc2 100644 |
| --- a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc |
| +++ b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc |
| @@ -287,6 +287,24 @@ gfx::Insets NativeAppWindowGtk::GetFrameInsets() const { |
| rect_with_decorations.width - current_width - left_inset); |
| } |
| +gfx::Point NativeAppWindowGtk::GetDialogPosition(const gfx::Size& size) { |
| + gint current_width = 0; |
| + gint current_height = 0; |
| + gtk_window_get_size(window_, ¤t_width, ¤t_height); |
| + return gfx::Point(current_width / 2 - size.width() / 2, |
| + current_height / 2 - size.height() / 2); |
| +} |
| + |
| +void NativeAppWindowGtk::AddObserver( |
| + WebContentsModalDialogHostObserver* observer) { |
| + observer_list_.AddObserver(observer); |
| +} |
| + |
| +void NativeAppWindowGtk::RemoveObserver( |
| + WebContentsModalDialogHostObserver* observer) { |
| + observer_list_.RemoveObserver(observer); |
| +} |
| + |
| void NativeAppWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { |
| // Do nothing if we're in the process of closing the browser window. |
| if (!window_) |
| @@ -336,6 +354,10 @@ gboolean NativeAppWindowGtk::OnConfigure(GtkWidget* widget, |
| void NativeAppWindowGtk::OnDebouncedBoundsChanged() { |
| gtk_window_util::UpdateWindowPosition(this, &bounds_, &restored_bounds_); |
| shell_window_->OnNativeWindowChanged(); |
| + |
| + FOR_EACH_OBSERVER(WebContentsModalDialogHostObserver, |
| + observer_list_, |
| + OnPositionRequiresUpdate()); |
|
jeremya
2013/04/04 19:59:17
This code could live in OnNativeWindowChanged(), I
Mike Wittman
2013/04/04 22:56:08
See comment in the .h file. Also, OnNativeWindowC
|
| } |
| gboolean NativeAppWindowGtk::OnWindowState(GtkWidget* sender, |