| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 params_map_[dialog] = params; | 158 params_map_[dialog] = params; |
| 159 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); | 159 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
| 160 gtk_widget_show_all(dialog); | 160 gtk_widget_show_all(dialog); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void SelectFileDialogImpl::FileSelected(GtkWidget* dialog, | 163 void SelectFileDialogImpl::FileSelected(GtkWidget* dialog, |
| 164 const FilePath& path) { | 164 const FilePath& path) { |
| 165 void* params = PopParamsForDialog(dialog); | 165 void* params = PopParamsForDialog(dialog); |
| 166 if (listener_) | 166 if (listener_) |
| 167 listener_->FileSelected(path.ToWStringHack(), 0, params); | 167 listener_->FileSelected(path.ToWStringHack(), 1, params); |
| 168 RemoveParentForDialog(dialog); | 168 RemoveParentForDialog(dialog); |
| 169 gtk_widget_destroy(dialog); | 169 gtk_widget_destroy(dialog); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void SelectFileDialogImpl::MultiFilesSelected(GtkWidget* dialog, | 172 void SelectFileDialogImpl::MultiFilesSelected(GtkWidget* dialog, |
| 173 const std::vector<std::wstring>& files) { | 173 const std::vector<std::wstring>& files) { |
| 174 void* params = PopParamsForDialog(dialog); | 174 void* params = PopParamsForDialog(dialog); |
| 175 if (listener_) | 175 if (listener_) |
| 176 listener_->MultiFilesSelected(files, params); | 176 listener_->MultiFilesSelected(files, params); |
| 177 RemoveParentForDialog(dialog); | 177 RemoveParentForDialog(dialog); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 std::vector<std::wstring> filenames_w; | 288 std::vector<std::wstring> filenames_w; |
| 289 for (GSList* iter = filenames; iter != NULL; iter = g_slist_next(iter)) { | 289 for (GSList* iter = filenames; iter != NULL; iter = g_slist_next(iter)) { |
| 290 filenames_w.push_back(base::SysNativeMBToWide( | 290 filenames_w.push_back(base::SysNativeMBToWide( |
| 291 static_cast<char*>(iter->data))); | 291 static_cast<char*>(iter->data))); |
| 292 g_free(iter->data); | 292 g_free(iter->data); |
| 293 } | 293 } |
| 294 | 294 |
| 295 g_slist_free(filenames); | 295 g_slist_free(filenames); |
| 296 dialog_impl->MultiFilesSelected(dialog, filenames_w); | 296 dialog_impl->MultiFilesSelected(dialog, filenames_w); |
| 297 } | 297 } |
| OLD | NEW |