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 14 matching lines...) Expand all Loading... |
25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/shell_dialogs/select_file_dialog.h" | 26 #include "ui/shell_dialogs/select_file_dialog.h" |
27 #include "ui/strings/grit/ui_strings.h" | 27 #include "ui/strings/grit/ui_strings.h" |
28 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" | 28 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Makes sure that .jpg also shows .JPG. | 32 // Makes sure that .jpg also shows .JPG. |
33 gboolean FileFilterCaseInsensitive(const GtkFileFilterInfo* file_info, | 33 gboolean FileFilterCaseInsensitive(const GtkFileFilterInfo* file_info, |
34 std::string* file_extension) { | 34 std::string* file_extension) { |
35 return base::EndsWith(file_info->filename, *file_extension, false); | 35 return base::EndsWith(file_info->filename, *file_extension, |
| 36 base::CompareCase::INSENSITIVE_ASCII); |
36 } | 37 } |
37 | 38 |
38 // Deletes |data| when gtk_file_filter_add_custom() is done with it. | 39 // Deletes |data| when gtk_file_filter_add_custom() is done with it. |
39 void OnFileFilterDataDestroyed(std::string* file_extension) { | 40 void OnFileFilterDataDestroyed(std::string* file_extension) { |
40 delete file_extension; | 41 delete file_extension; |
41 } | 42 } |
42 | 43 |
43 } // namespace | 44 } // namespace |
44 | 45 |
45 namespace libgtk2ui { | 46 namespace libgtk2ui { |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 g_free(filename); | 629 g_free(filename); |
629 if (pixbuf) { | 630 if (pixbuf) { |
630 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); | 631 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); |
631 g_object_unref(pixbuf); | 632 g_object_unref(pixbuf); |
632 } | 633 } |
633 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), | 634 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), |
634 pixbuf ? TRUE : FALSE); | 635 pixbuf ? TRUE : FALSE); |
635 } | 636 } |
636 | 637 |
637 } // namespace libgtk2ui | 638 } // namespace libgtk2ui |
OLD | NEW |