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 EndsWith(file_info->filename, *file_extension, false); | 35 return base::EndsWith(file_info->filename, *file_extension, false); |
36 } | 36 } |
37 | 37 |
38 // Deletes |data| when gtk_file_filter_add_custom() is done with it. | 38 // Deletes |data| when gtk_file_filter_add_custom() is done with it. |
39 void OnFileFilterDataDestroyed(std::string* file_extension) { | 39 void OnFileFilterDataDestroyed(std::string* file_extension) { |
40 delete file_extension; | 40 delete file_extension; |
41 } | 41 } |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 namespace libgtk2ui { | 45 namespace libgtk2ui { |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 g_free(filename); | 627 g_free(filename); |
628 if (pixbuf) { | 628 if (pixbuf) { |
629 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); | 629 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); |
630 g_object_unref(pixbuf); | 630 g_object_unref(pixbuf); |
631 } | 631 } |
632 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), | 632 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), |
633 pixbuf ? TRUE : FALSE); | 633 pixbuf ? TRUE : FALSE); |
634 } | 634 } |
635 | 635 |
636 } // namespace libgtk2ui | 636 } // namespace libgtk2ui |
OLD | NEW |