OLD | NEW |
---|---|
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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 #include <map> | 6 #include <map> |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 // Xlib defines RootWindow | 10 // Xlib defines RootWindow |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 const FileTypeInfo* file_types, | 221 const FileTypeInfo* file_types, |
222 int file_type_index, | 222 int file_type_index, |
223 const base::FilePath::StringType& default_extension, | 223 const base::FilePath::StringType& default_extension, |
224 gfx::NativeWindow owning_window, | 224 gfx::NativeWindow owning_window, |
225 void* params) { | 225 void* params) { |
226 type_ = type; | 226 type_ = type; |
227 // |owning_window| can be null when user right-clicks on a downloadable item | 227 // |owning_window| can be null when user right-clicks on a downloadable item |
228 // and chooses 'Open Link in New Tab' when 'Ask where to save each file | 228 // and chooses 'Open Link in New Tab' when 'Ask where to save each file |
229 // before downloading.' preference is turned on. (http://crbug.com/29213) | 229 // before downloading.' preference is turned on. (http://crbug.com/29213) |
230 if (owning_window) { | 230 if (owning_window) { |
231 if (IsRunning(owning_window)) { | |
232 LOG(ERROR) << "Select file dialog already in use!"; | |
233 return; | |
Devlin
2014/12/04 20:00:14
This isn't what I was referring to. I meant an ea
| |
234 } | |
231 owning_window->AddObserver(this); | 235 owning_window->AddObserver(this); |
232 parents_.insert(owning_window); | 236 parents_.insert(owning_window); |
233 } | 237 } |
234 | 238 |
235 std::string title_string = base::UTF16ToUTF8(title); | 239 std::string title_string = base::UTF16ToUTF8(title); |
236 | 240 |
237 file_type_index_ = file_type_index; | 241 file_type_index_ = file_type_index; |
238 if (file_types) | 242 if (file_types) |
239 file_types_ = *file_types; | 243 file_types_ = *file_types; |
240 | 244 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
627 g_free(filename); | 631 g_free(filename); |
628 if (pixbuf) { | 632 if (pixbuf) { |
629 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); | 633 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); |
630 g_object_unref(pixbuf); | 634 g_object_unref(pixbuf); |
631 } | 635 } |
632 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), | 636 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), |
633 pixbuf ? TRUE : FALSE); | 637 pixbuf ? TRUE : FALSE); |
634 } | 638 } |
635 | 639 |
636 } // namespace libgtk2ui | 640 } // namespace libgtk2ui |
OLD | NEW |