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

Side by Side Diff: chrome/browser/gtk/info_bubble_gtk.cc

Issue 159147: Make GTK file dialog box modal for parent window, instead of for the entire... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gtk/info_bubble_gtk.h" 5 #include "chrome/browser/gtk/info_bubble_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "app/gfx/path.h" 10 #include "app/gfx/path.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 gtk_widget_show_all(window_); 203 gtk_widget_show_all(window_);
204 // Make sure our window has focus, is brought to the top, etc. 204 // Make sure our window has focus, is brought to the top, etc.
205 gtk_window_present(GTK_WINDOW(window_)); 205 gtk_window_present(GTK_WINDOW(window_));
206 // We add a GTK (application level) grab. This means we will get all 206 // We add a GTK (application level) grab. This means we will get all
207 // keyboard and mouse events for our application, even if they were delivered 207 // keyboard and mouse events for our application, even if they were delivered
208 // on another window. This allows us to close when the user clicks outside 208 // on another window. This allows us to close when the user clicks outside
209 // of the info bubble. We don't use an X grab since that would steal 209 // of the info bubble. We don't use an X grab since that would steal
210 // keystrokes from your window manager, prevent you from interacting with 210 // keystrokes from your window manager, prevent you from interacting with
211 // other applications, etc. 211 // other applications, etc.
212 //
213 // Before adding the grab, we need to ensure that the bubble is added
214 // to the window group of the top level window. This ensures that the
215 // grab only affects the current browser window, and not all the open
216 // browser windows in the application.
217 gtk_window_group_add_window(gtk_window_get_group(transient_toplevel),
218 GTK_WINDOW(window_));
212 gtk_grab_add(window_); 219 gtk_grab_add(window_);
213 220
214 registrar_.Add(this, NotificationType::ACTIVE_WINDOW_CHANGED, 221 registrar_.Add(this, NotificationType::ACTIVE_WINDOW_CHANGED,
215 NotificationService::AllSources()); 222 NotificationService::AllSources());
216 } 223 }
217 224
218 void InfoBubbleGtk::Observe(NotificationType type, 225 void InfoBubbleGtk::Observe(NotificationType type,
219 const NotificationSource& source, 226 const NotificationSource& source,
220 const NotificationDetails& details) { 227 const NotificationDetails& details) {
221 DCHECK(type.value == NotificationType::ACTIVE_WINDOW_CHANGED); 228 DCHECK(type.value == NotificationType::ACTIVE_WINDOW_CHANGED);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 return TRUE; 279 return TRUE;
273 } 280 }
274 281
275 gboolean InfoBubbleGtk::HandleDestroy() { 282 gboolean InfoBubbleGtk::HandleDestroy() {
276 // We are self deleting, we have a destroy signal setup to catch when we 283 // We are self deleting, we have a destroy signal setup to catch when we
277 // destroy the widget manually, or the window was closed via X. This will 284 // destroy the widget manually, or the window was closed via X. This will
278 // delete the InfoBubbleGtk object. 285 // delete the InfoBubbleGtk object.
279 delete this; 286 delete this;
280 return FALSE; // Propagate. 287 return FALSE; // Propagate.
281 } 288 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/dialogs_gtk.cc ('k') | chrome/browser/renderer_host/render_widget_host_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698