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

Side by Side Diff: chrome/browser/ui/libgtkui/select_file_dialog_impl_gtk.cc

Issue 2709283003: Allow to open multiple modal file-pickers in Linux (Closed)
Patch Set: add DCHECK_GT Created 3 years, 9 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
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/libgtkui/select_file_dialog_impl_gtk.h" 5 #include "chrome/browser/ui/libgtkui/select_file_dialog_impl_gtk.h"
6 6
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 params_map_[dialog] = params; 169 params_map_[dialog] = params;
170 170
171 // Disable input events handling in the host window to make this dialog modal. 171 // Disable input events handling in the host window to make this dialog modal.
172 if (owning_window) { 172 if (owning_window) {
173 aura::WindowTreeHost* host = owning_window->GetHost(); 173 aura::WindowTreeHost* host = owning_window->GetHost();
174 if (host) { 174 if (host) {
175 std::unique_ptr<base::Closure> callback = 175 std::unique_ptr<base::Closure> callback =
176 views::DesktopWindowTreeHostX11::GetHostForXID( 176 views::DesktopWindowTreeHostX11::GetHostForXID(
177 host->GetAcceleratedWidget()) 177 host->GetAcceleratedWidget())
178 ->DisableEventListening( 178 ->DisableEventListening();
179 GDK_WINDOW_XID(gtk_widget_get_window(dialog)));
180 // OnFilePickerDestroy() is called when |dialog| destroyed, which allows 179 // OnFilePickerDestroy() is called when |dialog| destroyed, which allows
181 // to invoke the callback function to re-enable event handling on the 180 // to invoke the callback function to re-enable event handling on the
182 // owning window. 181 // owning window.
183 g_object_set_data_full( 182 g_object_set_data_full(
184 G_OBJECT(dialog), "callback", callback.release(), 183 G_OBJECT(dialog), "callback", callback.release(),
185 reinterpret_cast<GDestroyNotify>(OnFilePickerDestroy)); 184 reinterpret_cast<GDestroyNotify>(OnFilePickerDestroy));
186 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); 185 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
187 } 186 }
188 } 187 }
189 188
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 g_free(filename); 555 g_free(filename);
557 if (pixbuf) { 556 if (pixbuf) {
558 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); 557 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf);
559 g_object_unref(pixbuf); 558 g_object_unref(pixbuf);
560 } 559 }
561 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), 560 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser),
562 pixbuf ? TRUE : FALSE); 561 pixbuf ? TRUE : FALSE);
563 } 562 }
564 563
565 } // namespace libgtkui 564 } // namespace libgtkui
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698