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 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
16 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "chrome/browser/ui/gtk/select_file_dialog_impl.h" | 18 #include "chrome/browser/ui/gtk/select_file_dialog_impl.h" |
19 #include "chrome/browser/ui/select_file_dialog.h" | 19 #include "chrome/browser/ui/select_file_dialog.h" |
20 #include "content/public/browser/browser_thread.h" | |
21 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
22 #include "ui/base/gtk/gtk_signal.h" | 21 #include "ui/base/gtk/gtk_signal.h" |
23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
24 | 23 |
25 // Implementation of SelectFileDialog that shows a Gtk common dialog for | 24 // Implementation of SelectFileDialog that shows a Gtk common dialog for |
26 // choosing a file or folder. This acts as a modal dialog. | 25 // choosing a file or folder. This acts as a modal dialog. |
27 class SelectFileDialogImplGTK : public SelectFileDialogImpl { | 26 class SelectFileDialogImplGTK : public SelectFileDialogImpl { |
28 public: | 27 public: |
29 explicit SelectFileDialogImplGTK(Listener* listener); | 28 explicit SelectFileDialogImplGTK(Listener* listener); |
30 | 29 |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file_at_size(filename, kPreviewWidth, | 537 GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file_at_size(filename, kPreviewWidth, |
539 kPreviewHeight, NULL); | 538 kPreviewHeight, NULL); |
540 g_free(filename); | 539 g_free(filename); |
541 if (pixbuf) { | 540 if (pixbuf) { |
542 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); | 541 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); |
543 g_object_unref(pixbuf); | 542 g_object_unref(pixbuf); |
544 } | 543 } |
545 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), | 544 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), |
546 pixbuf ? TRUE : FALSE); | 545 pixbuf ? TRUE : FALSE); |
547 } | 546 } |
OLD | NEW |