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

Unified Diff: ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc

Issue 11778082: estade@ review feedback on r175674 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc
diff --git a/ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc b/ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc
index 77839eade8867ff354cc9385bf5c240f426d4a5f..cdb494d96e3511dcc1bc171ea9433a9f6170a603 100644
--- a/ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc
+++ b/ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc
@@ -9,6 +9,7 @@
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
@@ -239,14 +240,14 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) {
if (!current_extension.empty()) {
if (!filter)
filter = gtk_file_filter_new();
- // |file_extension| is freed in |OnFileFilterDataDestroyed()|.
- std::string* file_extension = new std::string("." + current_extension);
+ scoped_ptr<std::string> file_extension(
+ new std::string("." + current_extension));
+ fallback_labels.insert(std::string("*").append(*file_extension));
gtk_file_filter_add_custom(filter,
GTK_FILE_FILTER_FILENAME,
&FileFilterCaseInsensitive,
- reinterpret_cast<gpointer>(file_extension),
+ file_extension.release(),
&OnFileFilterDataDestroyed);
- fallback_labels.insert(std::string("*").append(*file_extension));
}
}
// We didn't find any non-empty extensions to filter on.
« no previous file with comments | « chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698