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

Unified Diff: chrome/browser/gtk/gtk_util.cc

Issue 2501001: Update dialog parent handling logic. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 7 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
Index: chrome/browser/gtk/gtk_util.cc
diff --git a/chrome/browser/gtk/gtk_util.cc b/chrome/browser/gtk/gtk_util.cc
index c4b1ab077c9db5def8b632ca200f0d0e0b2dcb98..6e303ca343c005d28516305a98af677cfd6b6a28 100644
--- a/chrome/browser/gtk/gtk_util.cc
+++ b/chrome/browser/gtk/gtk_util.cc
@@ -925,8 +925,16 @@ bool AddWindowAlphaChannel(GtkWidget* window) {
#if defined(OS_CHROMEOS)
+GtkWindow* GetDialogTransientParent(GtkWindow* dialog) {
+ GtkWindow* parent = gtk_window_get_transient_for(dialog);
+ if (!parent)
+ parent = chromeos::GetOptionsViewParent();
+
+ return parent;
+}
+
void ShowDialog(GtkWidget* dialog) {
- chromeos::ShowNativeDialog(chromeos::GetOptionsViewParent(),
+ chromeos::ShowNativeDialog(GetDialogTransientParent(GTK_WINDOW(dialog)),
dialog, chromeos::DIALOG_FLAG_DEFAULT, gfx::Size(), gfx::Size());
}
@@ -939,7 +947,7 @@ void ShowDialogWithLocalizedSize(GtkWidget* dialog,
int height = (height_id == -1) ? 0 :
views::Window::GetLocalizedContentsHeight(height_id);
- chromeos::ShowNativeDialog(chromeos::GetOptionsViewParent(),
+ chromeos::ShowNativeDialog(GetDialogTransientParent(GTK_WINDOW(dialog)),
dialog,
resizeable ? chromeos::DIALOG_FLAG_RESIZEABLE :
chromeos::DIALOG_FLAG_DEFAULT,
@@ -952,7 +960,7 @@ void ShowModalDialogWithMinLocalizedWidth(GtkWidget* dialog,
int width = (width_id == -1) ? 0 :
views::Window::GetLocalizedContentsWidth(width_id);
- chromeos::ShowNativeDialog(chromeos::GetOptionsViewParent(),
+ chromeos::ShowNativeDialog(GetDialogTransientParent(GTK_WINDOW(dialog)),
dialog,
chromeos::DIALOG_FLAG_MODAL,
gfx::Size(),
@@ -969,6 +977,10 @@ void PresentWindow(GtkWidget* window, int timestamp) {
gtk_window_present(host_window);
}
+GtkWindow* GetDialogWindow(GtkWidget* dialog) {
+ return chromeos::GetNativeDialogWindow(dialog);
+}
+
#else
void ShowDialog(GtkWidget* dialog) {
@@ -1007,6 +1019,10 @@ void PresentWindow(GtkWidget* window, int timestamp) {
gtk_window_present(GTK_WINDOW(window));
}
+GtkWindow* GetDialogWindow(GtkWidget* dialog) {
+ return dialog;
+}
+
#endif
} // namespace gtk_util

Powered by Google App Engine
This is Rietveld 408576698